Ruby

From miki
Jump to navigation Jump to search

Gem install

Offline install

To install Ruby gems on an offline machine (i.e. without internet connection).

To get help:

gem help

On a machine with internet connection:

gem install -i tmp cucumber              # ... or ...
gem install -i tmp cucumber -v 0.10.7    # to install a specific version

On the offline machine:

cd tmp/cache
gem install -f --local *.gem             # use 'sudo ...' for global install

ERB Language

Reference: https://docs.puppet.com/puppet/latest/reference/lang_template_erb.html#testing-for-undefined-variables

Examples:

  • This will surround all passed arguments by quotes
<% @args.each do |val| -%>"<%= val %>" <% end -%>