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

Fix all_specs deprecation of bundler #1159

Merged
merged 4 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions .changesets/fix-deprecation-of-bundler-rubygems-all_specs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "fix"
---

Fix deprecation of Bundler.rubygems.all_specs
6 changes: 5 additions & 1 deletion lib/appsignal/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ def self.report(key)
def self.report_supported_gems
return unless defined?(Bundler) # Do nothing if Bundler is not present

bundle_gem_specs = ::Bundler.rubygems.all_specs
bundle_gem_specs = if ::Bundler.rubygems.respond_to?(:installed_specs)
::Bundler.rubygems.installed_specs
else
::Bundler.rubygems.all_specs
end
SUPPORTED_GEMS.each do |gem_name|
gem_spec = bundle_gem_specs.find { |spec| spec.name == gem_name }
next unless gem_spec
Expand Down
Loading