Ruby Strings
symbol what it does + concatenate “a” “b” => -1 >> “a” “a” => 0 >> “b” “a” => 1 Some more string methods, using examples: >> s = “hello”…
Succeed with Automated Testing and TDD
symbol what it does + concatenate “a” “b” => -1 >> “a” “a” => 0 >> “b” “a” => 1 Some more string methods, using examples: >> s = “hello”…
1) Use the “system” method system “ls” 2) Or use backticks. Note that backticks support you returning to the results and assigning them to a variable res = `ls` res…
Some great shortcuts for script generation. I always try to start by building scaffold for any new entity, then remove the scaffold as needed, leaving only the pieces of the…
def is_a_number?(s) s.to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/) == nil? false : true end
I’m working with a plugin that I wrote. I want to pull the plugin into an app I’m writing, but still be able to make changes to the plugin and…
How can I search for available rake tasks? rake -T | grep gem (where “gem” is the thing you are searching for) The above example will return all of the…
Gems are installed by sources, or a repository which holds several gems. Generally all the gems you will need are either in gems.rubyforge.org or gems.github.com, so once you setup these…