Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

gem_installation (3) Versions 2.1.0

Installs ruby gems and their dependencies

Policyfile
Berkshelf
Knife
cookbook 'gem_installation', '~> 2.1.0', :supermarket
cookbook 'gem_installation', '~> 2.1.0'
knife supermarket install gem_installation
knife supermarket download gem_installation
README
Dependencies
Changelog
Quality 17%

Description

Provides a set of LWRPs to install ruby gems and/or their package dependencies, before or during convergence.

If you are sick and tired of manually installing libxml2-dev and libxslt-dev, this cookbook is dedicated to you.

Does not install the rubygems binary.

You probably don't want to use this, it's not well done and semi abandoned, but I haven't found a better solution yet.

Update notes from previous versions

  • You must include the gem_installation::default recipe now. This is the sad result of some internal rejiggering

Warning

Currently, the prerequisites are hardcoded in libraries/gem_installation.rb

While a solution utilizing a dependency solver would be great, for now this is much better than nothing, and the LWRP interface is unlikely to change anyway.

Platforms

Ubuntu and Debian. Check .kitchen.yml for the exact versions tested.

Examples

# Set up everything this cookbook needs
include_recipe "gem_installation::default"

# Install fog before convergence so you can use it in your chef recipes
gem_installation "fog"

# Install fog during convergence
gem_installation "nokogiri" do
  action :install
end

# Install the nokogiri dependencies during convergence (e.g. because you deploy a Ruby application that has nokogiri in it's bundle).
# Note: does not install nokogiri itself, only the dependencies
gem_installation_dependencies "nokogiri" 

# Install fog dependencies before convergence (e.g. because you include a third party cookbook that will install fog as a chef_gem).
# Once again, the fog gem itself is not installed
gem_installation_dependencies "fog" do
  action :install_before_convergence
end

Recipes

gem_installation::default

Installs the deep_merge gem, which this cookbook depends on.

Also includes build-essential, so you're able to build native extensions.

Attributes

Currently, no attributes are used by this cookbook.

Resources / Providers

Note that the default actions for the two LWRPs are the opposite of each other.

While this is inconsistent, it reflects the expected use cases.

gem_installation

Deals with gem installation, including dependencies

Attributes

Attribute Description Type Default
gem_name Name of the gem to install String name
compile_time Same as the compile_time flag on chef_gem resource. Only works with :install_before_convergence action Boolean true

Actions

Name Description Default
install_before_convergence Installs the named gem as a chef_gem yes
install Installs the named gem using gem_package

gem_installation_dependencies

Install only gem dependencies, not the gems themselves.

Attributes

Attribute Description Type Default
gem_name Dependencies of this gem will be installed String name

Actions

Name Description Default
install Installs prerequisites during convergence yes
install_before_convergence Installs prerequisites before convergence

2.1.0 (2015-04-28)

Fixes

  • Version inconsistency

1.1.1 (2015-04-28)

Fixes

  • Fix "duplicate definition" warning, thanks to dblessing
  • RuboCop

1.1.0 (2015-04-28)

Fixes

  • No more compile_time warning spam in default recipe
  • Now adheres to the "new" build-essential naming conventions
  • Fix old supermarket location in Berksfile

New features

  • Add compile_time flag for gems installed before convergence

1.0.0 (2013-04-09)

New features

  • Now installs build-essential at compile time

Collaborator Number Metric
            

2.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
            

2.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
            

2.1.0 failed this metric

FC064: Ensure issues_url is set in metadata: gem_installation/metadata.rb:1
FC065: Ensure source_url is set in metadata: gem_installation/metadata.rb:1
FC066: Ensure chef_version is set in metadata: gem_installation/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: gem_installation/providers/default.rb:8
FC085: Resource using new_resource.updated_by_last_action to converge resource: gem_installation/providers/default.rb:22
FC085: Resource using new_resource.updated_by_last_action to converge resource: gem_installation/providers/dependencies.rb:8
FC085: Resource using new_resource.updated_by_last_action to converge resource: gem_installation/providers/dependencies.rb:30
FC121: Cookbook depends on cookbook made obsolete by Chef 14: gem_installation/metadata.rb:1
FC122: Use the build_essential resource instead of the recipe: gem_installation/recipes/default.rb:7
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

2.1.0 passed this metric

Testing File Metric
            

2.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
            

2.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 include a tag that matches this cookbook version number