Skip to content

Commit

Permalink
Merge pull request ManageIQ#21051 from agrare/lock_down_bundler_pre_2…
Browse files Browse the repository at this point in the history
…_2_10

Lock down bundler to pre-2.2.10 and fix ManageIQ::Environment.bundler_version
  • Loading branch information
Fryguy authored Feb 15, 2021
2 parents 323843e + 71e5a0b commit 7f28a62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gem "acts_as_tree", "~>2.7" # acts_as_tree needs to be requi
gem "ancestry", "~>3.0.7", :require => false
gem "aws-sdk-s3", "~>1.0", :require => false # For FileDepotS3
gem "bcrypt", "~> 3.1.10", :require => false
gem "bundler", "~> 2.1", ">=2.1.4", :require => false
gem "bundler", "~> 2.1", ">=2.1.4", "<2.2.10", :require => false
gem "byebug", :require => false
gem "color", "~>1.8"
gem "config", "~>2.2", ">=2.2.3", :require => false
Expand Down
8 changes: 7 additions & 1 deletion lib/manageiq/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ def self.update_ui

def self.bundler_version
gemfile = APP_ROOT.join("Gemfile")
File.read(gemfile).match(/gem\s+['"]bundler['"],\s+['"](.+?)['"]/)[1]

require "bundler"
gemfile_dependencies = Bundler::Definition.build(gemfile, nil, {}).dependencies
bundler_dependency = gemfile_dependencies.detect { |dep| dep.name == "bundler" }

version_requirements = bundler_dependency.requirement.requirements
version_requirements.map { |req| req.join(" ") }.join(", ")
end

def self.run_rake_task(task, root: APP_ROOT)
Expand Down

0 comments on commit 7f28a62

Please sign in to comment.