Skip to content
This repository has been archived by the owner on Dec 24, 2019. It is now read-only.

Frequently Asked Questions

Victor Klos edited this page Sep 23, 2015 · 10 revisions

How do I find the latest version of a gem installed?

GemHelper.has?(‘rails’)

What system/version/release am I on?

host.system_str => ‘linux’
host.flavour_str => ‘ubuntu’
host.name => ‘hardy’
host.name_str => ‘Hardy Heron’

How to determine if a rendered file has changed?

Sometimes you have a dep that “represents” a specific file. You can use Inkan for this like so:

dep 'file must be unchanged' do
  met? { Inkan.legitimate? '/path/to/some/file' }
  meet { render_erb files/source, :to => '/path/to/some/file' }
end

What can I do if my script can’t cope with some situation

You can define something `unmeetable` like so:

dep 'no can do' do
  setup {
    unmeetable! "This dep has to be run as root." unless shell('whoami') == 'root'
  }
end