Chris Jones 59ff335729 [ruby] add note about using `bundle` to add a gem to a `Gemfile` via a cli | 4 anos atrás | |
---|---|---|
.. | ||
README.md | 4 anos atrás | |
gemrc | 6 anos atrás | |
irbrc | 5 anos atrás |
Notes regarding the Ruby programming language
To lint, ie. check a ruby source file for syntax errors
ruby -c /path/to/mr-fancy-42.rb
To execute a shell command within a Ruby source file
`echo 'hello from shell`
An alternative to the above syntax is to use system instead of a pair of back ticks, ie. ``
system "echo 'hello from shell'"
I had better results using back ticks as opposed to using system for storing information into and out of variables.
To install a specific gem for a specific bundle, ie. insert a gem into the local Gemfile with the version specified
bundle add [gem]
open the the
Gemfile
and move to appropriate group if needed