Ruby: Difference between revisions

From miki
Jump to navigation Jump to search
(Created page with "== Gem install == === Offline install === To install Ruby gems on an offline machine (i.e. without internet connection). To get help: <source lang=bash> gem help </source> O...")
 
 
Line 18: Line 18:
cd tmp/cache
cd tmp/cache
gem install -f --local *.gem # use 'sudo ...' for global install
gem install -f --local *.gem # use 'sudo ...' for global install
</source>

== 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
<source lang=ruby>
<% @args.each do |val| -%>"<%= val %>" <% end -%>
</source>
</source>

Latest revision as of 13:17, 30 November 2016

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 -%>