Last active
February 28, 2024 16:26
-
-
Save scpike/680ceb29a9bdff4eafb123986782c5c1 to your computer and use it in GitHub Desktop.
Check for silent gem incompatibilities in Rails 7.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Run like `ruby incompat_71.rb ~/path/to/Gemfile.lock` | |
# From the team at infield.ai | |
# | |
PACKAGES = [['activerecord-import', '1.5.0'], | |
['anycable-rails', '1.4.1'], | |
['blazer', '3.0.1'], | |
['bullet', '7.1.2'], | |
['data_migrate', '9.2.0'], | |
['database_cleaner-active_record', '2.1.0'], | |
['devise', '4.9.3'], | |
['formtastic', '5.0.0'], | |
['grape', '2.0.0'], | |
['has_scope', '0.8.2'], | |
['honeybadger', '5.1.0'], | |
['lockbox', '1.3.1'], | |
['paper_trail', '15.1.0'], | |
['public_activity', '3.0.0'], | |
['ransack', '4.1.0'], | |
['responders', '3.1.1'], | |
['rollbar', '3.4.1'], | |
['rspec-rails', '6.1.0'], | |
['rubocop-rails', '2.22.2'], | |
['shoulda-matchers', '6.0.0'], | |
['sidekiq', '7.1.5'], | |
['simple_form', '5.3.0'], | |
['slim', '5.2.0'], | |
['web-console', '4.2.1']].map { |(name, ver)| [name, Gem::Version.new(ver)] }.to_h | |
require 'bundler' | |
Bundler::LockfileParser.new(ARGF.read).specs.each do |spec| | |
name = spec.name | |
next unless required_version = PACKAGES[name] | |
if required_version > spec.version | |
puts "#{name}: Using #{spec.version}. Upgrade to #{required_version}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment