forked from sous-chefs/rvm
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New experimental recipe gem_package which patches gem_package resource.
- Loading branch information
Showing
5 changed files
with
113 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Cookbook Name:: rvm | ||
# Attributes:: gem_package | ||
# | ||
# Author:: Fletcher Nichol <fnichol@nichol.ca> | ||
# | ||
# Copyright 2010, 2011, Fletcher Nichol | ||
# | ||
# 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. | ||
# | ||
|
||
# rvm ruby that will be used for gem_package resources | ||
default[:rvm][:gem_package][:rvm_string] = node[:rvm][:default_ruby] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Cookbook Name:: rvm | ||
# Library: gem_package resource monkey patch | ||
# | ||
# Author:: Fletcher Nichol <fnichol@nichol.ca> | ||
# | ||
# Copyright 2011, Fletcher Nichol | ||
# | ||
# 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. | ||
# | ||
|
||
## | ||
# Patch Chef::Reousrce::GemPackage resource to use the RVMRubygems provider. | ||
# This has potentially dangerous side effects and should be considered | ||
# experimental. You have been warned. | ||
def patch_gem_package | ||
::Chef::Resource::GemPackage.class_eval do | ||
def initialize(name, run_context=nil) | ||
super | ||
@resource_name = :gem_package | ||
@provider = Chef::Provider::Package::RVMRubygems | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Cookbook Name:: rvm | ||
# Recipe:: gem_package | ||
# | ||
# Copyright 2011, Fletcher Nichol | ||
# | ||
# 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. | ||
# | ||
|
||
patch_gem_package | ||
::Chef::Log.info "gem_package resource has been patched to use provider " << | ||
"Chef::Provider::Package::RVMRubygems and will install gems to " << | ||
"the #{node[:rvm][:gem_package][:rvm_string]} RVM Ruby." |