Skip to content

Commit

Permalink
Revert for Ruby 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahramadan committed Aug 20, 2024
1 parent d881fc4 commit 1e9c039
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/new_relic/environment_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ def self.registered_reporters=(logic)
####################################
report_on('Gems') do
begin
specs_method = Bundler::VERSION >= '2' ? :installed_specs : :all_specs
Bundler.rubygems.send(specs_method).map { |gem| "#{gem.name} (#{gem.version})" }
if Bundler::VERSION >= '2'
Bundler.rubygems.installed_specs.map { |gem| "#{gem.name}(#{gem.version})" }
else
Bundler.rubygems.all_specs.map { |gem| "#{gem.name}(#{gem.version})" }
end
rescue
# There are certain rubygem, bundler, rails combinations (e.g. gem
# 1.6.2, rails 2.3, bundler 1.2.3) where the code above throws an error
Expand Down

0 comments on commit 1e9c039

Please sign in to comment.