cookbook 'rubygems', '~> 1.2.0'
rubygems (11) Versions 1.2.0 Follow16
Configures rubygems and bundler
cookbook 'rubygems', '~> 1.2.0', :supermarket
knife supermarket install rubygems
knife supermarket download rubygems
Rubygems Cookbook
This cookbook configures "system" and Omnibus Chef gem sources, as well as providing the rubygems_api
resource, which lets you manage ownership of gems on rubygems.org.
Requirements
Chef
- 12.7 or later
Usage
There are two ways to use this cookbook. The legacy way is to set the desired attributes and simply include_recipe 'rubygems'
. The modern and recommended way is to call the gemrc
and/or bundle_config
resources as shown in the Resources section below.
Attributes
# From attributes/default.rb
default['rubygems']['gem_disable_default'] = false
default['rubygems']['gem_sources'] = [ 'https://rubygems.org' ]
default['rubygems']['chef_gem_disable_default'] = false
default['rubygems']['chef_gem_sources'] = [ 'https://rubygems.org' ]
Resources
This cookbook provides two simple resources which allow you to set any key/value configuration for the gemrc or bundle config files. Additionaly this cookbook provides the rubygems_api
resource, which lets you manage ownership of gems on rubygems.org.
rubygems_api
rubygems_api do gem "chef" do owners << "jkeiser" end end
Or this:
rubygems_api do user "jkeiser" do owned_gems << "chef" end end
If you want to set owners
or owned_gems
to a specific set of users and have it remove all others, you can add purge true
to either user
or gem
resource.
To talk to a custom gem server, you can say rubygems_api "https://otherserver.com" do ... end
. You can also modify the API key you are by specifying the api_key
property under rubygems_api
.
gemrc
Configures the gemrc.
Properties
-
path
- Accepts symbols:global
,:local
, or a string literal path to the.gemrc
file. Default: Name of Resource Instance -
user
- Owner of gemrc file. -
group
- Group associated to gemrc file. -
values
- Hash containing all key/values to configure.
Action
-
:create
- Default Action
Usage
Global configuration usage:
gemrc :global do values( sources: %w{ http://localhost:9292 https://rubygems.org } ) end
Literal path usage:
gemrc '/path/to/.gemrc' do values( sources: %w{ http://localhost:9292 https://rubygems.org } ) end
bundle_config
Configures bundler.
Properties
-
path
- A literal path to the.gemrc
file. Default: Name of Resource Instance -
user
- Owner of gemrc file. -
group
- Group associated to gemrc file. -
values
- Hash containing all key/values to configure.
Action
-
:create
- Default Action
Usage
bundle_config '/path/to/.bundle/config' do values( { 'BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG/' => 'http://localhost:9292' } ) end
License and Authors
- Author:: Sean OMeara (sean@sean.io)
- Author:: John Keiser (jkeiser@chef.io)
- Author:: Ryan Hass (rhass@chef.io)
Copyright (c) 2009-2016, Chef Software Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
rubygems Cookbook CHANGELOG
This file is used to list changes made in each version of the rubygems cookbook.
1.2.0 (2020-06-02)
- Update the platforms we test on - @tas50
- Add code owners file - @tas50
- Rename the kitchen config - @tas50
- Cookstyle fixes - @tas50
- Resolve cookstyle 5.8 warnings - @tas50
- Require Chef 12.15+ - @tas50
- Lint/SuppressedException - @Xorima
- Use the org wide GitHub templates - @tas50
- Update ChefSpec platforms - @tas50
- Chef Infra Client 16 compatibility fixes - @Xorima
- resolved cookstyle error: resources/bundle_config.rb:25:1 warning:
ChefDeprecations/ResourceUsesOnlyResourceName
- resolved cookstyle error: resources/gemrc.rb:26:1 warning:
ChefDeprecations/ResourceUsesOnlyResourceName
- resolved cookstyle error: resources/bundle_config.rb:25:1 warning:
1.1.1 (2018-03-07)
- Resolve Chef 14 incompatibilies
1.1.0 (2017-05-30)
- Remove class_eval usage and require Chef 12.7+
1.0.4 (2017-04-17)
- Use kitchen-dokken for integration testing in Travis and switch to delivery local for testing instead of the Rakefile
- Prevent failures with metadata.rb on older chef clients
- Ensure compatibility with Chef 12.5/12.6
- Remove invalid supports metadata
1.0.3 (2017-02-13)
- Fix gemrc error if sources is an array.
- Update ignore files
- Add maintainers files
- Add the full Apache license file
Collaborator Number Metric
1.2.0 passed this metric
Contributing File Metric
1.2.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
Cookstyle Metric
1.2.0 failed this metric
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 24
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 32
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 40
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 48
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/api.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/bundle_config.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/gem.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/gemrc.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/user.rb: 1
Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations
No Binaries Metric
1.2.0 passed this metric
Testing File Metric
1.2.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
1.2.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
1.2.0 passed this metric
1.2.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
Cookstyle Metric
1.2.0 failed this metric
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 24
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 32
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 40
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 48
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/api.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/bundle_config.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/gem.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/gemrc.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/user.rb: 1
Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations
No Binaries Metric
1.2.0 passed this metric
Testing File Metric
1.2.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
1.2.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
1.2.0 failed this metric
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 32
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 40
Chef/Correctness/ResourceSetsNameProperty: Resource sets the name property in the resource instead of using a name_property. (https://docs.chef.io/workstation/cookstyle/chef_correctness_resourcesetsnameproperty): rubygems/recipes/default.rb: 48
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/api.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/bundle_config.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/gem.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/gemrc.rb: 1
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): rubygems/resources/user.rb: 1
Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations
1.2.0 passed this metric
Testing File Metric
1.2.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
1.2.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
1.2.0 failed this metric
1.2.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