Chris Jones 59ff335729 [ruby] add note about using `bundle` to add a gem to a `Gemfile` via a cli | %!s(int64=4) %!d(string=hai) anos | |
---|---|---|
.. | ||
README.md | %!s(int64=4) %!d(string=hai) anos | |
gemrc | %!s(int64=6) %!d(string=hai) anos | |
irbrc | %!s(int64=5) %!d(string=hai) anos |
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