Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Your changes/patches go here.

- [BUFIX: Fix compatibilities performance bug](https://github.com/fastruby/next_rails/pull/150)

# v1.4.5 / 2025-03-07 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.4...v1.4.5)

- [Move rails_version compatibility to its own class](https://github.com/fastruby/next_rails/pull/137)
Expand Down
2 changes: 1 addition & 1 deletion lib/next_rails/gem_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def unsatisfied_rails_dependencies(rails_version: nil)

def find_latest_compatible(rails_version: nil)
dependency = Gem::Dependency.new(@name)
fetcher = Gem::SpecFetcher.new
fetcher = Gem::SpecFetcher.fetcher # Use fetcher instead of ::new to reduce object allocation.

# list all available data for released gems
list, errors = fetcher.available_specs(:released)
Expand Down
2 changes: 1 addition & 1 deletion spec/next_rails/gem_info_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
# Set up a mock SpecFetcher to return an empty list
fetcher_double = double("spec_fetcher")
allow(fetcher_double).to receive(:available_specs).and_return([[],[]])
allow(Gem::SpecFetcher).to receive(:new).and_return(fetcher_double)
allow(Gem::SpecFetcher).to receive(:fetcher).and_return(fetcher_double)

gem_info = NextRails::GemInfo.new(gem)
gem_info.find_latest_compatible
Expand Down