cookbook 'rubies', '~> 0.1.0', :supermarket
rubies (1) Versions 0.1.0 Follow0
Installs different Ruby versions, chruby for switching and any gems required
cookbook 'rubies', '~> 0.1.0'
knife supermarket install rubies
knife supermarket download rubies
rubies cookbook
This cookbook installs different ruby versions using ruby-install (https://github.com/postmodern/ruby-install), installs chruby (https://github.com/postmodern/chruby) for switching between rubies and optionally installs Bundler under those rubies.
My plan is to expand this to be able to specify a list of gems to install under all rubies, a list of gems for each ruby version and a LWRP for installing gems under each ruby version.
Also to do is to add tests.
Requirements
The following cookbooks are required:
build_essential - install the required build tools & compilers - https://github.com/opscode-cookbooks/build-essential
chruby_install - install chruby. Not currently on the community site, but available here: https://github.com/ichilton/chef_chruby_install
ruby_install - install rubies using ruby-install - https://github.com/rosstimson/chef-ruby_install
Currently only tested on Ubuntu 12.04
The included Vagrantfile requires the vagrant-berkshelf and vagrant-omnibus plugins:
vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-omnibus
Usage
Set attributes in your attributes file, such as:
default[:rubies][:list] = [ 'ruby 1.9.3-p194', 'ruby 2.0.0-p195' ]
default[:rubies][:install_bundler] = true
Include the rubies default recipe (or include rubies in your run list):
include_recipe 'rubies'
Attributes
node[:rubies][:list] - array of ruby types/versions to install (defaults to: [ 'ruby 2.0.0-p195' ])
node[:rubies][:install_bundler] - boolean specifying whether to install bundler under each ruby version (defaults to: true). Note that this currently only works if you are listing full ruby versions (eg: 'ruby 2.0.0-p195').
The bundler install will not currently work with partial version numbers (eg: "ruby-install ruby" or "ruby-install ruby 1.9.3"), despite ruby-install supporting it. I'm working with Ross on support in the chef_ruby-install cookbook for this.
Note the attributes in the chruby_install cookbook (https://github.com/ichilton/chef_chruby_install) which you can set, for example setting the default ruby.
Recipes
default
Author
Author:: Ian Chilton (ian@ichilton.co.uk)
Dependent cookbooks
build-essential >= 0.0.0 |
chruby_install >= 0.0.0 |
ruby_install >= 0.0.0 |
Contingent cookbooks
Collaborator Number Metric
0.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC064: Ensure issues_url is set in metadata: rubies/metadata.rb:1
FC065: Ensure source_url is set in metadata: rubies/metadata.rb:1
FC066: Ensure chef_version is set in metadata: rubies/metadata.rb:1
FC122: Use the build_essential resource instead of the recipe: rubies/recipes/default.rb:6
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Publish Metric
0.1.0 passed this metric
Supported Platforms Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC064: Ensure issues_url is set in metadata: rubies/metadata.rb:1
FC065: Ensure source_url is set in metadata: rubies/metadata.rb:1
FC066: Ensure chef_version is set in metadata: rubies/metadata.rb:1
FC122: Use the build_essential resource instead of the recipe: rubies/recipes/default.rb:6
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Publish Metric
0.1.0 passed this metric
Supported Platforms Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
FC065: Ensure source_url is set in metadata: rubies/metadata.rb:1
FC066: Ensure chef_version is set in metadata: rubies/metadata.rb:1
FC122: Use the build_essential resource instead of the recipe: rubies/recipes/default.rb:6
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.0 passed this metric
Publish Metric
0.1.0 passed this metric
Supported Platforms Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 passed this metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 passed this metric