arkency / ruby-build-cookbook

Cookbook providing definition to install Ruby for user using ruby-build.
11 stars 1 forks source link

Consider creating ruby-build::ruby recipe #9

Open paneq opened 11 years ago

paneq commented 11 years ago
builds = node['ruby-build'] || []
builds.each do |build|
  ruby "#{build['version']}-#{build['user']}" do
    version     build['version']
    home        build['dir']
    owner       build['user']
    export_path true
  end
end

To allow installing ruby via setting attributes such as:

{
        'ruby-build' => [{
          'version'  => '1.9.3-p448',
          'user'     => 'vagrant',
          'dir'      => '/home/vagrant'
        }]
}

Sometimes it is just enough and using definition is not even possible. Example: In vagrant provisioning one can only set attributes.