Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgraded ruby gems #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v2.4.0

* Add support for the rh-ruby24 SCL package.

## v2.3.0

* Chef 13 support.
Expand Down
18 changes: 18 additions & 0 deletions lib/poise_ruby/resources/ruby_gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@
require 'poise_ruby/ruby_command_mixin'


# Monkey patch test
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new("2.7")
require 'chef/provider/package/rubygems'
Chef::Provider::Package::Rubygems::AlternateGemEnvironment.prepend(Module.new {
def installed_versions(gem_dep)
# Load installed stubs.
stubs = gem_specification.send(:installed_stubs, gem_specification.dirs, "#{gem_dep.name}-*.gemspec")
stubs.select! {|stub| stub.name == gem_dep.name }
stubs.uniq!(&:full_name)
stubs.select! {|stub| gem_dep.requirement.satisfied_by?(stub.version) }
stubs.sort_by! {|stub| stub.version }
stubs.reverse!
stubs
end
})
end


module PoiseRuby
module Resources
# (see RubyGem::Resource)
Expand Down
3 changes: 2 additions & 1 deletion lib/poise_ruby/ruby_providers/scl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ module RubyProviders
class Scl < Base
include PoiseLanguages::Scl::Mixin
provides(:scl)
scl_package('2.3.0', 'rh-ruby23', 'rh-ruby23-ruby-devel', '>= 7.0')
scl_package('2.4.0', 'rh-ruby24', 'rh-ruby24-ruby-devel')
scl_package('2.3.1', 'rh-ruby23', 'rh-ruby23-ruby-devel')
scl_package('2.2.2', 'rh-ruby22', 'rh-ruby22-ruby-devel')
# On EL7, the system package is Ruby 2.0.0 and is newer than the SCL build.
scl_package('2.0.0', 'ruby200', 'ruby200-ruby-devel', '~> 6.0')
Expand Down
2 changes: 1 addition & 1 deletion lib/poise_ruby/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@


module PoiseRuby
VERSION = '2.3.1.pre'
VERSION = '2.4.1.pre'
end
2 changes: 1 addition & 1 deletion poise-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = %w{lib}

spec.add_dependency 'chef', '>= 12.1', '< 14'
spec.add_dependency 'chef', '>= 12.14', '< 15'
spec.add_dependency 'halite', '~> 1.0'
spec.add_dependency 'poise', '~> 2.0'
spec.add_dependency 'poise-languages', '~> 2.0'
Expand Down
6 changes: 5 additions & 1 deletion test/cookbook/recipes/bundle_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@

ruby_runtime 'bundle_install test' do
version ''
provider :system
if platform_family?('rhel') && node['platform_version'].start_with?('6')
provider :scl
else
provider :system
end
end

directory '/opt/bundle1'
Expand Down
10 changes: 7 additions & 3 deletions test/cookbook/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@
runtime_provider :chef
end

ruby_runtime_test 'system' do
version ''
runtime_provider :system
if platform_family?('rhel') && node['platform_version'].start_with?('6')
file '/no_system'
else
ruby_runtime_test 'system' do
version ''
runtime_provider :system
end
end

if platform_family?('rhel')
Expand Down
23 changes: 0 additions & 23 deletions test/gemfiles/chef-12.10.gemfile

This file was deleted.

23 changes: 0 additions & 23 deletions test/gemfiles/chef-12.11.gemfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2016-2017, Noah Kantrowitz
# Copyright 2018, Noah Kantrowitz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,4 @@

eval_gemfile File.expand_path('../../../Gemfile', __FILE__)

gem 'chef', '~> 12.13.37'
gem 'chefspec', '< 6'
gem 'fauxhai', '<= 3.9.0'
gem 'foodcritic', '< 8'
gem 'chef', '~> 12.20.3'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2016-2017, Noah Kantrowitz
# Copyright 2018, Noah Kantrowitz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,4 @@

eval_gemfile File.expand_path('../../../Gemfile', __FILE__)

gem 'chef', '~> 12.12.15'
gem 'chefspec', '< 6'
gem 'fauxhai', '<= 3.9.0'
gem 'foodcritic', '< 8'
gem 'chef', '~> 12.21.31'
23 changes: 0 additions & 23 deletions test/gemfiles/chef-12.3.gemfile

This file was deleted.

24 changes: 0 additions & 24 deletions test/gemfiles/chef-12.4.gemfile

This file was deleted.

23 changes: 0 additions & 23 deletions test/gemfiles/chef-12.5.gemfile

This file was deleted.

23 changes: 0 additions & 23 deletions test/gemfiles/chef-12.6.gemfile

This file was deleted.

23 changes: 0 additions & 23 deletions test/gemfiles/chef-12.7.gemfile

This file was deleted.

23 changes: 0 additions & 23 deletions test/gemfiles/chef-12.8.gemfile

This file was deleted.

23 changes: 0 additions & 23 deletions test/gemfiles/chef-12.9.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion test/gemfiles/chef-12.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

eval_gemfile File.expand_path('../../../Gemfile', __FILE__)

gem 'chef', '~> 12.19'
gem 'chef', '~> 12.21'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2015-2017, Noah Kantrowitz
# Copyright 2018, Noah Kantrowitz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,8 +16,4 @@

eval_gemfile File.expand_path('../../../Gemfile', __FILE__)

gem 'chef', '~> 12.1.2'
gem 'chefspec', '< 6'
gem 'fauxhai', '<= 3.9.0'
gem 'foodcritic', '< 8'
gem 'rack', '< 2'
gem 'chef', '~> 13.1.31'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2015-2017, Noah Kantrowitz
# Copyright 2018, Noah Kantrowitz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,8 +16,4 @@

eval_gemfile File.expand_path('../../../Gemfile', __FILE__)

gem 'chef', '~> 12.2.1'
gem 'chefspec', '< 6'
gem 'fauxhai', '<= 3.9.0'
gem 'foodcritic', '< 8'
gem 'rack', '< 2'
gem 'chef', '~> 13.2.20'
19 changes: 19 additions & 0 deletions test/gemfiles/chef-13.3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Copyright 2018, Noah Kantrowitz
#
# 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.
#

eval_gemfile File.expand_path('../../../Gemfile', __FILE__)

gem 'chef', '~> 13.3.42'
Loading