From 7a5b0f4677fb70ddab78686a8ba70f3194a9f4a8 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 20 Jan 2020 17:10:02 -0500
Subject: [PATCH 001/171] Bundle with support for SimpleCov

Add support for SimpleCov in `spec_helper.rb` so that it is loaded only when the COVERAGE environment variable is present
---
 Gemfile.lock        | 42 ++++++++++++++++++++++++++----------------
 spec/spec_helper.rb | 18 ++++++++++++++++++
 2 files changed, 44 insertions(+), 16 deletions(-)

diff --git a/Gemfile.lock b/Gemfile.lock
index cddf5dc..23ee3f2 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,44 +1,47 @@
 PATH
   remote: .
   specs:
-    next_rails (1.0.0)
+    next_rails (1.0.2)
       actionview
       colorize (>= 0.8.1)
 
 GEM
   remote: https://rubygems.org/
   specs:
-    actionview (5.2.3)
-      activesupport (= 5.2.3)
+    actionview (6.0.2.1)
+      activesupport (= 6.0.2.1)
       builder (~> 3.1)
       erubi (~> 1.4)
       rails-dom-testing (~> 2.0)
-      rails-html-sanitizer (~> 1.0, >= 1.0.3)
-    activesupport (5.2.3)
+      rails-html-sanitizer (~> 1.1, >= 1.2.0)
+    activesupport (6.0.2.1)
       concurrent-ruby (~> 1.0, >= 1.0.2)
       i18n (>= 0.7, < 2)
       minitest (~> 5.1)
       tzinfo (~> 1.1)
-    builder (3.2.3)
+      zeitwerk (~> 2.2)
+    builder (3.2.4)
     colorize (0.8.1)
     concurrent-ruby (1.1.5)
-    crass (1.0.4)
+    crass (1.0.6)
     diff-lcs (1.3)
-    erubi (1.8.0)
-    i18n (1.6.0)
+    docile (1.3.2)
+    erubi (1.9.0)
+    i18n (1.8.2)
       concurrent-ruby (~> 1.0)
-    loofah (2.2.3)
+    json (2.3.0)
+    loofah (2.4.0)
       crass (~> 1.0.2)
       nokogiri (>= 1.5.9)
     mini_portile2 (2.4.0)
-    minitest (5.11.3)
-    nokogiri (1.10.3)
+    minitest (5.14.0)
+    nokogiri (1.10.7)
       mini_portile2 (~> 2.4.0)
     rails-dom-testing (2.0.3)
       activesupport (>= 4.2.0)
       nokogiri (>= 1.6)
-    rails-html-sanitizer (1.0.4)
-      loofah (~> 2.2, >= 2.2.2)
+    rails-html-sanitizer (1.3.0)
+      loofah (~> 2.3)
     rake (10.5.0)
     rspec (3.8.0)
       rspec-core (~> 3.8.0)
@@ -53,10 +56,16 @@ GEM
       diff-lcs (>= 1.2.0, < 2.0)
       rspec-support (~> 3.8.0)
     rspec-support (3.8.2)
+    simplecov (0.17.1)
+      docile (~> 1.1)
+      json (>= 1.8, < 3)
+      simplecov-html (~> 0.10.0)
+    simplecov-html (0.10.2)
     thread_safe (0.3.6)
     timecop (0.9.1)
-    tzinfo (1.2.5)
+    tzinfo (1.2.6)
       thread_safe (~> 0.1)
+    zeitwerk (2.2.2)
 
 PLATFORMS
   ruby
@@ -66,7 +75,8 @@ DEPENDENCIES
   next_rails!
   rake (~> 10.0)
   rspec (~> 3.0)
+  simplecov (~> 0.17.1)
   timecop (~> 0.9.1)
 
 BUNDLED WITH
-   1.17.2
+   1.17.3
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 61b037a..d4ffcfb 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,5 +1,23 @@
 require "bundler/setup"
 require "next_rails"
+if ENV['COVERAGE'] == 'true'
+  require 'simplecov'
+  SimpleCov.start do
+    # Disambiguates individual test runs
+    command_name "Job #{ENV["TEST_ENV_NUMBER"]}" if ENV["TEST_ENV_NUMBER"]
+
+    if ENV['CI']
+      formatter SimpleCov::Formatter::SimpleFormatter
+    else
+      formatter SimpleCov::Formatter::MultiFormatter.new([
+        SimpleCov::Formatter::SimpleFormatter,
+        SimpleCov::Formatter::HTMLFormatter
+      ])
+    end
+
+    track_files "lib/**/*.rb"
+  end
+end
 
 RSpec.configure do |config|
   # Enable flags like --only-failures and --next-failure

From 2698297b749971ee677b2bb57b33f8fb0ec7e986 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 20 Jan 2020 17:11:05 -0500
Subject: [PATCH 002/171] Update owners of the @fastruby organization

---
 next_rails.gemspec | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index fd58fe3..8db2141 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -6,12 +6,12 @@ require "next_rails/version"
 Gem::Specification.new do |spec|
   spec.name          = "next_rails"
   spec.version       = NextRails::VERSION
-  spec.authors       = ["Jordan Raine", "Ernesto Tagwerker"]
-  spec.email         = ["jnraine@gmail.com", "ernesto@ombulabs.com"]
+  spec.authors       = ["Ernesto Tagwerker", "Luis Sagastume"]
+  spec.email         = ["ernesto@ombulabs.com", "luis@ombulabs.com"]
 
-  spec.summary       = %q{Companion code to Ten Years of Rails Upgrades}
+  spec.summary       = %q{A toolkit to upgrade your next Rails application}
   spec.description   = %q{A set of handy tools to upgrade your Rails application and keep it up to date}
-  spec.homepage      = "https://github.com/fastruby/next_rails"
+  spec.homepage     = "https://github.com/fastruby/next_rails"
   spec.license       = "MIT"
 
   spec.required_ruby_version = ">= 2.3.0"
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "bundler", "~> 1.16"
   spec.add_development_dependency "rake", "~> 10.0"
   spec.add_development_dependency "rspec", "~> 3.0"
+  spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
   spec.add_runtime_dependency "actionview"
 end

From 2a34948e27a872721fc30dd3d59087052ed6d3e7 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 20 Jan 2020 17:11:49 -0500
Subject: [PATCH 003/171] Bump version of `next_rails`

---
 lib/next_rails/version.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index bc2d8ea..24d7815 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,3 +1,3 @@
 module NextRails
-  VERSION = "1.0.1"
+  VERSION = "1.0.2"
 end

From 6f03a1f150760ff9faf46419f60338bd8e706688 Mon Sep 17 00:00:00 2001
From: Manuel Barros Reyes <manuca@gmail.com>
Date: Mon, 14 Sep 2020 14:53:01 -0300
Subject: [PATCH 004/171] make actionview an optional dependency

---
 exe/bundle_report  | 1 -
 next_rails.gemspec | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/exe/bundle_report b/exe/bundle_report
index aab61cc..895d573 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -56,5 +56,4 @@ end
 # Needs to happen first
 require "bundler/setup"
 
-require "action_view"
 require "active_support/core_ext/object/acts_like"
diff --git a/next_rails.gemspec b/next_rails.gemspec
index 8db2141..abfe776 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -24,10 +24,11 @@ Gem::Specification.new do |spec|
   spec.require_paths = ["lib"]
 
   spec.add_dependency "colorize", ">= 0.8.1"
+  spec.add_dependency "activesupport", "< 6.0"
   spec.add_development_dependency "bundler", "~> 1.16"
   spec.add_development_dependency "rake", "~> 10.0"
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
-  spec.add_runtime_dependency "actionview"
+  spec.add_development_dependency "actionview", "< 6.0"
 end

From d243d1555ea0f60d76b63a5443a4f823365a9c0a Mon Sep 17 00:00:00 2001
From: Manuel Barros Reyes <manuca@gmail.com>
Date: Mon, 14 Sep 2020 14:59:54 -0300
Subject: [PATCH 005/171] untrack Gemfile.lock

---
 .gitignore   |  1 +
 Gemfile.lock | 82 ----------------------------------------------------
 2 files changed, 1 insertion(+), 82 deletions(-)
 delete mode 100644 Gemfile.lock

diff --git a/.gitignore b/.gitignore
index 01a4218..e2ae0d3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@
 .rspec_status
 
 .ruby-version
+Gemfile.lock
diff --git a/Gemfile.lock b/Gemfile.lock
deleted file mode 100644
index 23ee3f2..0000000
--- a/Gemfile.lock
+++ /dev/null
@@ -1,82 +0,0 @@
-PATH
-  remote: .
-  specs:
-    next_rails (1.0.2)
-      actionview
-      colorize (>= 0.8.1)
-
-GEM
-  remote: https://rubygems.org/
-  specs:
-    actionview (6.0.2.1)
-      activesupport (= 6.0.2.1)
-      builder (~> 3.1)
-      erubi (~> 1.4)
-      rails-dom-testing (~> 2.0)
-      rails-html-sanitizer (~> 1.1, >= 1.2.0)
-    activesupport (6.0.2.1)
-      concurrent-ruby (~> 1.0, >= 1.0.2)
-      i18n (>= 0.7, < 2)
-      minitest (~> 5.1)
-      tzinfo (~> 1.1)
-      zeitwerk (~> 2.2)
-    builder (3.2.4)
-    colorize (0.8.1)
-    concurrent-ruby (1.1.5)
-    crass (1.0.6)
-    diff-lcs (1.3)
-    docile (1.3.2)
-    erubi (1.9.0)
-    i18n (1.8.2)
-      concurrent-ruby (~> 1.0)
-    json (2.3.0)
-    loofah (2.4.0)
-      crass (~> 1.0.2)
-      nokogiri (>= 1.5.9)
-    mini_portile2 (2.4.0)
-    minitest (5.14.0)
-    nokogiri (1.10.7)
-      mini_portile2 (~> 2.4.0)
-    rails-dom-testing (2.0.3)
-      activesupport (>= 4.2.0)
-      nokogiri (>= 1.6)
-    rails-html-sanitizer (1.3.0)
-      loofah (~> 2.3)
-    rake (10.5.0)
-    rspec (3.8.0)
-      rspec-core (~> 3.8.0)
-      rspec-expectations (~> 3.8.0)
-      rspec-mocks (~> 3.8.0)
-    rspec-core (3.8.2)
-      rspec-support (~> 3.8.0)
-    rspec-expectations (3.8.4)
-      diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.8.0)
-    rspec-mocks (3.8.1)
-      diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.8.0)
-    rspec-support (3.8.2)
-    simplecov (0.17.1)
-      docile (~> 1.1)
-      json (>= 1.8, < 3)
-      simplecov-html (~> 0.10.0)
-    simplecov-html (0.10.2)
-    thread_safe (0.3.6)
-    timecop (0.9.1)
-    tzinfo (1.2.6)
-      thread_safe (~> 0.1)
-    zeitwerk (2.2.2)
-
-PLATFORMS
-  ruby
-
-DEPENDENCIES
-  bundler (~> 1.16)
-  next_rails!
-  rake (~> 10.0)
-  rspec (~> 3.0)
-  simplecov (~> 0.17.1)
-  timecop (~> 0.9.1)
-
-BUNDLED WITH
-   1.17.3

From b3b05bcaca6be201b9dddbcd3adfdce46d3fa5eb Mon Sep 17 00:00:00 2001
From: Manuel Barros Reyes <manuca@gmail.com>
Date: Mon, 14 Sep 2020 16:06:54 -0300
Subject: [PATCH 006/171] remove activesupport dependency

---
 exe/bundle_report  | 2 --
 next_rails.gemspec | 1 -
 2 files changed, 3 deletions(-)

diff --git a/exe/bundle_report b/exe/bundle_report
index 895d573..6867fdd 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -55,5 +55,3 @@ end
 
 # Needs to happen first
 require "bundler/setup"
-
-require "active_support/core_ext/object/acts_like"
diff --git a/next_rails.gemspec b/next_rails.gemspec
index abfe776..2920613 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
   spec.require_paths = ["lib"]
 
   spec.add_dependency "colorize", ">= 0.8.1"
-  spec.add_dependency "activesupport", "< 6.0"
   spec.add_development_dependency "bundler", "~> 1.16"
   spec.add_development_dependency "rake", "~> 10.0"
   spec.add_development_dependency "rspec", "~> 3.0"

From 78a82555ae2d1cec6aa14bed8f4764f2b6de996c Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 18 Jan 2021 22:06:34 -0500
Subject: [PATCH 007/171] Updated documentation to reflect reality

---
 README.md | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 4c535c0..02f0eb8 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,24 @@
-# Ten Years of Rails Upgrades
+# Next Rails
 
-This is a companion to the "Ten Years of Rails Upgrades" conference talk. You'll find various utilities that we use at Clio to help us prepare for and complete Rails upgrades.
+This is a toolkit to upgrade your next Rails application. It will help you
+set up dual booting, track deprecation warnings, and get a report on outdated
+dependencies for any Rails application.
 
-These scripts are still early days and may not work in every environment or app.
+This project is a fork of [`ten_years_rails`](https://github.com/clio/ten_years_rails)
 
-I wouldn't recommend adding this to your Gemfile long-term. Rather, try out the scripts and use them as a point of reference. Feel free to tweak them to better fit your environment.
+## History
+
+This gem started as a companion to the "[Ten Years of Rails Upgrades](https://www.youtube.com/watch?v=6aCfc0DkSFo)"
+conference talk by Jordan Raine.
+
+> You'll find various utilities that we use at Clio to help us prepare for and
+> complete Rails upgrades.
+
+> These scripts are still early days and may not work in every environment or app.
+
+> I wouldn't recommend adding this to your Gemfile long-term. Rather, try out
+> the scripts and use them as a point of reference. Feel free to tweak them to
+> better fit your environment.
 
 ## Usage
 

From 63905b7569533dc1cde6f9e893fb005637d093c0 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 5 Apr 2021 20:18:39 -0400
Subject: [PATCH 008/171] Add more rubies to the testing matrix

---
 .travis.yml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index fee4919..e3e3ca2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,4 +3,8 @@ language: ruby
 rvm:
   - 2.2.10
   - 2.3.3
+  - 2.4.10
+  - 2.5.9
+  - 2.6.7
+  - 2.7.2
 before_install: gem install bundler -v 1.16.1

From 66956c5393edaf37e27ec68b9fe0b85d8f6795fe Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 5 Apr 2021 20:18:49 -0400
Subject: [PATCH 009/171] Relax bundler dependency

---
 next_rails.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 2920613..043686b 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
   spec.require_paths = ["lib"]
 
   spec.add_dependency "colorize", ">= 0.8.1"
-  spec.add_development_dependency "bundler", "~> 1.16"
+  spec.add_development_dependency "bundler", ">= 1.16", "< 3.0"
   spec.add_development_dependency "rake", "~> 10.0"
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"

From f3d8b30baf5c097ebacca2e23ce4ac6042438f86 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 5 Apr 2021 20:31:57 -0400
Subject: [PATCH 010/171] Bump version to v1.0.3

Also, add a changelog
---
 CHANGELOG.md              | 14 ++++++++++++++
 lib/next_rails/version.rb |  2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 CHANGELOG.md

diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..108351c
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,14 @@
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.3...main)
+
+# v1.0.3 / 2021-04-05 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.2...v1.0.3)
+
+* [BUGFIX] Update README.md to better document this `ten_years_rails` fork (by [@etagwerker][])
+* [BUGFIX] Make ActionView an optional dependency (by [@manuca][])
+
+# v1.0.2 / 2020-01-20
+
+# v1.0.1 / 2019-07-26
+
+# v1.0.0 / 2019-07-24
+
+* Official Release
\ No newline at end of file
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index 24d7815..e2bb6a3 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,3 +1,3 @@
 module NextRails
-  VERSION = "1.0.2"
+  VERSION = "1.0.3"
 end

From 286de55e7c913d69f18bcfaa4aca5b83f326cc1d Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 5 Apr 2021 20:37:35 -0400
Subject: [PATCH 011/171] Correct ruby versions

---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index e3e3ca2..3615ae0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,7 +4,7 @@ rvm:
   - 2.2.10
   - 2.3.3
   - 2.4.10
-  - 2.5.9
-  - 2.6.7
+  - 2.5.8
+  - 2.6.6
   - 2.7.2
 before_install: gem install bundler -v 1.16.1

From b4840e89085c8551def85360aed6f7187471c4cb Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 5 Apr 2021 20:57:43 -0400
Subject: [PATCH 012/171] Drop support for Ruby 2.2.x

---
 .travis.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 3615ae0..b129453 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,6 @@
 sudo: false
 language: ruby
 rvm:
-  - 2.2.10
   - 2.3.3
   - 2.4.10
   - 2.5.8

From c0cc7fdd4079a9c8cb10fa70f152eecc8c87f1f6 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 9 Apr 2021 10:27:25 -0400
Subject: [PATCH 013/171] Remove any traces of actionview

---
 lib/next_rails/gem_info.rb            | 10 ----------
 spec/ten_years_rails/gem_info_spec.rb | 18 +++---------------
 2 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index 6afc825..ea5cf7c 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -1,15 +1,5 @@
-begin
-  require "action_view"
-rescue LoadError
-  puts "ActionView not available"
-end
-
 module NextRails
   class GemInfo
-    if defined?(ActionView)
-      include ActionView::Helpers::DateHelper
-    end
-
     class NullGemInfo < GemInfo
       def initialize; end
 
diff --git a/spec/ten_years_rails/gem_info_spec.rb b/spec/ten_years_rails/gem_info_spec.rb
index 80dd989..f0cbfa8 100644
--- a/spec/ten_years_rails/gem_info_spec.rb
+++ b/spec/ten_years_rails/gem_info_spec.rb
@@ -19,22 +19,10 @@
       end
     end
 
-    context "when ActionView is available" do
-      it "returns a time ago" do
-        expect(subject.age).to eq("about 12 hours ago")
-      end
-    end
-
-    context "when ActionView is not available" do
-      let(:result) { now.strftime("%b %e, %Y") }
+    let(:result) { now.strftime("%b %e, %Y") }
 
-      before do
-        subject.instance_eval('undef :time_ago_in_words')
-      end
-
-      it "returns a date" do
-        expect(subject.age).to eq(result)
-      end
+    it "returns a date" do
+      expect(subject.age).to eq(result)
     end
   end
 end

From a156ca6a99cc3a9e36cae5f7f46854b31ba0807b Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 9 Apr 2021 11:53:59 -0400
Subject: [PATCH 014/171] Stop using time_ago_in_words

---
 lib/next_rails/gem_info.rb | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index ea5cf7c..0a2433d 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -42,11 +42,7 @@ def initialize(gem_specification)
     end
 
     def age
-      if respond_to?(:time_ago_in_words)
-        "#{time_ago_in_words(created_at)} ago"
-      else
-        created_at.strftime("%b %e, %Y")
-      end
+      created_at.strftime("%b %e, %Y")
     end
 
     def sourced_from_git?

From f6161f096179141359e01abeb6bc9836dfc5ab0b Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 9 Apr 2021 14:14:27 -0400
Subject: [PATCH 015/171] Bump version and document changes in CHANGELOG

---
 CHANGELOG.md              | 6 +++++-
 lib/next_rails/version.rb | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 108351c..6452ef2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,8 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.3...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
+
+# v1.0.4 / 2021-04-09 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.3...v1.0.4)
+
+* [BUGFIX] Fixes issue with `bundle_report` and `actionview` (by [@etagwerker][])
 
 # v1.0.3 / 2021-04-05 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.2...v1.0.3)
 
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index e2bb6a3..126ad6f 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,3 +1,3 @@
 module NextRails
-  VERSION = "1.0.3"
+  VERSION = "1.0.4"
 end

From d7a0962eac15344ff9b69c0eef13c21b976be247 Mon Sep 17 00:00:00 2001
From: Francois Buys <buys.fran@gmail.com>
Date: Fri, 22 Oct 2021 19:33:50 +0200
Subject: [PATCH 016/171] Initialize the Gemfile.next.lock

We initialize the Gemfile.next.lock by copying the content of the
existing Gemfile.lock. This prevents major version jumps when we use
this gem without an initial Gemfile.next.lock.

This commit closes: https://github.com/fastruby/next_rails/issues/24
---
 exe/next.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/exe/next.sh b/exe/next.sh
index e11b924..2681395 100755
--- a/exe/next.sh
+++ b/exe/next.sh
@@ -10,6 +10,13 @@ STRING
   mv Gemfile.tmp Gemfile
 
   ln -s Gemfile Gemfile.next
+
+  # Initialize the Gemfile.next.lock
+  # Prevents major version jumps when we start without a Gemfile.next.lock
+  if [ -f "Gemfile.lock" ] && [ ! -f "Gemfile.next.lock" ]; then
+    cp Gemfile.lock Gemfile.next.lock
+  fi
+
   echo <<-MESSAGE
 Created Gemfile.next (a symlink to your Gemfile). Your Gemfile has been modified to support dual-booting!
 

From 2afde42fa776c5a85782607340d4112990e6efd3 Mon Sep 17 00:00:00 2001
From: Francois Buys <buys.fran@gmail.com>
Date: Fri, 22 Oct 2021 19:44:59 +0200
Subject: [PATCH 017/171] Update README to reflect --init changes

So users are aware that the --init will also create a Gemfile.next.lock.
---
 README.md | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 02f0eb8..52554d7 100644
--- a/README.md
+++ b/README.md
@@ -83,7 +83,7 @@ Right now, the path to the shitlist is hardcoded so make sure you store yours at
 This command helps you dual-boot your application.
 
 ```bash
-next --init         # Create Gemfile.next
+next --init         # Create Gemfile.next and Gemfile.next.lock
 vim Gemfile         # Tweak your dependencies conditionally using `next?`
 next bundle install # Install new gems
 next rails s        # Start server using Gemfile.next
@@ -105,6 +105,17 @@ Or install it yourself as:
 
     $ gem install next_rails
 
+## Setup
+
+Execute:
+
+    $ next --init
+
+Init will create a Gemfile.next and an initialized Gemfile.next.lock.
+The Gemfile.next.lock is initialized with the contents of your existing 
+Gemfile.lock lock file. We initialize the Gemfile.next.lock to prevent
+major version jumps when running the next version of Rails.
+
 ## License
 
 The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

From c4e4944b0492ab650aeb61d8132c791fee57e468 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 22 Oct 2021 21:23:24 -0400
Subject: [PATCH 018/171] Start testing library with Ruby 3.0.2

---
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.travis.yml b/.travis.yml
index b129453..4782f18 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,4 +6,5 @@ rvm:
   - 2.5.8
   - 2.6.6
   - 2.7.2
+  - 3.0.2
 before_install: gem install bundler -v 1.16.1

From cb954fd5d03c66f4a94977f44e4d9c615a0b684a Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 22 Oct 2021 21:23:37 -0400
Subject: [PATCH 019/171] Drop actionview dependency because it is not really
 used

---
 next_rails.gemspec | 1 -
 1 file changed, 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 043686b..72b2f7d 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -29,5 +29,4 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
-  spec.add_development_dependency "actionview", "< 6.0"
 end

From 12d68979efab8d86c611e496c7a9f70ddd6b21f3 Mon Sep 17 00:00:00 2001
From: Lewis <lewis@ombulabs.com>
Date: Wed, 23 Feb 2022 15:49:00 -0500
Subject: [PATCH 020/171] update changelog

---
 CHANGELOG.md | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6452ef2..26ad5b9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,13 +1,16 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
+* [FEATURE]: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock (by [@fbuys](https://github.com/fbuys))
+* Drop `actionview` dependency because it is not really used. (by [@etagwerker](https://github.com/etagwerker))
+
 # v1.0.4 / 2021-04-09 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.3...v1.0.4)
 
-* [BUGFIX] Fixes issue with `bundle_report` and `actionview` (by [@etagwerker][])
+* [BUGFIX] Fixes issue with `bundle_report` and `actionview` (by [@etagwerker](https://github.com/etagwerker)))
 
 # v1.0.3 / 2021-04-05 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.2...v1.0.3)
 
-* [BUGFIX] Update README.md to better document this `ten_years_rails` fork (by [@etagwerker][])
-* [BUGFIX] Make ActionView an optional dependency (by [@manuca][])
+* [BUGFIX] Update README.md to better document this `ten_years_rails` fork (by [@etagwerker](https://github.com/etagwerker)))
+* [BUGFIX] Make ActionView an optional dependency (by [@manuca](https://github.com/manuca))
 
 # v1.0.2 / 2020-01-20
 

From 00075cf74276e54f90742d939328d43faf3db38d Mon Sep 17 00:00:00 2001
From: Lewis <lewis@ombulabs.com>
Date: Thu, 24 Feb 2022 18:27:36 -0500
Subject: [PATCH 021/171] use dontenv_validator PR link style

---
 CHANGELOG.md | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 26ad5b9..9a413d6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,17 +1,16 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
-* [FEATURE]: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock (by [@fbuys](https://github.com/fbuys))
-* Drop `actionview` dependency because it is not really used. (by [@etagwerker](https://github.com/etagwerker))
+* [FEATURE: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock](https://github.com/fastruby/next_rails/pull/25)
+* [FEATURE: Drop `actionview` dependency because it is not really used](https://github.com/fastruby/next_rails/pull/26)
 
 # v1.0.4 / 2021-04-09 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.3...v1.0.4)
 
-* [BUGFIX] Fixes issue with `bundle_report` and `actionview` (by [@etagwerker](https://github.com/etagwerker)))
+* [BUGFIX: Fixes issue with `bundle_report` and `actionview`](https://github.com/fastruby/next_rails/pull/22)
 
 # v1.0.3 / 2021-04-05 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.2...v1.0.3)
 
-* [BUGFIX] Update README.md to better document this `ten_years_rails` fork (by [@etagwerker](https://github.com/etagwerker)))
-* [BUGFIX] Make ActionView an optional dependency (by [@manuca](https://github.com/manuca))
-
+* [BUGFIX: Update README.md to better document this `ten_years_rails` fork](https://github.com/fastruby/next_rails/pull/11)
+* [BUGFIX: Make ActionView an optional dependency](https://github.com/fastruby/next_rails/pull/6)
 # v1.0.2 / 2020-01-20
 
 # v1.0.1 / 2019-07-26

From 47bd14da424828d462351105fde5f050b406916e Mon Sep 17 00:00:00 2001
From: Lewis <lewis@ombulabs.com>
Date: Fri, 11 Mar 2022 17:33:56 -0500
Subject: [PATCH 022/171] add CoC and PR template

---
 CODE_OF_CONDUCT.md       | 76 ++++++++++++++++++++++++++++++++++++++++
 pull_request_template.md |  9 +++++
 2 files changed, 85 insertions(+)
 create mode 100644 CODE_OF_CONDUCT.md
 create mode 100644 pull_request_template.md

diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..9859949
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,76 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to make participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+  advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+  address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+  professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies within all project spaces, and it also applies when
+an individual is representing the project or its community in public spaces.
+Examples of representing a project or community include using an official
+project e-mail address, posting via an official social media account, or acting
+as an appointed representative at an online or offline event. Representation of
+a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at oss@ombulabs.com. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see
+https://www.contributor-covenant.org/faq
diff --git a/pull_request_template.md b/pull_request_template.md
new file mode 100644
index 0000000..5af47fc
--- /dev/null
+++ b/pull_request_template.md
@@ -0,0 +1,9 @@
+**IMPORTANT**: Please read the README before submitting pull requests for this project. Additionally, if your PR closes any open GitHub issues, make sure you include Closes #XXXX in your comment or use the option on the PR's sidebar to add related issues to auto-close the issue that your PR fixes.
+
+- [ ] Add an entry to `CHANGELOG.md` that links to this PR under the "main (unreleased)" heading.
+
+Description:
+
+Please include a summary of the change and which issue is fixed or which feature is introduced. If changes to the behavior are made, clearly describe what changes.
+
+I will abide by the [code of conduct](CODE_OF_CONDUCT.md).
\ No newline at end of file

From b4a69c8d4d76ddc4e182b1648a0433b42f330050 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Tue, 29 Mar 2022 13:30:05 +0530
Subject: [PATCH 023/171] if shitlist path does not exist, fix the failure with
 ENOENT

---
 lib/deprecation_tracker.rb       |  8 ++++++++
 spec/deprecation_tracker_spec.rb | 27 +++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index b3851f2..c1ccf96 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -130,11 +130,19 @@ def diff
 
   def save
     new_shitlist = create_temp_shitlist
+    create_if_shitlist_path_does_not_exist
     FileUtils.cp(new_shitlist.path, shitlist_path)
   ensure
     new_shitlist.delete if new_shitlist
   end
 
+  def create_if_shitlist_path_does_not_exist
+    dirname = File.dirname(shitlist_path)
+    unless File.directory?(dirname)
+      FileUtils.mkdir_p(dirname)
+    end
+  end
+
   def create_temp_shitlist
     temp_file = Tempfile.new("temp-deprecation-tracker-shitlist")
     temp_file.write(JSON.pretty_generate(normalized_deprecation_messages))
diff --git a/spec/deprecation_tracker_spec.rb b/spec/deprecation_tracker_spec.rb
index f161146..1a9fc8a 100644
--- a/spec/deprecation_tracker_spec.rb
+++ b/spec/deprecation_tracker_spec.rb
@@ -104,6 +104,33 @@
       expect(File.read(shitlist_path)).to eq(expected_json)
     end
 
+    it "creates the directory if shitlist directory does not exist" do
+      FileUtils.mkdir_p("/tmp/test")
+      shitlist_path = Tempfile.new("tmp", "/tmp/test").path
+      FileUtils.rm(shitlist_path)
+      shitlist_path
+      subject = DeprecationTracker.new(shitlist_path)
+
+      subject.bucket = "bucket 1"
+      subject.add("b")
+      subject.add("b")
+      subject.add("a")
+
+      subject.save
+
+      expected_json = <<-JSON.chomp
+{
+  "bucket 1": [
+    "a",
+    "b",
+    "b"
+  ]
+}
+      JSON
+      expect(File.read(shitlist_path)).to eq(expected_json)
+      FileUtils.rm_r "/tmp/test"
+    end
+
     it "combines recorded and stored messages" do
       setup_tracker = DeprecationTracker.new(shitlist_path)
       setup_tracker.bucket = "bucket 1"

From 655c34922e7801ce843646d696578e360aa4225c Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Tue, 29 Mar 2022 09:20:09 -0400
Subject: [PATCH 024/171] Bump gem version

---
 lib/next_rails/version.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index 126ad6f..0c86cc6 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,3 +1,3 @@
 module NextRails
-  VERSION = "1.0.4"
+  VERSION = "1.0.5"
 end

From a5087b795c7a08bdc1309a6d3fc6fb91f912ecaf Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Tue, 29 Mar 2022 09:26:13 -0400
Subject: [PATCH 025/171] Added section about v1.0.5

---
 CHANGELOG.md | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9a413d6..0620505 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,10 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
+# v1.0.5 / 2022-03-29 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.4...v1.0.5)
+
 * [FEATURE: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock](https://github.com/fastruby/next_rails/pull/25)
 * [FEATURE: Drop `actionview` dependency because it is not really used](https://github.com/fastruby/next_rails/pull/26)
+* [BUGFIX: If shitlist path does not exist, create it for the user of the gem](https://github.com/fastruby/next_rails/pull/37)
 
 # v1.0.4 / 2021-04-09 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.3...v1.0.4)
 
@@ -17,4 +20,4 @@
 
 # v1.0.0 / 2019-07-24
 
-* Official Release
\ No newline at end of file
+* Official Release

From 4257d61acb4dacdcaaa2eb022bb4bff3e09ced1b Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 30 Mar 2022 18:27:04 +0530
Subject: [PATCH 026/171] added 'next_rails' exe to support cli option for
 version

---
 README.md      |  9 +++++++++
 exe/next_rails | 29 +++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100755 exe/next_rails

diff --git a/README.md b/README.md
index 52554d7..d246862 100644
--- a/README.md
+++ b/README.md
@@ -78,6 +78,15 @@ deprecations --help # For more options and examples
 
 Right now, the path to the shitlist is hardcoded so make sure you store yours at `spec/support/deprecations.shitlist.json`.
 
+#### `next_rails` command
+
+You can use `next_rails` to fetch the version of the gem installed.
+
+```bash
+next_rails --version
+next_rails --help # For more options and examples
+```
+
 ### Dual-boot Rails next
 
 This command helps you dual-boot your application.
diff --git a/exe/next_rails b/exe/next_rails
new file mode 100755
index 0000000..c7bf342
--- /dev/null
+++ b/exe/next_rails
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require "optparse"
+require "next_rails/version"
+
+options = {}
+option_parser = OptionParser.new do |opts|
+  opts.banner = <<-MESSAGE
+    Usage: #{__FILE__.to_s} [options]
+
+    Examples:
+      bin/next_rails --version info # Show the version of the gem installed
+  MESSAGE
+
+  opts.on("--version", "show version of the gem") do
+    options[:version] = true
+  end
+
+  opts.on_tail("-h", "--help", "Prints this help") do
+    puts opts
+    exit
+  end
+end
+
+option_parser.parse!
+
+if options.fetch(:version, false)
+  puts NextRails::VERSION
+  exit 2
+end

From f10904775b99746c45e3fb42ea7a0b89e4dbec7c Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Mon, 4 Apr 2022 13:53:12 +0530
Subject: [PATCH 027/171] added command line for ruby version check for desired
 rails version

---
 exe/bundle_report               |  1 +
 lib/next_rails/bundle_report.rb | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/exe/bundle_report b/exe/bundle_report
index 6867fdd..5edc063 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -47,6 +47,7 @@ at_exit do
   report_type = ARGV.first
 
   case report_type
+  when "ruby_check" then NextRails::BundleReport.ruby_check(rails_version: options.fetch(:rails_version))
   when "outdated" then NextRails::BundleReport.outdated
   else
     NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 11c89d4..e267e85 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -58,6 +58,16 @@ def self.gem_header(_gem)
       header
     end
 
+    def self.ruby_check(rails_version)
+      ruby_rails_hash = { "5.2.0": { minimum_ruby_version: "2.3.0" }}
+      if ruby_rails_hash[:"#{rails_version[:rails_version]}"]
+        ruby_version = ruby_rails_hash[:"#{rails_version[:rails_version]}"]
+        puts "Minimum ruby version is: #{ruby_version[:minimum_ruby_version]}"
+      else
+        puts "Could not find a compatible ruby version"
+      end
+    end
+
     def self.outdated
       gems = NextRails::GemInfo.all
       out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)

From 3bb5e6826a69a25d1feae4c2fe0b887c13b89797 Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@logicalbricks.com>
Date: Tue, 5 Apr 2022 15:10:30 -0500
Subject: [PATCH 028/171] Add github action workflows

- [x] Run RSpec suit
---
 .github/workflows/main.yml | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 .github/workflows/main.yml

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..19e4e00
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,20 @@
+name: Run rake task
+
+on: [push, pull_request]
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        ruby-version: [3.1, 2.7.5]
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Ruby ${{ matrix.ruby-version }}
+      uses: ruby/setup-ruby@v1
+      with:
+        ruby-version: ${{ matrix.ruby-version }}
+        bundler-cache: true
+    - name: Run rake task
+      run: bundle exec rake

From 895ffde425bd10e17f7f40cb82ada5b135e03eaf Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@logicalbricks.com>
Date: Tue, 5 Apr 2022 16:43:06 -0500
Subject: [PATCH 029/171] Add dependabot config

This will help us to have our dependencies updated
---
 .github/dependabot.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 .github/dependabot.yml

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..2646775
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,11 @@
+# To get started with Dependabot version updates, you'll need to specify which
+# package ecosystems to update and where the package manifests are located.
+# Please see the documentation for all configuration options:
+# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
+
+version: 2
+updates:
+  - package-ecosystem: "bundler"
+    directory: "/"
+    schedule:
+      interval: "daily"

From 808dca5c3fca93d71bf8e767aa4b5225f0d99f1b Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Thu, 7 Apr 2022 13:50:12 -0300
Subject: [PATCH 030/171] add track_minitest, some refactor and update README

---
 README.md                        | 15 ++++++--
 lib/deprecation_tracker.rb       | 59 ++++++++++++++++++++++++++------
 spec/deprecation_tracker_spec.rb | 25 ++++++++++++++
 3 files changed, 87 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index d246862..ab898ce 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,18 @@ RSpec.configure do |config|
 end
 ```
 
-We don't use MiniTest, so there isn't a prebuilt config for it but I suspect it's pretty similar to `DeprecationTracker.track_rspec`.
+If using minitest, add this somewhere close to the top of your `test_helper.rb`:
+
+```ruby
+# Tracker deprecation messages in each file
+if ENV["DEPRECATION_TRACKER"]
+  DeprecationTracker.track_minitest(
+    shitlist_path: "test/support/deprecation_warning.shitlist.json",
+    mode: ENV["DEPRECATION_TRACKER"],
+    transform_message: -> (message) { message.gsub("#{Rails.root}/", "") }
+  )
+end
+```
 
 Once you have that, you can start using deprecation tracking in your tests:
 
@@ -121,7 +132,7 @@ Execute:
     $ next --init
 
 Init will create a Gemfile.next and an initialized Gemfile.next.lock.
-The Gemfile.next.lock is initialized with the contents of your existing 
+The Gemfile.next.lock is initialized with the contents of your existing
 Gemfile.lock lock file. We initialize the Gemfile.next.lock to prevent
 major version jumps when running the next version of Rails.
 
diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index c1ccf96..37f7733 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -27,6 +27,25 @@ def warn(*messages)
     end
   end
 
+  module MinitestExtension
+    def self.new(deprecation_tracker)
+      @@deprecation_tracker = deprecation_tracker
+
+      Module.new do
+        def before_setup
+          test_file_name = method(name).source_location.first.to_s
+          @@deprecation_tracker.bucket = test_file_name.gsub(Rails.root.to_s, ".")
+          super
+        end
+      
+        def after_teardown
+          super
+          @@deprecation_tracker.bucket = nil
+        end
+      end
+    end
+  end
+
   # There are two forms of the `warn` method: one for class Kernel and one for instances of Kernel (i.e., every Object)
   Object.prepend(KernelWarnTracker)
 
@@ -39,16 +58,22 @@ def Kernel.warn(*args, &block)
     end
   end
 
-  def self.track_rspec(rspec_config, opts = {})
+  def self.init_tracker(opts = {})
     shitlist_path = opts[:shitlist_path]
     mode = opts[:mode]
     transform_message = opts[:transform_message]
-    deprecation_tracker = DeprecationTracker.new(shitlist_path, transform_message)
+    deprecation_tracker = DeprecationTracker.new(shitlist_path, transform_message, mode)
     if defined?(ActiveSupport)
       ActiveSupport::Deprecation.behavior << -> (message, _callstack, _deprecation_horizon, _gem_name) { deprecation_tracker.add(message) }
     end
     KernelWarnTracker.callbacks << -> (message) { deprecation_tracker.add(message) }
 
+    deprecation_tracker
+  end
+
+  def self.track_rspec(rspec_config, opts = {})
+    deprecation_tracker = init_tracker(opts)
+
     rspec_config.around do |example|
       deprecation_tracker.bucket = example.metadata.fetch(:rerun_file_path)
 
@@ -60,21 +85,27 @@ def self.track_rspec(rspec_config, opts = {})
     end
 
     rspec_config.after(:suite) do
-      if mode == "save"
-        deprecation_tracker.save
-      elsif mode == "compare"
-        deprecation_tracker.compare
-      end
+      deprecation_tracker.after_run
     end
   end
 
-  attr_reader :deprecation_messages, :shitlist_path, :transform_message
-  attr_reader :bucket
+  def self.track_minitest(opts = {})
+    tracker = init_tracker(opts)
+
+    Minitest.after_run do
+      tracker.after_run
+    end
+
+    ActiveSupport::TestCase.include(MinitestExtension.new(tracker))
+  end
 
-  def initialize(shitlist_path, transform_message = nil)
+  attr_reader :deprecation_messages, :shitlist_path, :transform_message, :bucket, :mode
+
+  def initialize(shitlist_path, transform_message = nil, mode = :save)
     @shitlist_path = shitlist_path
     @transform_message = transform_message || -> (message) { message }
     @deprecation_messages = {}
+    @mode = mode.to_sym
   end
 
   def add(message)
@@ -88,6 +119,14 @@ def bucket=(value)
     @deprecation_messages[value] ||= [] unless value.nil?
   end
 
+  def after_run
+    if mode == :save
+      save
+    elsif mode == :compare
+      compare
+    end
+  end
+
   def compare
     shitlist = read_shitlist
 
diff --git a/spec/deprecation_tracker_spec.rb b/spec/deprecation_tracker_spec.rb
index 1a9fc8a..7f49c42 100644
--- a/spec/deprecation_tracker_spec.rb
+++ b/spec/deprecation_tracker_spec.rb
@@ -220,6 +220,31 @@
     end
   end
 
+  describe "#after_run" do
+    let(:shitlist_path) { "some_path" }
+
+    it "calls save if in save mode" do
+      tracker = DeprecationTracker.new(shitlist_path, nil, :save)
+      expect(tracker).to receive(:save)
+      expect(tracker).not_to receive(:compare)
+      tracker.after_run
+    end
+
+    it "calls compare if in compare mode" do
+      tracker = DeprecationTracker.new(shitlist_path, nil, "compare")
+      expect(tracker).not_to receive(:save)
+      expect(tracker).to receive(:compare)
+      tracker.after_run
+    end
+
+    it "does not save nor compare if mode is invalid" do
+      tracker = DeprecationTracker.new(shitlist_path, nil, "random_stuff")
+      expect(tracker).not_to receive(:save)
+      expect(tracker).not_to receive(:compare)
+      tracker.after_run
+    end
+  end
+
   describe DeprecationTracker::KernelWarnTracker do
     it "captures Kernel#warn" do
       warn_messages = []

From cc480412b88ab86de324d219cdf523bb017e801b Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Thu, 7 Apr 2022 13:54:49 -0300
Subject: [PATCH 031/171] Add note on readme

---
 README.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.md b/README.md
index ab898ce..18b2d4a 100644
--- a/README.md
+++ b/README.md
@@ -67,6 +67,8 @@ if ENV["DEPRECATION_TRACKER"]
 end
 ```
 
+> Keep in mind this is currently not compatible with the `minitest/parallel_fork` gem!
+
 Once you have that, you can start using deprecation tracking in your tests:
 
 ```bash

From 14a9810a305cf465d8c05eb7a6f3338ff4548d68 Mon Sep 17 00:00:00 2001
From: Luciano Becerra <lubc32@gmail.com>
Date: Thu, 7 Apr 2022 16:58:05 -0300
Subject: [PATCH 032/171] Add CODEOWNERS file

---
 CODEOWNERS | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 CODEOWNERS

diff --git a/CODEOWNERS b/CODEOWNERS
new file mode 100644
index 0000000..4aec9b5
--- /dev/null
+++ b/CODEOWNERS
@@ -0,0 +1,4 @@
+# These code owners will be the default owners to everything in the repository.
+# Unless a posterior rule has precedence, they will be automatically requested
+# for review when a pull request is opened.
+*       @fastruby/black-bunny-brigade

From 68990fa497880a81b54d8d5fcf11902d8bcd9f3a Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Fri, 8 Apr 2022 22:02:13 +0530
Subject: [PATCH 033/171] updated method name from BundleReport class

---
 exe/bundle_report               | 2 +-
 lib/next_rails/bundle_report.rb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/exe/bundle_report b/exe/bundle_report
index 5edc063..b450659 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -47,7 +47,7 @@ at_exit do
   report_type = ARGV.first
 
   case report_type
-  when "ruby_check" then NextRails::BundleReport.ruby_check(rails_version: options.fetch(:rails_version))
+  when "ruby_check" then NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
   when "outdated" then NextRails::BundleReport.outdated
   else
     NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index e267e85..0db376e 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -58,7 +58,7 @@ def self.gem_header(_gem)
       header
     end
 
-    def self.ruby_check(rails_version)
+    def self.compatible_ruby_version(rails_version)
       ruby_rails_hash = { "5.2.0": { minimum_ruby_version: "2.3.0" }}
       if ruby_rails_hash[:"#{rails_version[:rails_version]}"]
         ruby_version = ruby_rails_hash[:"#{rails_version[:rails_version]}"]

From 1a1aaea7d29a48f626c6ad8fe23fe6a63ee9fbc0 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Tue, 12 Apr 2022 22:26:42 +0530
Subject: [PATCH 034/171] added rails ruby version map and updated check with
 this map

---
 lib/next_rails/bundle_report.rb |   9 +-
 lib/rails_ruby_version_map.rb   | 364 ++++++++++++++++++++++++++++++++
 2 files changed, 369 insertions(+), 4 deletions(-)
 create mode 100644 lib/rails_ruby_version_map.rb

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 0db376e..3793ad3 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -2,6 +2,7 @@
 require "cgi"
 require "erb"
 require "json"
+require "rails_ruby_version_map"
 
 module NextRails
   class BundleReport
@@ -59,10 +60,10 @@ def self.gem_header(_gem)
     end
 
     def self.compatible_ruby_version(rails_version)
-      ruby_rails_hash = { "5.2.0": { minimum_ruby_version: "2.3.0" }}
-      if ruby_rails_hash[:"#{rails_version[:rails_version]}"]
-        ruby_version = ruby_rails_hash[:"#{rails_version[:rails_version]}"]
-        puts "Minimum ruby version is: #{ruby_version[:minimum_ruby_version]}"
+      puts '2'*10
+      if RAILS_RUBY_VERSION_MAP["#{rails_version[:rails_version]}"]
+        ruby_version = RAILS_RUBY_VERSION_MAP["#{rails_version[:rails_version]}"]
+        puts "Minimum ruby version is: #{ruby_version}"
       else
         puts "Could not find a compatible ruby version"
       end
diff --git a/lib/rails_ruby_version_map.rb b/lib/rails_ruby_version_map.rb
new file mode 100644
index 0000000..2faac61
--- /dev/null
+++ b/lib/rails_ruby_version_map.rb
@@ -0,0 +1,364 @@
+RAILS_RUBY_VERSION_MAP = {
+  "7.0.2.3"=> "2.7.0",
+  "7.0.2.2"=> "2.7.0",
+  "7.0.2.1"=> "2.7.0",
+  "7.0.2"=> "2.7.0",
+  "7.0.1"=> "2.7.0",
+  "7.0.0"=> "2.7.0",
+  "7.0.0.rc3"=> "2.7.0",
+  "7.0.0.rc2"=> "2.7.0",
+  "7.0.0.rc1"=> "2.7.0",
+  "7.0.0.alpha2"=> "2.7.0",
+  "7.0.0.alpha1"=> "2.7.0",
+  "6.1.5"=> "2.5.0",
+  "6.1.4.7"=> "2.5.0",
+  "6.1.4.6"=> "2.5.0",
+  "6.1.4.5"=> "2.5.0",
+  "6.1.4.4"=> "2.5.0",
+  "6.1.4.3"=> "2.5.0",
+  "6.1.4.2"=> "2.5.0",
+  "6.1.4.1"=> "2.5.0",
+  "6.1.4"=> "2.5.0",
+  "6.1.3.2"=> "2.5.0",
+  "6.1.3.1"=> "2.5.0",
+  "6.1.3"=> "2.5.0",
+  "6.1.2.1"=> "2.5.0",
+  "6.1.2"=> "2.5.0",
+  "6.1.1"=> "2.5.0",
+  "6.1.0"=> "2.5.0",
+  "6.1.0.rc2"=> "2.5.0",
+  "6.1.0.rc1"=> "2.5.0",
+  "6.0.4.7"=> "2.5.0",
+  "6.0.4.6"=> "2.5.0",
+  "6.0.4.5"=> "2.5.0",
+  "6.0.4.4"=> "2.5.0",
+  "6.0.4.3"=> "2.5.0",
+  "6.0.4.2"=> "2.5.0",
+  "6.0.4.1"=> "2.5.0",
+  "6.0.4"=> "2.5.0",
+  "6.0.3.7"=> "2.5.0",
+  "6.0.3.6"=> "2.5.0",
+  "6.0.3.5"=> "2.5.0",
+  "6.0.3.4"=> "2.5.0",
+  "6.0.3.3"=> "2.5.0",
+  "6.0.3.2"=> "2.5.0",
+  "6.0.3.1"=> "2.5.0",
+  "6.0.3"=> "2.5.0",
+  "6.0.3.rc1"=> "2.5.0",
+  "6.0.2.2"=> "2.5.0",
+  "6.0.2.1"=> "2.5.0",
+  "6.0.2"=> "2.5.0",
+  "6.0.2.rc2"=> "2.5.0",
+  "6.0.2.rc1"=> "2.5.0",
+  "6.0.1"=> "2.5.0",
+  "6.0.1.rc1"=> "2.5.0",
+  "6.0.0"=> "2.5.0",
+  "6.0.0.rc2"=> "2.5.0",
+  "6.0.0.rc1"=> "2.5.0",
+  "6.0.0.beta3"=> "2.5.0",
+  "6.0.0.beta2"=> "2.5.0",
+  "6.0.0.beta1"=> "2.5.0",
+  "5.2.7"=> "2.2.2",
+  "5.2.6.3"=> "2.2.2",
+  "5.2.6.2"=> "2.2.2",
+  "5.2.6.1"=> "2.2.2",
+  "5.2.6"=> "2.2.2",
+  "5.2.5"=> "2.2.2",
+  "5.2.4.6"=> "2.2.2",
+  "5.2.4.5"=> "2.2.2",
+  "5.2.4.4"=> "2.2.2",
+  "5.2.4.3"=> "2.2.2",
+  "5.2.4.2"=> "2.2.2",
+  "5.2.4.1"=> "2.2.2",
+  "5.2.4"=> "2.2.2",
+  "5.2.4.rc1"=> "2.2.2",
+  "5.2.3"=> "2.2.2",
+  "5.2.3.rc1"=> "2.2.2",
+  "5.2.2.1"=> "2.2.2",
+  "5.2.2"=> "2.2.2",
+  "5.2.2.rc1"=> "2.2.2",
+  "5.2.1.1"=> "2.2.2",
+  "5.2.1"=> "2.2.2",
+  "5.2.1.rc1"=> "2.2.2",
+  "5.2.0"=> "2.2.2",
+  "5.2.0.rc2"=> "2.2.2",
+  "5.2.0.rc1"=> "2.2.2",
+  "5.2.0.beta2"=> "2.2.2",
+  "5.2.0.beta1"=> "2.2.2",
+  "5.1.7"=> "2.2.2",
+  "5.1.7.rc1"=> "2.2.2",
+  "5.1.6.2"=> "2.2.2",
+  "5.1.6.1"=> "2.2.2",
+  "5.1.6"=> "2.2.2",
+  "5.1.5"=> "2.2.2",
+  "5.1.5.rc1"=> "2.2.2",
+  "5.1.4"=> "2.2.2",
+  "5.1.4.rc1"=> "2.2.2",
+  "5.1.3"=> "2.2.2",
+  "5.1.3.rc3"=> "2.2.2",
+  "5.1.3.rc2"=> "2.2.2",
+  "5.1.3.rc1"=> "2.2.2",
+  "5.1.2"=> "2.2.2",
+  "5.1.2.rc1"=> "2.2.2",
+  "5.1.1"=> "2.2.2",
+  "5.1.0"=> "2.2.2",
+  "5.1.0.rc2"=> "2.2.2",
+  "5.1.0.rc1"=> "2.2.2",
+  "5.1.0.beta1"=> "2.2.2",
+  "5.0.7.2"=> "2.2.2",
+  "5.0.7.1"=> "2.2.2",
+  "5.0.7"=> "2.2.2",
+  "5.0.6"=> "2.2.2",
+  "5.0.6.rc1"=> "2.2.2",
+  "5.0.5"=> "2.2.2",
+  "5.0.5.rc2"=> "2.2.2",
+  "5.0.5.rc1"=> "2.2.2",
+  "5.0.4"=> "2.2.2",
+  "5.0.4.rc1"=> "2.2.2",
+  "5.0.3"=> "2.2.2",
+  "5.0.2"=> "2.2.2",
+  "5.0.2.rc1"=> "2.2.2",
+  "5.0.1"=> "2.2.2",
+  "5.0.1.rc2"=> "2.2.2",
+  "5.0.1.rc1"=> "2.2.2",
+  "5.0.0.1"=> "2.2.2",
+  "5.0.0"=> "2.2.2",
+  "5.0.0.rc2"=> "2.2.2",
+  "5.0.0.rc1"=> "2.2.2",
+  "5.0.0.racecar1"=> "2.2.2",
+  "5.0.0.beta4"=> "2.2.2",
+  "5.0.0.beta3"=> "2.2.2",
+  "5.0.0.beta2"=> "2.2.2",
+  "5.0.0.beta1.1"=> "2.2.2",
+  "5.0.0.beta1"=> "2.2.2",
+  "4.2.11.3"=> "1.9.3",
+  "4.2.11.2"=> "1.9.3",
+  "4.2.11.1"=> "1.9.3",
+  "4.2.11"=> "1.9.3",
+  "4.2.10"=> "1.9.3",
+  "4.2.10.rc1"=> "1.9.3",
+  "4.2.9"=> "1.9.3",
+  "4.2.9.rc2"=> "1.9.3",
+  "4.2.9.rc1"=> "1.9.3",
+  "4.2.8"=> "1.9.3",
+  "4.2.8.rc1"=> "1.9.3",
+  "4.2.7.1"=> "1.9.3",
+  "4.2.7"=> "1.9.3",
+  "4.2.7.rc1"=> "1.9.3",
+  "4.2.6"=> "1.9.3",
+  "4.2.6.rc1"=> "1.9.3",
+  "4.2.5.2"=> "1.9.3",
+  "4.2.5.1"=> "1.9.3",
+  "4.2.5"=> "1.9.3",
+  "4.2.5.rc2"=> "1.9.3",
+  "4.2.5.rc1"=> "1.9.3",
+  "4.2.4"=> "1.9.3",
+  "4.2.4.rc1"=> "1.9.3",
+  "4.2.3"=> "1.9.3",
+  "4.2.3.rc1"=> "1.9.3",
+  "4.2.2"=> "1.9.3",
+  "4.2.1"=> "1.9.3",
+  "4.2.1.rc4"=> "1.9.3",
+  "4.2.1.rc3"=> "1.9.3",
+  "4.2.1.rc2"=> "1.9.3",
+  "4.2.1.rc1"=> "1.9.3",
+  "4.2.0"=> "1.9.3",
+  "4.2.0.rc3"=> "1.9.3",
+  "4.2.0.rc2"=> "1.9.3",
+  "4.2.0.rc1"=> "1.9.3",
+  "4.2.0.beta4"=> "1.9.3",
+  "4.2.0.beta3"=> "1.9.3",
+  "4.2.0.beta2"=> "1.9.3",
+  "4.2.0.beta1"=> "1.9.3",
+  "4.1.16"=> "1.9.3",
+  "4.1.16.rc1"=> "1.9.3",
+  "4.1.15"=> "1.9.3",
+  "4.1.15.rc1"=> "1.9.3",
+  "4.1.14.2"=> "1.9.3",
+  "4.1.14.1"=> "1.9.3",
+  "4.1.14"=> "1.9.3",
+  "4.1.14.rc2"=> "1.9.3",
+  "4.1.14.rc1"=> "1.9.3",
+  "4.1.13"=> "1.9.3",
+  "4.1.13.rc1"=> "1.9.3",
+  "4.1.12"=> "1.9.3",
+  "4.1.12.rc1"=> "1.9.3",
+  "4.1.11"=> "1.9.3",
+  "4.1.10"=> "1.9.3",
+  "4.1.10.rc4"=> "1.9.3",
+  "4.1.10.rc3"=> "1.9.3",
+  "4.1.10.rc2"=> "1.9.3",
+  "4.1.10.rc1"=> "1.9.3",
+  "4.1.9"=> "1.9.3",
+  "4.1.9.rc1"=> "1.9.3",
+  "4.1.8"=> "1.9.3",
+  "4.1.7.1"=> "1.9.3",
+  "4.1.7"=> "1.9.3",
+  "4.1.6"=> "1.9.3",
+  "4.1.6.rc2"=> "1.9.3",
+  "4.1.6.rc1"=> "1.9.3",
+  "4.1.5"=> "1.9.3",
+  "4.1.4"=> "1.9.3",
+  "4.1.3"=> "1.9.3",
+  "4.1.2"=> "1.9.3",
+  "4.1.2.rc3"=> "1.9.3",
+  "4.1.2.rc2"=> "1.9.3",
+  "4.1.2.rc1"=> "1.9.3",
+  "4.1.1"=> "1.9.3",
+  "4.1.0"=> "1.9.3",
+  "4.1.0.rc2"=> "1.9.3",
+  "4.1.0.rc1"=> "1.9.3",
+  "4.1.0.beta2"=> "1.9.3",
+  "4.1.0.beta1"=> "1.9.3",
+  "4.0.13"=> "1.9.3",
+  "4.0.13.rc1"=> "1.9.3",
+  "4.0.12"=> "1.9.3",
+  "4.0.11.1"=> "1.9.3",
+  "4.0.11"=> "1.9.3",
+  "4.0.10"=> "1.9.3",
+  "4.0.10.rc2"=> "1.9.3",
+  "4.0.10.rc1"=> "1.9.3",
+  "4.0.9"=> "1.9.3",
+  "4.0.8"=> "1.9.3",
+  "4.0.7"=> "1.9.3",
+  "4.0.6"=> "1.9.3",
+  "4.0.6.rc3"=> "1.9.3",
+  "4.0.6.rc2"=> "1.9.3",
+  "4.0.6.rc1"=> "1.9.3",
+  "4.0.5"=> "1.9.3",
+  "4.0.4"=> "1.9.3",
+  "4.0.4.rc1"=> "1.9.3",
+  "4.0.3"=> "1.9.3",
+  "4.0.2"=> "1.9.3",
+  "4.0.1"=> "1.9.3",
+  "4.0.1.rc4"=> "1.9.3",
+  "4.0.1.rc3"=> "1.9.3",
+  "4.0.1.rc2"=> "1.9.3",
+  "4.0.1.rc1"=> "1.9.3",
+  "4.0.0"=> "1.9.3",
+  "4.0.0.rc2"=> "1.9.3",
+  "4.0.0.rc1"=> "1.9.3",
+  "4.0.0.beta1"=> "1.9.3",
+  "3.2.22.5"=> "1.8.7",
+  "3.2.22.4"=> "1.8.7",
+  "3.2.22.3"=> "1.8.7",
+  "3.2.22.2"=> "1.8.7",
+  "3.2.22.1"=> "1.8.7",
+  "3.2.22"=> "1.8.7",
+  "3.2.21"=> "1.8.7",
+  "3.2.20"=> "1.8.7",
+  "3.2.19"=> "1.8.7",
+  "3.2.18"=> "1.8.7",
+  "3.2.17"=> "1.8.7",
+  "3.2.16"=> "1.8.7",
+  "3.2.15"=> "1.8.7",
+  "3.2.15.rc3"=> "1.8.7",
+  "3.2.15.rc2"=> "1.8.7",
+  "3.2.15.rc1"=> "1.8.7",
+  "3.2.14"=> "1.8.7",
+  "3.2.14.rc2"=> "1.8.7",
+  "3.2.14.rc1"=> "1.8.7",
+  "3.2.13"=> "1.8.7",
+  "3.2.13.rc2"=> "1.8.7",
+  "3.2.13.rc1"=> "1.8.7",
+  "3.2.12"=> "1.8.7",
+  "3.2.11"=> "1.8.7",
+  "3.2.10"=> "1.8.7",
+  "3.2.9"=> "1.8.7",
+  "3.2.9.rc3"=> "1.8.7",
+  "3.2.9.rc2"=> "1.8.7",
+  "3.2.9.rc1"=> "1.8.7",
+  "3.2.8"=> "1.8.7",
+  "3.2.8.rc2"=> "1.8.7",
+  "3.2.8.rc1"=> "1.8.7",
+  "3.2.7"=> "1.8.7",
+  "3.2.7.rc1"=> "1.8.7",
+  "3.2.6"=> "1.8.7",
+  "3.2.5"=> "1.8.7",
+  "3.2.4"=> "1.8.7",
+  "3.2.4.rc1"=> "1.8.7",
+  "3.2.3"=> "1.8.7",
+  "3.2.3.rc2"=> "1.8.7",
+  "3.2.3.rc1"=> "1.8.7",
+  "3.2.2"=> "1.8.7",
+  "3.2.2.rc1"=> "1.8.7",
+  "3.2.1"=> "1.8.7",
+  "3.2.0"=> "1.8.7",
+  "3.2.0.rc2"=> "1.8.7",
+  "3.2.0.rc1"=> "1.8.7",
+  "3.1.12"=> "1.8.7",
+  "3.1.11"=> "1.8.7",
+  "3.1.10"=> "1.8.7",
+  "3.1.9"=> "1.8.7",
+  "3.1.8"=> "1.8.7",
+  "3.1.7"=> "1.8.7",
+  "3.1.6"=> "1.8.7",
+  "3.1.5"=> "1.8.7",
+  "3.1.5.rc1"=> "1.8.7",
+  "3.1.4"=> "1.8.7",
+  "3.1.4.rc1"=> "1.8.7",
+  "3.1.3"=> "1.8.7",
+  "3.1.2"=> "1.8.7",
+  "3.1.2.rc2"=> "1.8.7",
+  "3.1.2.rc1"=> "1.8.7",
+  "3.1.1"=> "1.8.7",
+  "3.1.1.rc3"=> "1.8.7",
+  "3.1.1.rc2"=> "1.8.7",
+  "3.1.1.rc1"=> "1.8.7",
+  "3.1.0"=> "1.8.7",
+  "3.1.0.rc8"=> "1.8.7",
+  "3.1.0.rc7"=> "1.8.7",
+  "3.1.0.rc6"=> "1.8.7",
+  "3.1.0.rc5"=> "1.8.7",
+  "3.1.0.rc4"=> "1.8.7",
+  "3.1.0.rc3"=> "1.8.7",
+  "3.1.0.rc2"=> "1.8.7",
+  "3.1.0.rc1"=> "1.8.7",
+  "3.1.0.beta1"=> "1.8.7",
+  "3.0.20"=> "1.8.7",
+  "3.0.19"=> "1.8.7",
+  "3.0.18"=> "1.8.7",
+  "3.0.17"=> "1.8.7",
+  "3.0.16"=> "1.8.7",
+  "3.0.15"=> "1.8.7",
+  "3.0.14"=> "1.8.7",
+  "3.0.13"=> "1.8.7",
+  "3.0.13.rc1"=> "1.8.7",
+  "3.0.12"=> "1.8.7",
+  "3.0.12.rc1"=> "1.8.7",
+  "3.0.11"=> "1.8.7",
+  "3.0.10"=> "1.8.7",
+  "3.0.10.rc1"=> "1.8.7",
+  "3.0.9"=> "1.8.7",
+  "3.0.9.rc5"=> "1.8.7",
+  "3.0.9.rc4"=> "1.8.7",
+  "3.0.9.rc3"=> "1.8.7",
+  "3.0.9.rc2"=> "1.8.7",
+  "3.0.9.rc1"=> "1.8.7",
+  "3.0.8"=> "1.8.7",
+  "3.0.8.rc4"=> "1.8.7",
+  "3.0.8.rc3"=> "1.8.7",
+  "3.0.8.rc2"=> "1.8.7",
+  "3.0.8.rc1"=> "1.8.7",
+  "3.0.7"=> "1.8.7",
+  "3.0.7.rc2"=> "1.8.7",
+  "3.0.7.rc1"=> "1.8.7",
+  "3.0.6"=> "1.8.7",
+  "3.0.6.rc2"=> "1.8.7",
+  "3.0.6.rc1"=> "1.8.7",
+  "3.0.5"=> "1.8.7",
+  "3.0.5.rc1"=> "1.8.7",
+  "3.0.4"=> "1.8.7",
+  "3.0.4.rc1"=> "1.8.7",
+  "3.0.4.rc"=> "1.8.7",
+  "3.0.3"=> "1.8.7",
+  "3.0.2"=> "1.8.7",
+  "3.0.1"=> "1.8.7",
+  "3.0.0"=> "1.8.7",
+  "3.0.0.rc2"=> "1.8.7",
+  "3.0.0.rc"=> "1.8.7",
+  "3.0.0.beta4"=> "1.8.7",
+  "3.0.0.beta3"=> "1.8.7",
+  "3.0.0.beta2"=> "1.8.7",
+  "3.0.0.beta"=> "1.8.7",
+}

From fd9dd5e44fea765f1b292f1e09c7d5a862f9af35 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 13 Apr 2022 11:12:04 +0530
Subject: [PATCH 035/171] added spec for the method and return ruby version
 explicitly

---
 lib/next_rails/bundle_report.rb       |  2 +-
 spec/next_rails/bundle_report_spec.rb | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 spec/next_rails/bundle_report_spec.rb

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 3793ad3..0ec6e6d 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -60,10 +60,10 @@ def self.gem_header(_gem)
     end
 
     def self.compatible_ruby_version(rails_version)
-      puts '2'*10
       if RAILS_RUBY_VERSION_MAP["#{rails_version[:rails_version]}"]
         ruby_version = RAILS_RUBY_VERSION_MAP["#{rails_version[:rails_version]}"]
         puts "Minimum ruby version is: #{ruby_version}"
+        ruby_version
       else
         puts "Could not find a compatible ruby version"
       end
diff --git a/spec/next_rails/bundle_report_spec.rb b/spec/next_rails/bundle_report_spec.rb
new file mode 100644
index 0000000..c121e88
--- /dev/null
+++ b/spec/next_rails/bundle_report_spec.rb
@@ -0,0 +1,22 @@
+require_relative ".././spec_helper"
+require_relative "../../lib/next_rails/bundle_report"
+
+RSpec.describe NextRails::BundleReport do
+  describe "#compatible_ruby_version" do
+    context "when rails_version is a valid one" do
+      it "returns the correct ruby version" do
+        rails_version = { rails_version: "7.0.0" }
+        ruby_version = NextRails::BundleReport.compatible_ruby_version(rails_version)
+        expect(ruby_version).to eq("2.7.0")
+      end
+    end
+    
+    context "when rails_version is an invalid one" do
+      it "returns the correct ruby version" do
+        rails_version = { rails_version: "0.0.0" }
+        ruby_version = NextRails::BundleReport.compatible_ruby_version(rails_version)
+        expect(ruby_version).to eq(nil)
+      end
+    end
+  end
+end

From 635cdd4d835990a82fcb1b17f949ac73a00505d5 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 13 Apr 2022 11:22:48 +0530
Subject: [PATCH 036/171] added ruby_check command to the doc

---
 README.md         | 2 ++
 exe/bundle_report | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/README.md b/README.md
index d246862..cad2ffc 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,8 @@ bundle_report outdated | head -n 5
 # Show gems that don't work with Rails 5.2.0
 bundle_report compatibility --rails-version=5.2.0
 bundle_report --help
+# Find minimum compatible ruby version with Rails 7.0.0
+bundle_report ruby_check --rails-version=7.0.0
 ```
 
 ### Deprecation tracking
diff --git a/exe/bundle_report b/exe/bundle_report
index b450659..cf702b5 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -17,6 +17,12 @@ at_exit do
       Examples:
         #{$0} compatibility --rails-version 5.0
         #{$0} outdated
+
+      ruby_check To find a compatible ruby version for the target rails version
+
+      Examples:
+        #{$0} ruby_check --rails-version 7.0.0
+
     EOS
 
     opts.separator ""

From 10de9c2dea929f7ff5b9414103acf7617c459ed2 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 13 Apr 2022 11:29:39 +0530
Subject: [PATCH 037/171] updated spec message

---
 spec/next_rails/bundle_report_spec.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spec/next_rails/bundle_report_spec.rb b/spec/next_rails/bundle_report_spec.rb
index c121e88..e568aaf 100644
--- a/spec/next_rails/bundle_report_spec.rb
+++ b/spec/next_rails/bundle_report_spec.rb
@@ -12,7 +12,7 @@
     end
     
     context "when rails_version is an invalid one" do
-      it "returns the correct ruby version" do
+      it "returns nil for ruby version" do
         rails_version = { rails_version: "0.0.0" }
         ruby_version = NextRails::BundleReport.compatible_ruby_version(rails_version)
         expect(ruby_version).to eq(nil)

From 0f9475b7496e12337d412b0496caaa92fcaaffc5 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 17 Apr 2022 22:37:13 +0000
Subject: [PATCH 038/171] Update rake requirement from ~> 10.0 to ~> 13.0

Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/rake-10.0.0...v13.0.6)

---
updated-dependencies:
- dependency-name: rake
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
---
 next_rails.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 72b2f7d..7fa192b 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
 
   spec.add_dependency "colorize", ">= 0.8.1"
   spec.add_development_dependency "bundler", ">= 1.16", "< 3.0"
-  spec.add_development_dependency "rake", "~> 10.0"
+  spec.add_development_dependency "rake", "~> 13.0"
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"

From 2116745ff30af4c3ef54f109cd81d4f3247f38e3 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Mon, 18 Apr 2022 15:02:08 -0300
Subject: [PATCH 039/171] Make behavior arguments optional

---
 lib/deprecation_tracker.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index 37f7733..b0b020c 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -64,7 +64,9 @@ def self.init_tracker(opts = {})
     transform_message = opts[:transform_message]
     deprecation_tracker = DeprecationTracker.new(shitlist_path, transform_message, mode)
     if defined?(ActiveSupport)
-      ActiveSupport::Deprecation.behavior << -> (message, _callstack, _deprecation_horizon, _gem_name) { deprecation_tracker.add(message) }
+      ActiveSupport::Deprecation.behavior << -> (message, _callstack = nil, _deprecation_horizon = nil, _gem_name = nil) {
+        deprecation_tracker.add(message)
+      }
     end
     KernelWarnTracker.callbacks << -> (message) { deprecation_tracker.add(message) }
 

From d70fbf5b81f52bb25d72129289069295c52c3d11 Mon Sep 17 00:00:00 2001
From: Fiona <fionadlapham@gmail.com>
Date: Thu, 21 Apr 2022 14:21:11 -0400
Subject: [PATCH 040/171] Updatest he code of conduct link in PR template

---
 pull_request_template.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pull_request_template.md b/pull_request_template.md
index 5af47fc..d3cf4ee 100644
--- a/pull_request_template.md
+++ b/pull_request_template.md
@@ -6,4 +6,4 @@ Description:
 
 Please include a summary of the change and which issue is fixed or which feature is introduced. If changes to the behavior are made, clearly describe what changes.
 
-I will abide by the [code of conduct](CODE_OF_CONDUCT.md).
\ No newline at end of file
+I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md).

From 7a3487390482da7afc4102d05e7b9d0899dda76b Mon Sep 17 00:00:00 2001
From: Fiona <fionadlapham@gmail.com>
Date: Thu, 21 Apr 2022 16:52:18 -0400
Subject: [PATCH 041/171] Add templates for feature request and bug reporting

---
 .github/ISSUE_TEMPLATE/bug_report.md      | 51 +++++++++++++++++++++++
 .github/ISSUE_TEMPLATE/feature_request.md | 40 ++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md
 create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md

diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..58f4848
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,51 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: "[BUG] "
+labels: bug
+assignees: ""
+---
+
+**IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.**
+
+**Before we start...:**
+
+- [ ] I checked the documentation and found no answer
+- [ ] I checked to make sure that this issue has not already been filed
+- [ ] I'm reporting the issue to the correct repository (for multi-repository projects)
+
+**Version, Branch, or Commit:**
+
+What branch/commit/version of "next_rails" you are using?
+
+**Expected behavior:**
+
+Please include a detailed description of the behavior you were expecting when you encountered this issue.
+
+**Actual behavior:**
+
+Please include a detailed description of the actual behavior of the application.
+
+**Steps to reproduce:**
+
+How do I achieve this behavior? Use the following format to provide a step-by-step guide:
+
+1. Step 1: ...
+2. Step 2: ...
+
+**Context and environment:**
+
+Provide any relevant information about your setup (Customize the list accordingly based on what info is relevant to this project)
+
+1. Version of the software the issue is being opened for.
+2. Operating System
+3. Operating System version
+4. Ruby version
+
+_Delete any information that is not relevant._
+
+**Logs**
+
+Include relevant log snippets or files here.
+
+**I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md)**
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..5bde9f1
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,40 @@
+---
+name: Feature request
+about: Request a new feature
+title: "[REQUEST]"
+labels: enhancement
+assignees: ""
+---
+
+**IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.**
+
+**Before we start...:**
+
+- [ ] I checked the documentation and didn't find this feature
+- [ ] I checked to make sure that this feature has not already been requested
+
+**Branch/Commit:**
+
+Inform what branch/commit/version of "next_rails" you are using.
+
+**Describe the feature:**
+
+Please include a detailed description of the feature you are requesting and any detail on it’s expected behavior.
+
+> **As a \<role name\>** > **I do \<something\>** > **And then I do \<another action\>** > **And I see \<some result\>**
+
+**Problem:**
+
+Please include a detailed description of the problem this feature would solve.
+
+> **As a \<role name\>** > **I want to \<do something\>** > **So that I can achieve a \<goal\>**
+
+**Mockups:**
+
+Include any mockup idea related to the requested feature if it applies.
+
+**Resources:**
+
+If you have resources related to the implementation or research for this feature, add them here.
+
+**I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md)**

From 40590042e11978e5765049ab293b3114b490324b Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Mon, 25 Apr 2022 16:49:23 -0300
Subject: [PATCH 042/171] Find latest compatible version when checking
 compatibility

---
 lib/next_rails/bundle_report.rb | 15 ++---
 lib/next_rails/gem_info.rb      | 97 +++++++++++++++++++++------------
 2 files changed, 67 insertions(+), 45 deletions(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 11c89d4..27bcb13 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -8,22 +8,19 @@ class BundleReport
     def self.compatibility(rails_version:, include_rails_gems:)
       incompatible_gems = NextRails::GemInfo.all.reject do |gem|
         gem.compatible_with_rails?(rails_version: rails_version) || (!include_rails_gems && gem.from_rails?)
-      end.sort_by do |gem|
-        [
-          gem.latest_version.compatible_with_rails?(rails_version: rails_version) ? 0 : 1,
-          gem.name
-        ].join("-")
-      end
+      end.sort_by { |gem| gem.name }
+
+      incompatible_gems.each { |gem| gem.find_latest_compatible(rails_version: rails_version) }
 
       incompatible_gems_by_state = incompatible_gems.group_by { |gem| gem.state(rails_version) }
 
       template = <<~ERB
-        <% if incompatible_gems_by_state[:latest_compatible] -%>
+        <% if incompatible_gems_by_state[:found_compatible] -%>
         <%= "=> Incompatible with Rails #{rails_version} (with new versions that are compatible):".white.bold %>
         <%= "These gems will need to be upgraded before upgrading to Rails #{rails_version}.".italic %>
 
-        <% incompatible_gems_by_state[:latest_compatible].each do |gem| -%>
-        <%= gem_header(gem) %> - upgrade to <%= gem.latest_version.version %>
+        <% incompatible_gems_by_state[:found_compatible].each do |gem| -%>
+        <%= gem_header(gem) %> - upgrade to <%= gem.latest_compatible_version.version %>
         <% end -%>
 
         <% end -%>
diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index 0a2433d..dc8b9f2 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -28,13 +28,28 @@ def state(_)
       end
     end
 
+    RAILS_GEMS = [
+      "rails",
+      "activemodel",
+      "activerecord",
+      "actionmailer",
+      "actioncable",
+      "actionpack",
+      "actionview",
+      "activejob",
+      "activestorage",
+      "activesupport",
+      "railties",
+    ].freeze
+
     def self.all
       Gem::Specification.each.map do |gem_specification|
         new(gem_specification)
       end
     end
 
-    attr_reader :gem_specification, :version, :name
+    attr_reader :gem_specification, :version, :name, :latest_compatible_version
+
     def initialize(gem_specification)
       @gem_specification = gem_specification
       @version = gem_specification.version
@@ -57,59 +72,69 @@ def up_to_date?
       version == latest_version.version
     end
 
+    def from_rails?
+      RAILS_GEMS.include?(name)
+    end
+
     def state(rails_version)
       if compatible_with_rails?(rails_version: rails_version)
         :compatible
-      elsif latest_version.compatible_with_rails?(rails_version: rails_version)
-        :latest_compatible
-      elsif latest_version.version == "NOT FOUND"
+      elsif latest_compatible_version.version == "NOT FOUND"
         :no_new_version
+      elsif latest_compatible_version
+        :found_compatible
       else
         :incompatible
       end
     end
 
-    def latest_version
-      @latest_version ||= begin
-        latest_gem_specification = Gem.latest_spec_for(name)
-        if latest_gem_specification
-          GemInfo.new(latest_gem_specification)
-        else
-          NullGemInfo.new
-        end
-      end
-    end
-
-    def compatible_with_rails?(rails_version: Gem::Version.new("5.0"))
+    def compatible_with_rails?(rails_version:)
       unsatisfied_rails_dependencies(rails_version: rails_version).empty?
     end
 
     def unsatisfied_rails_dependencies(rails_version:)
-      rails_dependencies = gem_specification.runtime_dependencies.select {|dependency| rails_gems.include?(dependency.name) }
+      spec_compatible_with_rails?(specification: gem_specification, rails_version: rails_version)
+    end
 
-      rails_dependencies.reject do |rails_dependency|
-        rails_dependency.requirement.satisfied_by?(Gem::Version.new(rails_version))
+    def find_latest_compatible(rails_version:)
+      dependency = Gem::Dependency.new(@name)
+      fetcher = Gem::SpecFetcher.new
+
+      # list all available data for released gems
+      list, errors = fetcher.available_specs(:released)
+
+      specs = []
+      # filter only specs for the current gem and older versions
+      list.each do |source, gem_tuples|
+        gem_tuples.each do |gem_tuple|
+          if gem_tuple.name == @name && gem_tuple.version > @version
+            specs << source.fetch_spec(gem_tuple)
+          end
+        end
       end
-    end
 
-    def from_rails?
-      rails_gems.include?(name)
+      # if nothing is found, consider gem incompatible
+      if specs.empty?
+        @latest_compatible_version = NullGemInfo.new
+        return
+      end
+
+      # if specs are found, look for the first one from that is compatible
+      # with the desired rails version starting from the end
+      specs.reverse.each do |spec|
+        if spec_compatible_with_rails?(specification: spec, rails_version: rails_version).empty?
+          @latest_compatible_version = spec
+          break
+        end
+      end
     end
 
-    private def rails_gems
-      [
-        "rails",
-        "activemodel",
-        "activerecord",
-        "actionmailer",
-        "actioncable",
-        "actionpack",
-        "actionview",
-        "activejob",
-        "activestorage",
-        "activesupport",
-        "railties",
-      ]
+    def spec_compatible_with_rails?(specification:, rails_version:)
+      rails_dependencies = specification.runtime_dependencies.select {|dependency| RAILS_GEMS.include?(dependency.name) }
+
+      rails_dependencies.reject do |rails_dependency|
+        rails_dependency.requirement.satisfied_by?(Gem::Version.new(rails_version))
+      end
     end
   end
 end

From ad566c7a344bfc1cb987610752d07b633a6da317 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Mon, 25 Apr 2022 17:04:03 -0300
Subject: [PATCH 043/171] Update CHANGELOG

---
 CHANGELOG.md | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0620505..47615da 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,23 +1,26 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
+- [FEATURE: Try to find the latest **compatible** version of a gem if the latest version is not compatible with the desired Rails version when checking compatibility](https://github.com/fastruby/next_rails/pull/49)
+
 # v1.0.5 / 2022-03-29 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.4...v1.0.5)
 
-* [FEATURE: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock](https://github.com/fastruby/next_rails/pull/25)
-* [FEATURE: Drop `actionview` dependency because it is not really used](https://github.com/fastruby/next_rails/pull/26)
-* [BUGFIX: If shitlist path does not exist, create it for the user of the gem](https://github.com/fastruby/next_rails/pull/37)
+- [FEATURE: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock](https://github.com/fastruby/next_rails/pull/25)
+- [FEATURE: Drop `actionview` dependency because it is not really used](https://github.com/fastruby/next_rails/pull/26)
+- [BUGFIX: If shitlist path does not exist, create it for the user of the gem](https://github.com/fastruby/next_rails/pull/37)
 
 # v1.0.4 / 2021-04-09 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.3...v1.0.4)
 
-* [BUGFIX: Fixes issue with `bundle_report` and `actionview`](https://github.com/fastruby/next_rails/pull/22)
+- [BUGFIX: Fixes issue with `bundle_report` and `actionview`](https://github.com/fastruby/next_rails/pull/22)
 
 # v1.0.3 / 2021-04-05 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.2...v1.0.3)
 
-* [BUGFIX: Update README.md to better document this `ten_years_rails` fork](https://github.com/fastruby/next_rails/pull/11)
-* [BUGFIX: Make ActionView an optional dependency](https://github.com/fastruby/next_rails/pull/6)
+- [BUGFIX: Update README.md to better document this `ten_years_rails` fork](https://github.com/fastruby/next_rails/pull/11)
+- [BUGFIX: Make ActionView an optional dependency](https://github.com/fastruby/next_rails/pull/6)
+
 # v1.0.2 / 2020-01-20
 
 # v1.0.1 / 2019-07-26
 
 # v1.0.0 / 2019-07-24
 
-* Official Release
+- Official Release

From 3aa910aa7f40570d054bed845b663af0cc4c1711 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Mon, 25 Apr 2022 17:05:58 -0300
Subject: [PATCH 044/171] Rever extra formatting changes

---
 CHANGELOG.md | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 47615da..30058d8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,21 +1,21 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
-- [FEATURE: Try to find the latest **compatible** version of a gem if the latest version is not compatible with the desired Rails version when checking compatibility](https://github.com/fastruby/next_rails/pull/49)
+* [FEATURE: Try to find the latest **compatible** version of a gem if the latest version is not compatible with the desired Rails version when checking compatibility](https://github.com/fastruby/next_rails/pull/49)
 
 # v1.0.5 / 2022-03-29 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.4...v1.0.5)
 
-- [FEATURE: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock](https://github.com/fastruby/next_rails/pull/25)
-- [FEATURE: Drop `actionview` dependency because it is not really used](https://github.com/fastruby/next_rails/pull/26)
-- [BUGFIX: If shitlist path does not exist, create it for the user of the gem](https://github.com/fastruby/next_rails/pull/37)
+* [FEATURE: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock](https://github.com/fastruby/next_rails/pull/25)
+* [FEATURE: Drop `actionview` dependency because it is not really used](https://github.com/fastruby/next_rails/pull/26)
+* [BUGFIX: If shitlist path does not exist, create it for the user of the gem](https://github.com/fastruby/next_rails/pull/37)
 
 # v1.0.4 / 2021-04-09 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.3...v1.0.4)
 
-- [BUGFIX: Fixes issue with `bundle_report` and `actionview`](https://github.com/fastruby/next_rails/pull/22)
+* [BUGFIX: Fixes issue with `bundle_report` and `actionview`](https://github.com/fastruby/next_rails/pull/22)
 
 # v1.0.3 / 2021-04-05 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.2...v1.0.3)
 
-- [BUGFIX: Update README.md to better document this `ten_years_rails` fork](https://github.com/fastruby/next_rails/pull/11)
-- [BUGFIX: Make ActionView an optional dependency](https://github.com/fastruby/next_rails/pull/6)
+* [BUGFIX: Update README.md to better document this `ten_years_rails` fork](https://github.com/fastruby/next_rails/pull/11)
+* [BUGFIX: Make ActionView an optional dependency](https://github.com/fastruby/next_rails/pull/6)
 
 # v1.0.2 / 2020-01-20
 
@@ -23,4 +23,4 @@
 
 # v1.0.0 / 2019-07-24
 
-- Official Release
+* Official Release

From 6f7c9e31e889566d24cc8cee1795331e749c6eb1 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Thu, 28 Apr 2022 15:38:59 +0530
Subject: [PATCH 045/171] removed the hard coded map of rails and ruby versions
 made it fetched dynamically

---
 lib/next_rails/bundle_report.rb       |  37 ++-
 lib/rails_ruby_version_map.rb         | 364 --------------------------
 spec/next_rails/bundle_report_spec.rb |  10 +-
 3 files changed, 42 insertions(+), 369 deletions(-)
 delete mode 100644 lib/rails_ruby_version_map.rb

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 0ec6e6d..6cfce14 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -2,7 +2,7 @@
 require "cgi"
 require "erb"
 require "json"
-require "rails_ruby_version_map"
+require "net/http"
 
 module NextRails
   class BundleReport
@@ -60,9 +60,38 @@ def self.gem_header(_gem)
     end
 
     def self.compatible_ruby_version(rails_version)
-      if RAILS_RUBY_VERSION_MAP["#{rails_version[:rails_version]}"]
-        ruby_version = RAILS_RUBY_VERSION_MAP["#{rails_version[:rails_version]}"]
-        puts "Minimum ruby version is: #{ruby_version}"
+      # find all the versions of rails gem
+      uri = URI('https://rubygems.org/api/v1/versions/rails.json')
+      res = Net::HTTP.get_response(uri)
+      all_versions_res = JSON.parse(res.body)
+
+      # push all the versions in an array
+      all_versions = []
+      all_versions_res.each { |rv| all_versions << rv['number'] }
+
+      rv = rails_version[:rails_version]
+      matched_versions = all_versions.select { |h| h.match(rv) && h.start_with?(rv) }
+
+      # the list can either have the exact version or the latest version in the series of versions
+      # you are looking at
+      # ex: matched_versions = ["6.1.4.2", "6.1.4.1", "6.1.4"]
+      # if you have passed "6.1.4" and the list has the exact version, it will match and send
+      # the ruby version for it bu tif you had passed "6.1", then it will look for the
+      # latest version matching "6.1" which is "6.1.4.2" in this case and will return ruby
+      # version for it.
+      exact_version = matched_versions.include?(rv) ? rv: matched_versions[0]
+
+      if exact_version
+        uri = URI("https://rubygems.org/api/v2/rubygems/rails/versions/#{exact_version}.json")
+        res = Net::HTTP.get_response(uri)
+        ruby_version = JSON.parse(res.body)["ruby_version"]
+      else
+        ruby_version = nil
+      end
+
+
+      if ruby_version
+        puts "Recommended ruby version is: #{ruby_version} for matched rails version #{exact_version}"
         ruby_version
       else
         puts "Could not find a compatible ruby version"
diff --git a/lib/rails_ruby_version_map.rb b/lib/rails_ruby_version_map.rb
deleted file mode 100644
index 2faac61..0000000
--- a/lib/rails_ruby_version_map.rb
+++ /dev/null
@@ -1,364 +0,0 @@
-RAILS_RUBY_VERSION_MAP = {
-  "7.0.2.3"=> "2.7.0",
-  "7.0.2.2"=> "2.7.0",
-  "7.0.2.1"=> "2.7.0",
-  "7.0.2"=> "2.7.0",
-  "7.0.1"=> "2.7.0",
-  "7.0.0"=> "2.7.0",
-  "7.0.0.rc3"=> "2.7.0",
-  "7.0.0.rc2"=> "2.7.0",
-  "7.0.0.rc1"=> "2.7.0",
-  "7.0.0.alpha2"=> "2.7.0",
-  "7.0.0.alpha1"=> "2.7.0",
-  "6.1.5"=> "2.5.0",
-  "6.1.4.7"=> "2.5.0",
-  "6.1.4.6"=> "2.5.0",
-  "6.1.4.5"=> "2.5.0",
-  "6.1.4.4"=> "2.5.0",
-  "6.1.4.3"=> "2.5.0",
-  "6.1.4.2"=> "2.5.0",
-  "6.1.4.1"=> "2.5.0",
-  "6.1.4"=> "2.5.0",
-  "6.1.3.2"=> "2.5.0",
-  "6.1.3.1"=> "2.5.0",
-  "6.1.3"=> "2.5.0",
-  "6.1.2.1"=> "2.5.0",
-  "6.1.2"=> "2.5.0",
-  "6.1.1"=> "2.5.0",
-  "6.1.0"=> "2.5.0",
-  "6.1.0.rc2"=> "2.5.0",
-  "6.1.0.rc1"=> "2.5.0",
-  "6.0.4.7"=> "2.5.0",
-  "6.0.4.6"=> "2.5.0",
-  "6.0.4.5"=> "2.5.0",
-  "6.0.4.4"=> "2.5.0",
-  "6.0.4.3"=> "2.5.0",
-  "6.0.4.2"=> "2.5.0",
-  "6.0.4.1"=> "2.5.0",
-  "6.0.4"=> "2.5.0",
-  "6.0.3.7"=> "2.5.0",
-  "6.0.3.6"=> "2.5.0",
-  "6.0.3.5"=> "2.5.0",
-  "6.0.3.4"=> "2.5.0",
-  "6.0.3.3"=> "2.5.0",
-  "6.0.3.2"=> "2.5.0",
-  "6.0.3.1"=> "2.5.0",
-  "6.0.3"=> "2.5.0",
-  "6.0.3.rc1"=> "2.5.0",
-  "6.0.2.2"=> "2.5.0",
-  "6.0.2.1"=> "2.5.0",
-  "6.0.2"=> "2.5.0",
-  "6.0.2.rc2"=> "2.5.0",
-  "6.0.2.rc1"=> "2.5.0",
-  "6.0.1"=> "2.5.0",
-  "6.0.1.rc1"=> "2.5.0",
-  "6.0.0"=> "2.5.0",
-  "6.0.0.rc2"=> "2.5.0",
-  "6.0.0.rc1"=> "2.5.0",
-  "6.0.0.beta3"=> "2.5.0",
-  "6.0.0.beta2"=> "2.5.0",
-  "6.0.0.beta1"=> "2.5.0",
-  "5.2.7"=> "2.2.2",
-  "5.2.6.3"=> "2.2.2",
-  "5.2.6.2"=> "2.2.2",
-  "5.2.6.1"=> "2.2.2",
-  "5.2.6"=> "2.2.2",
-  "5.2.5"=> "2.2.2",
-  "5.2.4.6"=> "2.2.2",
-  "5.2.4.5"=> "2.2.2",
-  "5.2.4.4"=> "2.2.2",
-  "5.2.4.3"=> "2.2.2",
-  "5.2.4.2"=> "2.2.2",
-  "5.2.4.1"=> "2.2.2",
-  "5.2.4"=> "2.2.2",
-  "5.2.4.rc1"=> "2.2.2",
-  "5.2.3"=> "2.2.2",
-  "5.2.3.rc1"=> "2.2.2",
-  "5.2.2.1"=> "2.2.2",
-  "5.2.2"=> "2.2.2",
-  "5.2.2.rc1"=> "2.2.2",
-  "5.2.1.1"=> "2.2.2",
-  "5.2.1"=> "2.2.2",
-  "5.2.1.rc1"=> "2.2.2",
-  "5.2.0"=> "2.2.2",
-  "5.2.0.rc2"=> "2.2.2",
-  "5.2.0.rc1"=> "2.2.2",
-  "5.2.0.beta2"=> "2.2.2",
-  "5.2.0.beta1"=> "2.2.2",
-  "5.1.7"=> "2.2.2",
-  "5.1.7.rc1"=> "2.2.2",
-  "5.1.6.2"=> "2.2.2",
-  "5.1.6.1"=> "2.2.2",
-  "5.1.6"=> "2.2.2",
-  "5.1.5"=> "2.2.2",
-  "5.1.5.rc1"=> "2.2.2",
-  "5.1.4"=> "2.2.2",
-  "5.1.4.rc1"=> "2.2.2",
-  "5.1.3"=> "2.2.2",
-  "5.1.3.rc3"=> "2.2.2",
-  "5.1.3.rc2"=> "2.2.2",
-  "5.1.3.rc1"=> "2.2.2",
-  "5.1.2"=> "2.2.2",
-  "5.1.2.rc1"=> "2.2.2",
-  "5.1.1"=> "2.2.2",
-  "5.1.0"=> "2.2.2",
-  "5.1.0.rc2"=> "2.2.2",
-  "5.1.0.rc1"=> "2.2.2",
-  "5.1.0.beta1"=> "2.2.2",
-  "5.0.7.2"=> "2.2.2",
-  "5.0.7.1"=> "2.2.2",
-  "5.0.7"=> "2.2.2",
-  "5.0.6"=> "2.2.2",
-  "5.0.6.rc1"=> "2.2.2",
-  "5.0.5"=> "2.2.2",
-  "5.0.5.rc2"=> "2.2.2",
-  "5.0.5.rc1"=> "2.2.2",
-  "5.0.4"=> "2.2.2",
-  "5.0.4.rc1"=> "2.2.2",
-  "5.0.3"=> "2.2.2",
-  "5.0.2"=> "2.2.2",
-  "5.0.2.rc1"=> "2.2.2",
-  "5.0.1"=> "2.2.2",
-  "5.0.1.rc2"=> "2.2.2",
-  "5.0.1.rc1"=> "2.2.2",
-  "5.0.0.1"=> "2.2.2",
-  "5.0.0"=> "2.2.2",
-  "5.0.0.rc2"=> "2.2.2",
-  "5.0.0.rc1"=> "2.2.2",
-  "5.0.0.racecar1"=> "2.2.2",
-  "5.0.0.beta4"=> "2.2.2",
-  "5.0.0.beta3"=> "2.2.2",
-  "5.0.0.beta2"=> "2.2.2",
-  "5.0.0.beta1.1"=> "2.2.2",
-  "5.0.0.beta1"=> "2.2.2",
-  "4.2.11.3"=> "1.9.3",
-  "4.2.11.2"=> "1.9.3",
-  "4.2.11.1"=> "1.9.3",
-  "4.2.11"=> "1.9.3",
-  "4.2.10"=> "1.9.3",
-  "4.2.10.rc1"=> "1.9.3",
-  "4.2.9"=> "1.9.3",
-  "4.2.9.rc2"=> "1.9.3",
-  "4.2.9.rc1"=> "1.9.3",
-  "4.2.8"=> "1.9.3",
-  "4.2.8.rc1"=> "1.9.3",
-  "4.2.7.1"=> "1.9.3",
-  "4.2.7"=> "1.9.3",
-  "4.2.7.rc1"=> "1.9.3",
-  "4.2.6"=> "1.9.3",
-  "4.2.6.rc1"=> "1.9.3",
-  "4.2.5.2"=> "1.9.3",
-  "4.2.5.1"=> "1.9.3",
-  "4.2.5"=> "1.9.3",
-  "4.2.5.rc2"=> "1.9.3",
-  "4.2.5.rc1"=> "1.9.3",
-  "4.2.4"=> "1.9.3",
-  "4.2.4.rc1"=> "1.9.3",
-  "4.2.3"=> "1.9.3",
-  "4.2.3.rc1"=> "1.9.3",
-  "4.2.2"=> "1.9.3",
-  "4.2.1"=> "1.9.3",
-  "4.2.1.rc4"=> "1.9.3",
-  "4.2.1.rc3"=> "1.9.3",
-  "4.2.1.rc2"=> "1.9.3",
-  "4.2.1.rc1"=> "1.9.3",
-  "4.2.0"=> "1.9.3",
-  "4.2.0.rc3"=> "1.9.3",
-  "4.2.0.rc2"=> "1.9.3",
-  "4.2.0.rc1"=> "1.9.3",
-  "4.2.0.beta4"=> "1.9.3",
-  "4.2.0.beta3"=> "1.9.3",
-  "4.2.0.beta2"=> "1.9.3",
-  "4.2.0.beta1"=> "1.9.3",
-  "4.1.16"=> "1.9.3",
-  "4.1.16.rc1"=> "1.9.3",
-  "4.1.15"=> "1.9.3",
-  "4.1.15.rc1"=> "1.9.3",
-  "4.1.14.2"=> "1.9.3",
-  "4.1.14.1"=> "1.9.3",
-  "4.1.14"=> "1.9.3",
-  "4.1.14.rc2"=> "1.9.3",
-  "4.1.14.rc1"=> "1.9.3",
-  "4.1.13"=> "1.9.3",
-  "4.1.13.rc1"=> "1.9.3",
-  "4.1.12"=> "1.9.3",
-  "4.1.12.rc1"=> "1.9.3",
-  "4.1.11"=> "1.9.3",
-  "4.1.10"=> "1.9.3",
-  "4.1.10.rc4"=> "1.9.3",
-  "4.1.10.rc3"=> "1.9.3",
-  "4.1.10.rc2"=> "1.9.3",
-  "4.1.10.rc1"=> "1.9.3",
-  "4.1.9"=> "1.9.3",
-  "4.1.9.rc1"=> "1.9.3",
-  "4.1.8"=> "1.9.3",
-  "4.1.7.1"=> "1.9.3",
-  "4.1.7"=> "1.9.3",
-  "4.1.6"=> "1.9.3",
-  "4.1.6.rc2"=> "1.9.3",
-  "4.1.6.rc1"=> "1.9.3",
-  "4.1.5"=> "1.9.3",
-  "4.1.4"=> "1.9.3",
-  "4.1.3"=> "1.9.3",
-  "4.1.2"=> "1.9.3",
-  "4.1.2.rc3"=> "1.9.3",
-  "4.1.2.rc2"=> "1.9.3",
-  "4.1.2.rc1"=> "1.9.3",
-  "4.1.1"=> "1.9.3",
-  "4.1.0"=> "1.9.3",
-  "4.1.0.rc2"=> "1.9.3",
-  "4.1.0.rc1"=> "1.9.3",
-  "4.1.0.beta2"=> "1.9.3",
-  "4.1.0.beta1"=> "1.9.3",
-  "4.0.13"=> "1.9.3",
-  "4.0.13.rc1"=> "1.9.3",
-  "4.0.12"=> "1.9.3",
-  "4.0.11.1"=> "1.9.3",
-  "4.0.11"=> "1.9.3",
-  "4.0.10"=> "1.9.3",
-  "4.0.10.rc2"=> "1.9.3",
-  "4.0.10.rc1"=> "1.9.3",
-  "4.0.9"=> "1.9.3",
-  "4.0.8"=> "1.9.3",
-  "4.0.7"=> "1.9.3",
-  "4.0.6"=> "1.9.3",
-  "4.0.6.rc3"=> "1.9.3",
-  "4.0.6.rc2"=> "1.9.3",
-  "4.0.6.rc1"=> "1.9.3",
-  "4.0.5"=> "1.9.3",
-  "4.0.4"=> "1.9.3",
-  "4.0.4.rc1"=> "1.9.3",
-  "4.0.3"=> "1.9.3",
-  "4.0.2"=> "1.9.3",
-  "4.0.1"=> "1.9.3",
-  "4.0.1.rc4"=> "1.9.3",
-  "4.0.1.rc3"=> "1.9.3",
-  "4.0.1.rc2"=> "1.9.3",
-  "4.0.1.rc1"=> "1.9.3",
-  "4.0.0"=> "1.9.3",
-  "4.0.0.rc2"=> "1.9.3",
-  "4.0.0.rc1"=> "1.9.3",
-  "4.0.0.beta1"=> "1.9.3",
-  "3.2.22.5"=> "1.8.7",
-  "3.2.22.4"=> "1.8.7",
-  "3.2.22.3"=> "1.8.7",
-  "3.2.22.2"=> "1.8.7",
-  "3.2.22.1"=> "1.8.7",
-  "3.2.22"=> "1.8.7",
-  "3.2.21"=> "1.8.7",
-  "3.2.20"=> "1.8.7",
-  "3.2.19"=> "1.8.7",
-  "3.2.18"=> "1.8.7",
-  "3.2.17"=> "1.8.7",
-  "3.2.16"=> "1.8.7",
-  "3.2.15"=> "1.8.7",
-  "3.2.15.rc3"=> "1.8.7",
-  "3.2.15.rc2"=> "1.8.7",
-  "3.2.15.rc1"=> "1.8.7",
-  "3.2.14"=> "1.8.7",
-  "3.2.14.rc2"=> "1.8.7",
-  "3.2.14.rc1"=> "1.8.7",
-  "3.2.13"=> "1.8.7",
-  "3.2.13.rc2"=> "1.8.7",
-  "3.2.13.rc1"=> "1.8.7",
-  "3.2.12"=> "1.8.7",
-  "3.2.11"=> "1.8.7",
-  "3.2.10"=> "1.8.7",
-  "3.2.9"=> "1.8.7",
-  "3.2.9.rc3"=> "1.8.7",
-  "3.2.9.rc2"=> "1.8.7",
-  "3.2.9.rc1"=> "1.8.7",
-  "3.2.8"=> "1.8.7",
-  "3.2.8.rc2"=> "1.8.7",
-  "3.2.8.rc1"=> "1.8.7",
-  "3.2.7"=> "1.8.7",
-  "3.2.7.rc1"=> "1.8.7",
-  "3.2.6"=> "1.8.7",
-  "3.2.5"=> "1.8.7",
-  "3.2.4"=> "1.8.7",
-  "3.2.4.rc1"=> "1.8.7",
-  "3.2.3"=> "1.8.7",
-  "3.2.3.rc2"=> "1.8.7",
-  "3.2.3.rc1"=> "1.8.7",
-  "3.2.2"=> "1.8.7",
-  "3.2.2.rc1"=> "1.8.7",
-  "3.2.1"=> "1.8.7",
-  "3.2.0"=> "1.8.7",
-  "3.2.0.rc2"=> "1.8.7",
-  "3.2.0.rc1"=> "1.8.7",
-  "3.1.12"=> "1.8.7",
-  "3.1.11"=> "1.8.7",
-  "3.1.10"=> "1.8.7",
-  "3.1.9"=> "1.8.7",
-  "3.1.8"=> "1.8.7",
-  "3.1.7"=> "1.8.7",
-  "3.1.6"=> "1.8.7",
-  "3.1.5"=> "1.8.7",
-  "3.1.5.rc1"=> "1.8.7",
-  "3.1.4"=> "1.8.7",
-  "3.1.4.rc1"=> "1.8.7",
-  "3.1.3"=> "1.8.7",
-  "3.1.2"=> "1.8.7",
-  "3.1.2.rc2"=> "1.8.7",
-  "3.1.2.rc1"=> "1.8.7",
-  "3.1.1"=> "1.8.7",
-  "3.1.1.rc3"=> "1.8.7",
-  "3.1.1.rc2"=> "1.8.7",
-  "3.1.1.rc1"=> "1.8.7",
-  "3.1.0"=> "1.8.7",
-  "3.1.0.rc8"=> "1.8.7",
-  "3.1.0.rc7"=> "1.8.7",
-  "3.1.0.rc6"=> "1.8.7",
-  "3.1.0.rc5"=> "1.8.7",
-  "3.1.0.rc4"=> "1.8.7",
-  "3.1.0.rc3"=> "1.8.7",
-  "3.1.0.rc2"=> "1.8.7",
-  "3.1.0.rc1"=> "1.8.7",
-  "3.1.0.beta1"=> "1.8.7",
-  "3.0.20"=> "1.8.7",
-  "3.0.19"=> "1.8.7",
-  "3.0.18"=> "1.8.7",
-  "3.0.17"=> "1.8.7",
-  "3.0.16"=> "1.8.7",
-  "3.0.15"=> "1.8.7",
-  "3.0.14"=> "1.8.7",
-  "3.0.13"=> "1.8.7",
-  "3.0.13.rc1"=> "1.8.7",
-  "3.0.12"=> "1.8.7",
-  "3.0.12.rc1"=> "1.8.7",
-  "3.0.11"=> "1.8.7",
-  "3.0.10"=> "1.8.7",
-  "3.0.10.rc1"=> "1.8.7",
-  "3.0.9"=> "1.8.7",
-  "3.0.9.rc5"=> "1.8.7",
-  "3.0.9.rc4"=> "1.8.7",
-  "3.0.9.rc3"=> "1.8.7",
-  "3.0.9.rc2"=> "1.8.7",
-  "3.0.9.rc1"=> "1.8.7",
-  "3.0.8"=> "1.8.7",
-  "3.0.8.rc4"=> "1.8.7",
-  "3.0.8.rc3"=> "1.8.7",
-  "3.0.8.rc2"=> "1.8.7",
-  "3.0.8.rc1"=> "1.8.7",
-  "3.0.7"=> "1.8.7",
-  "3.0.7.rc2"=> "1.8.7",
-  "3.0.7.rc1"=> "1.8.7",
-  "3.0.6"=> "1.8.7",
-  "3.0.6.rc2"=> "1.8.7",
-  "3.0.6.rc1"=> "1.8.7",
-  "3.0.5"=> "1.8.7",
-  "3.0.5.rc1"=> "1.8.7",
-  "3.0.4"=> "1.8.7",
-  "3.0.4.rc1"=> "1.8.7",
-  "3.0.4.rc"=> "1.8.7",
-  "3.0.3"=> "1.8.7",
-  "3.0.2"=> "1.8.7",
-  "3.0.1"=> "1.8.7",
-  "3.0.0"=> "1.8.7",
-  "3.0.0.rc2"=> "1.8.7",
-  "3.0.0.rc"=> "1.8.7",
-  "3.0.0.beta4"=> "1.8.7",
-  "3.0.0.beta3"=> "1.8.7",
-  "3.0.0.beta2"=> "1.8.7",
-  "3.0.0.beta"=> "1.8.7",
-}
diff --git a/spec/next_rails/bundle_report_spec.rb b/spec/next_rails/bundle_report_spec.rb
index e568aaf..07b26b5 100644
--- a/spec/next_rails/bundle_report_spec.rb
+++ b/spec/next_rails/bundle_report_spec.rb
@@ -7,7 +7,15 @@
       it "returns the correct ruby version" do
         rails_version = { rails_version: "7.0.0" }
         ruby_version = NextRails::BundleReport.compatible_ruby_version(rails_version)
-        expect(ruby_version).to eq("2.7.0")
+        expect(ruby_version).to eq(">= 2.7.0")
+      end
+    end
+
+    context "when partial rails_version is passed as argument" do
+      it "returns the correct ruby version" do
+        rails_version = { rails_version: "7.0" }
+        ruby_version = NextRails::BundleReport.compatible_ruby_version(rails_version)
+        expect(ruby_version).to eq(">= 2.7.0")
       end
     end
     

From e30606824fa741e64217630c125c0e5948c44414 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 25 May 2022 17:45:12 +0530
Subject: [PATCH 046/171] updated syntax as per review

---
 lib/next_rails/bundle_report.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 6cfce14..f31cbd3 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -70,7 +70,7 @@ def self.compatible_ruby_version(rails_version)
       all_versions_res.each { |rv| all_versions << rv['number'] }
 
       rv = rails_version[:rails_version]
-      matched_versions = all_versions.select { |h| h.match(rv) && h.start_with?(rv) }
+      matched_versions = all_versions.select { |h| h.start_with?(rv) }
 
       # the list can either have the exact version or the latest version in the series of versions
       # you are looking at
@@ -79,7 +79,7 @@ def self.compatible_ruby_version(rails_version)
       # the ruby version for it bu tif you had passed "6.1", then it will look for the
       # latest version matching "6.1" which is "6.1.4.2" in this case and will return ruby
       # version for it.
-      exact_version = matched_versions.include?(rv) ? rv: matched_versions[0]
+      exact_version = matched_versions.include?(rv) ? rv : matched_versions[0]
 
       if exact_version
         uri = URI("https://rubygems.org/api/v2/rubygems/rails/versions/#{exact_version}.json")
@@ -91,7 +91,7 @@ def self.compatible_ruby_version(rails_version)
 
 
       if ruby_version
-        puts "Recommended ruby version is: #{ruby_version} for matched rails version #{exact_version}"
+        puts "The required ruby version is #{ruby_version} for matched rails version #{exact_version}"
         ruby_version
       else
         puts "Could not find a compatible ruby version"

From 0dd8fbfe017a0893f0cde6f6e0c201d4018285bc Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 25 May 2022 18:38:22 +0530
Subject: [PATCH 047/171] stub requests to rubygems for specs

---
 next_rails.gemspec  |  1 +
 spec/spec_helper.rb | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 72b2f7d..00a96c5 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -29,4 +29,5 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
+  spec.add_development_dependency "webmock"
 end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index d4ffcfb..2f42824 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,5 +1,9 @@
 require "bundler/setup"
 require "next_rails"
+
+require 'webmock/rspec'
+WebMock.disable_net_connect!(allow_localhost: true)
+
 if ENV['COVERAGE'] == 'true'
   require 'simplecov'
   SimpleCov.start do
@@ -29,4 +33,14 @@
   config.expect_with :rspec do |c|
     c.syntax = :expect
   end
+
+  config.before(:each) do
+    stub_request(:get, /rubygems.org\/api\/v2\/rubygems\/rails\/versions/).
+      with(headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'rubygems.org', 'User-Agent'=>'Ruby'}).
+      to_return(status: 200, body: "{\"ruby_version\": \">= 2.7.0\"}", headers: {})
+
+    stub_request(:get, /rubygems.org\/api\/v1\/versions\/rails.json/).
+      with(headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'rubygems.org', 'User-Agent'=>'Ruby'}).
+      to_return(status: 200, body: "[{\"number\": \"7.0.0\"}, {\"number\": \"6.1.6\"}]", headers: {})
+  end
 end

From d054b7f5bd4683434238dc6731694ddfe429fe55 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Thu, 30 Jun 2022 16:09:35 +0530
Subject: [PATCH 048/171] updated CHANGELOG for next version release

---
 CHANGELOG.md | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 30058d8..d163ff7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,23 @@
 
 * [FEATURE: Try to find the latest **compatible** version of a gem if the latest version is not compatible with the desired Rails version when checking compatibility](https://github.com/fastruby/next_rails/pull/49)
 
+* [FEATURE: Added option --version to get the version of the gem being used](https://github.com/fastruby/next_rails/pull/38)
+
+* [Added github action workflow](https://github.com/fastruby/next_rails/pull/40)
+
+* [FEATURE: Add support to use DeprecationTracker with Minitest](Add support to use DeprecationTracker with Minitest)
+
+* [FEATURE: Add dependabot](https://github.com/fastruby/next_rails/pull/41)
+
+* [DOCUMENTATION: Update the code of conduct link in PR template](https://github.com/fastruby/next_rails/pull/46)
+
+* [DOCUMENTATION: Add FEATURE REQUEST and BUG REPORT templates ](https://github.com/fastruby/next_rails/pull/48)
+
+* [BUGFIX: Make behavior arguments optional](https://github.com/fastruby/next_rails/pull/44)
+
+* [FEATURE: Command line option to check for recommended ruby version for the desired Rails version](https://github.com/fastruby/next_rails/pull/39)
+
+
 # v1.0.5 / 2022-03-29 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.4...v1.0.5)
 
 * [FEATURE: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock](https://github.com/fastruby/next_rails/pull/25)

From f2e17d2840d8f1694aea2f4a2a054c39888fda55 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Thu, 30 Jun 2022 09:16:06 -0400
Subject: [PATCH 049/171] Add section about contributing and releases

---
 README.md | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/README.md b/README.md
index 1fed9da..17c7fa7 100644
--- a/README.md
+++ b/README.md
@@ -140,6 +140,33 @@ The Gemfile.next.lock is initialized with the contents of your existing
 Gemfile.lock lock file. We initialize the Gemfile.next.lock to prevent
 major version jumps when running the next version of Rails.
 
+## Contributing
+
+Have a fix for a problem you've been running into or an idea for a new feature you think would be useful? Want to see how you can support `next_rails`?
+
+Take a look at the [Contributing document](CONTRIBUTING.md) for instructions to set up the repo on your machine!
+
+## Releases
+
+`next_rails` adheres to [semver](https://semver.org). So given a version number MAJOR.MINOR.PATCH, we will increment the:
+
+1. MAJOR version when you make incompatible API changes,
+2. MINOR version when you add functionality in a backwards compatible manner, and
+3. PATCH version when you make backwards compatible bug fixes.
+
+Here are the steps to release a new version:
+
+1. Update the `version.rb` file with the proper version number
+2. Update `CHANGELOG.md` to have the right headers
+3. Commit your changes to a `release/v-1-1-0` branch
+4. Push your changes and submit a pull request
+5. Merge your pull request to the `main` branch
+6. Git tag the latest version of the `main` branch (`git tag v1.1.0`)
+7. Push tags to GitHub (`git push --tags`)
+8. Build the gem (`gem build next_rails.gemspec`)
+9. Push the .gem package to Rubygems.org (`gem push next_rails-1.1.0.gem`)
+10. You are all done!
+
 ## License
 
 The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

From b071b75f2850b56bb509955d8aa49ee45869555e Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Thu, 30 Jun 2022 09:16:31 -0400
Subject: [PATCH 050/171] New file inspired in the `skunk` library

This is no a direct copy as some things did not apply in the `next_rails` gem.
---
 CONTRIBUTING.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 CONTRIBUTING.md

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..88cfb3d
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,60 @@
+# Contributing to next_rails
+
+Have a fix for a problem you've been running into or an idea for a new feature you think would be useful? Bug reports and pull requests are welcome on GitHub at [https://github.com/fastruby/next_rails](https://github.com/fastruby/next_rails).
+
+Here's what you need to do:
+
+- Read and understand the [Code of Conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md).
+- Fork this repo and clone your fork to somewhere on your machine.
+- [Ensure that you have a working environment](#setting-up-your-environment)
+- Read up on [run the tests](#running-all-tests).
+- Open a new branch and write a failing test for the feature or bug fix you plan on implementing.
+- [Update the changelog when applicable](#a-word-on-the-changelog).
+- Push to your fork and submit a pull request.
+- [Make sure the test suite passes on GitHub Actions and make any necessary changes to your branch to bring it to green.](#continuous-integration).
+
+## Setting up your environment
+To install the dependencies, run:
+
+```bash
+bin/setup
+```
+
+You can also run `bin/console` for an interactive prompt that will allow you to experiment with the gem.
+
+To install this gem onto your local machine, run:
+
+`bundle exec rake install`.
+
+### Running all tests
+
+To run all of the tests, simply run:
+
+```bash
+bundle exec rake
+```
+
+## A word on the changelog
+
+You may also notice that we have a changelog in the form of [CHANGELOG.md](CHANGELOG.md). We use a format based on [Keep A Changelog](https://keepachangelog.com/en/1.0.0/).
+
+The important things to keep in mind are:
+
+- If your PR closes any open GitHub issue, make sure you include `Closes #XXXX` in your comment.
+- New additions get added under the main (unreleased) heading;
+- Attach a link to the PR with the following format:
+
+* [<FEATURE | BUGFIX | CHORE>: Description of changes](github.com/link/to/pr).
+
+## When Submitting a Pull Request:
+
+* If your PR closes any open GitHub issues, please include `Closes #XXXX` in your comment.
+* Please include a summary of the change and which issue is fixed or which feature is introduced.
+* If changes to the behavior are made, clearly describe what are the changes and why.
+* If changes to the UI are made, please include screenshots of the before and after.
+
+## Continuous integration
+
+After opening your Pull Request, please make sure that all tests pass on the CI, to make sure your changes work in all possible environments. GitHub Actions will kick in after you push up a branch or open a PR.
+
+If the build fails, click on a failed job and scroll through its output to verify what is the problem. Push your changes to your branch until the build is green.

From bfe11bcc3d2117c605be65174c04013381660081 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Thu, 30 Jun 2022 09:19:24 -0400
Subject: [PATCH 051/171] Add an entry about PR #53

---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 30058d8..effc3c3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
 * [FEATURE: Try to find the latest **compatible** version of a gem if the latest version is not compatible with the desired Rails version when checking compatibility](https://github.com/fastruby/next_rails/pull/49)
+* [FEATURE: Better documentation for contributing and releasing versions of this gem](https://github.com/fastruby/next_rails/pull/53)
 
 # v1.0.5 / 2022-03-29 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.4...v1.0.5)
 

From def285f57620df8f52f0b288c9bf0c8942f0c15c Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Thu, 30 Jun 2022 19:06:12 +0530
Subject: [PATCH 052/171] bump to v1.1.0

---
 lib/next_rails/version.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index 0c86cc6..5bb07dc 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,3 +1,3 @@
 module NextRails
-  VERSION = "1.0.5"
+  VERSION = "1.1.0"
 end

From 5ac6a70b995df247d9a992582d954d1a91796a3b Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 12:59:22 -0300
Subject: [PATCH 053/171] Run tests with older ruby versions

---
 .github/workflows/main.yml | 18 +++++++++---------
 next_rails.gemspec         |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 19e4e00..f42e4db 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -7,14 +7,14 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: [3.1, 2.7.5]
+        ruby-version: [3.1, 2.7.5, 2.1, 2.0, 1.9]
 
     steps:
-    - uses: actions/checkout@v2
-    - name: Set up Ruby ${{ matrix.ruby-version }}
-      uses: ruby/setup-ruby@v1
-      with:
-        ruby-version: ${{ matrix.ruby-version }}
-        bundler-cache: true
-    - name: Run rake task
-      run: bundle exec rake
+      - uses: actions/checkout@v2
+      - name: Set up Ruby ${{ matrix.ruby-version }}
+        uses: ruby/setup-ruby@v1
+        with:
+          ruby-version: ${{ matrix.ruby-version }}
+          bundler-cache: true
+      - name: Run rake task
+        run: bundle exec rake
diff --git a/next_rails.gemspec b/next_rails.gemspec
index b0ea7b4..bfe3ec1 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
   spec.homepage     = "https://github.com/fastruby/next_rails"
   spec.license       = "MIT"
 
-  spec.required_ruby_version = ">= 2.3.0"
+  spec.required_ruby_version = ">= 0"
 
   spec.files         = `git ls-files -z`.split("\x0").reject do |f|
     f.match(%r{^(test|spec|features)/})

From e1dbe38c12544ba6e7667549c0e0d8b3edf8407b Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 13:03:24 -0300
Subject: [PATCH 054/171] Correct ruby versions

---
 .github/workflows/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f42e4db..7f0cb08 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -7,7 +7,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: [3.1, 2.7.5, 2.1, 2.0, 1.9]
+        ruby-version: [3.1, 2.7.5, 2.2, 2.1.9, 2.0.0, 1.9.3]
 
     steps:
       - uses: actions/checkout@v2

From ad0418267ca343c3c2fd4af7133a5ae008c13122 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 13:06:27 -0300
Subject: [PATCH 055/171] Loosen rake dependency

---
 next_rails.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index bfe3ec1..ac10ca6 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
 
   spec.add_dependency "colorize", ">= 0.8.1"
   spec.add_development_dependency "bundler", ">= 1.16", "< 3.0"
-  spec.add_development_dependency "rake", "~> 13.0"
+  spec.add_development_dependency "rake"
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"

From 692781df704aa3c20bac2d2b49a9913b6a58c32f Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 13:09:49 -0300
Subject: [PATCH 056/171] Use <<- instead of <<~ to support older rubies

---
 lib/next_rails/bundle_report.rb | 70 ++++++++++++++++-----------------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 15f2b84..ae9672c 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -15,36 +15,36 @@ def self.compatibility(rails_version:, include_rails_gems:)
 
       incompatible_gems_by_state = incompatible_gems.group_by { |gem| gem.state(rails_version) }
 
-      template = <<~ERB
-        <% if incompatible_gems_by_state[:found_compatible] -%>
-        <%= "=> Incompatible with Rails #{rails_version} (with new versions that are compatible):".white.bold %>
-        <%= "These gems will need to be upgraded before upgrading to Rails #{rails_version}.".italic %>
-
-        <% incompatible_gems_by_state[:found_compatible].each do |gem| -%>
-        <%= gem_header(gem) %> - upgrade to <%= gem.latest_compatible_version.version %>
-        <% end -%>
-
-        <% end -%>
-        <% if incompatible_gems_by_state[:incompatible] -%>
-        <%= "=> Incompatible with Rails #{rails_version} (with no new compatible versions):".white.bold %>
-        <%= "These gems will need to be removed or replaced before upgrading to Rails #{rails_version}.".italic %>
-
-        <% incompatible_gems_by_state[:incompatible].each do |gem| -%>
-        <%= gem_header(gem) %> - new version, <%= gem.latest_version.version %>, is not compatible with Rails #{rails_version}
-        <% end -%>
-
-        <% end -%>
-        <% if incompatible_gems_by_state[:no_new_version] -%>
-        <%= "=> Incompatible with Rails #{rails_version} (with no new versions):".white.bold %>
-        <%= "These gems will need to be upgraded by us or removed before upgrading to Rails #{rails_version}.".italic %>
-        <%= "This list is likely to contain internal gems, like Cuddlefish.".italic %>
-
-        <% incompatible_gems_by_state[:no_new_version].each do |gem| -%>
-        <%= gem_header(gem) %> - new version not found
-        <% end -%>
-
-        <% end -%>
-        <%= incompatible_gems.length.to_s.red %> gems incompatible with Rails <%= rails_version %>
+      template = <<-ERB
+<% if incompatible_gems_by_state[:found_compatible] -%>
+<%= "=> Incompatible with Rails #{rails_version} (with new versions that are compatible):".white.bold %>
+<%= "These gems will need to be upgraded before upgrading to Rails #{rails_version}.".italic %>
+
+<% incompatible_gems_by_state[:found_compatible].each do |gem| -%>
+<%= gem_header(gem) %> - upgrade to <%= gem.latest_compatible_version.version %>
+<% end -%>
+
+<% end -%>
+<% if incompatible_gems_by_state[:incompatible] -%>
+<%= "=> Incompatible with Rails #{rails_version} (with no new compatible versions):".white.bold %>
+<%= "These gems will need to be removed or replaced before upgrading to Rails #{rails_version}.".italic %>
+
+<% incompatible_gems_by_state[:incompatible].each do |gem| -%>
+<%= gem_header(gem) %> - new version, <%= gem.latest_version.version %>, is not compatible with Rails #{rails_version}
+<% end -%>
+
+<% end -%>
+<% if incompatible_gems_by_state[:no_new_version] -%>
+<%= "=> Incompatible with Rails #{rails_version} (with no new versions):".white.bold %>
+<%= "These gems will need to be upgraded by us or removed before upgrading to Rails #{rails_version}.".italic %>
+<%= "This list is likely to contain internal gems, like Cuddlefish.".italic %>
+
+<% incompatible_gems_by_state[:no_new_version].each do |gem| -%>
+<%= gem_header(gem) %> - new version not found
+<% end -%>
+
+<% end -%>
+<%= incompatible_gems.length.to_s.red %> gems incompatible with Rails <%= rails_version %>
       ERB
 
       puts ERB.new(template, nil, "-").result(binding)
@@ -104,15 +104,15 @@ def self.outdated
       out_of_date_gems.each do |_gem|
         header = "#{_gem.name} #{_gem.version}"
 
-        puts <<~MESSAGE
-          #{header.bold.white}: released #{_gem.age} (latest version, #{_gem.latest_version.version}, released #{_gem.latest_version.age})
+        puts <<-MESSAGE
+#{header.bold.white}: released #{_gem.age} (latest version, #{_gem.latest_version.version}, released #{_gem.latest_version.age})
         MESSAGE
       end
 
       puts ""
-      puts <<~MESSAGE
-        #{"#{sourced_from_git.count}".yellow} gems are sourced from git
-        #{"#{out_of_date_gems.length}".red} of the #{gems.count} gems are out-of-date (#{percentage_out_of_date}%)
+      puts <<-MESSAGE
+#{"#{sourced_from_git.count}".yellow} gems are sourced from git
+#{"#{out_of_date_gems.length}".red} of the #{gems.count} gems are out-of-date (#{percentage_out_of_date}%)
       MESSAGE
     end
   end

From aade0fbaf8da48dafd7ee4e7592f8974c09554b9 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 13:11:47 -0300
Subject: [PATCH 057/171] Explicit default for keyword arguments to support
 older rubies

---
 lib/next_rails/gem_info.rb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index dc8b9f2..c92d6d7 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -88,15 +88,15 @@ def state(rails_version)
       end
     end
 
-    def compatible_with_rails?(rails_version:)
+    def compatible_with_rails?(rails_version: nil)
       unsatisfied_rails_dependencies(rails_version: rails_version).empty?
     end
 
-    def unsatisfied_rails_dependencies(rails_version:)
+    def unsatisfied_rails_dependencies(rails_version: nil)
       spec_compatible_with_rails?(specification: gem_specification, rails_version: rails_version)
     end
 
-    def find_latest_compatible(rails_version:)
+    def find_latest_compatible(rails_version: nil)
       dependency = Gem::Dependency.new(@name)
       fetcher = Gem::SpecFetcher.new
 
@@ -129,7 +129,7 @@ def find_latest_compatible(rails_version:)
       end
     end
 
-    def spec_compatible_with_rails?(specification:, rails_version:)
+    def spec_compatible_with_rails?(specification: nil, rails_version: nil)
       rails_dependencies = specification.runtime_dependencies.select {|dependency| RAILS_GEMS.include?(dependency.name) }
 
       rails_dependencies.reject do |rails_dependency|

From dbcf7dc7dfbd5460eea4ea8104ecc8d81253cadf Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 13:15:14 -0300
Subject: [PATCH 058/171] Explicit default for keyword arguments to support
 older rubies

---
 lib/next_rails/bundle_report.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index ae9672c..98da9af 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -6,7 +6,7 @@
 
 module NextRails
   class BundleReport
-    def self.compatibility(rails_version:, include_rails_gems:)
+    def self.compatibility(rails_version: nil, include_rails_gems: nil)
       incompatible_gems = NextRails::GemInfo.all.reject do |gem|
         gem.compatible_with_rails?(rails_version: rails_version) || (!include_rails_gems && gem.from_rails?)
       end.sort_by { |gem| gem.name }

From aaa76f5456ac62c5195fd4feedd015c6c33de919 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 14:20:34 -0300
Subject: [PATCH 059/171] Use extend if prepend is not available

---
 lib/deprecation_tracker.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index b0b020c..f3b9320 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -47,7 +47,11 @@ def after_teardown
   end
 
   # There are two forms of the `warn` method: one for class Kernel and one for instances of Kernel (i.e., every Object)
-  Object.prepend(KernelWarnTracker)
+  if Object.respond_to?(:prepend)
+    Object.prepend(KernelWarnTracker)
+  else
+    Object.extend(KernelWarnTracker)
+  end
 
   # Ruby 2.2 and lower doesn't appear to allow overriding of Kernel.warn using `singleton_class.prepend`.
   if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.3.0")

From 9b8f0ec4f8338990691178f70269ec0d0393b2c9 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 14:34:26 -0300
Subject: [PATCH 060/171] Limit version of rexml to support older rubies

---
 next_rails.gemspec | 1 +
 1 file changed, 1 insertion(+)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index ac10ca6..d6bebd8 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -29,5 +29,6 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
+  spec.add_development_dependency "rexml", "3.1.7.3"
   spec.add_development_dependency "webmock"
 end

From caffed429dffef44265cda75e440855024949713 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 14:37:38 -0300
Subject: [PATCH 061/171] Replace .to_h to support older rubies

---
 lib/deprecation_tracker.rb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index f3b9320..ed60506 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -202,7 +202,12 @@ def normalized_deprecation_messages
       hash[bucket] = messages.sort
     end
 
-    normalized.reject {|_key, value| value.empty? }.sort_by {|key, _value| key }.to_h
+    # not using `to_h` here to support older ruby versions
+    {}.tap do |h|
+      normalized.reject {|_key, value| value.empty? }.sort_by {|key, _value| key }.each do |k ,v|
+        h[k] = v
+      end
+    end
   end
 
   def read_shitlist

From 6d3ca3b526bbfbc0dc80f6ffe141804c9e49e30b Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 15:10:20 -0300
Subject: [PATCH 062/171] Remove 1.9.3 tests

---
 .github/workflows/main.yml | 2 +-
 next_rails.gemspec         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 7f0cb08..650e3d0 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -7,7 +7,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: [3.1, 2.7.5, 2.2, 2.1.9, 2.0.0, 1.9.3]
+        ruby-version: [3.1, 2.7.5, 2.3, 2.2, 2.1.9, 2.0.0]
 
     steps:
       - uses: actions/checkout@v2
diff --git a/next_rails.gemspec b/next_rails.gemspec
index d6bebd8..2b8c578 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -29,6 +29,6 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
-  spec.add_development_dependency "rexml", "3.1.7.3"
+  spec.add_development_dependency "rexml", "3.1.7.3" # limited on purpose, new versions don't work with old rubies
   spec.add_development_dependency "webmock"
 end

From 7ecc2713f9c8a9b0ca77ec5c6dc37b8d3cfc5784 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 15:15:48 -0300
Subject: [PATCH 063/171] Accept ruby >= 2.0

---
 next_rails.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 2b8c578..02a0c77 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
   spec.homepage     = "https://github.com/fastruby/next_rails"
   spec.license       = "MIT"
 
-  spec.required_ruby_version = ">= 0"
+  spec.required_ruby_version = ">= 2.0"
 
   spec.files         = `git ls-files -z`.split("\x0").reject do |f|
     f.match(%r{^(test|spec|features)/})

From ac0193bc288c06e22c0b905d7a88edf30b23101e Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Tue, 5 Jul 2022 15:23:04 -0300
Subject: [PATCH 064/171] Update changelog

---
 CHANGELOG.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 690848f..3e30b1e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,9 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
+* [FEATURE: Support Ruby versions as old as Ruby 2.0](https://github.com/fastruby/next_rails/pull/54)
+
 * [FEATURE: Try to find the latest **compatible** version of a gem if the latest version is not compatible with the desired Rails version when checking compatibility](https://github.com/fastruby/next_rails/pull/49)
+
 * [FEATURE: Better documentation for contributing and releasing versions of this gem](https://github.com/fastruby/next_rails/pull/53)
 
 * [FEATURE: Added option --version to get the version of the gem being used](https://github.com/fastruby/next_rails/pull/38)

From c00f21d16766425d4b7652b3ed22a609ba16f144 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 20 Jul 2022 16:16:35 +0530
Subject: [PATCH 065/171] trigger ci run once for a pull request

---
 .github/workflows/main.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 19e4e00..018c11b 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,6 +1,12 @@
 name: Run rake task
 
-on: [push, pull_request]
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    branches:
+      - main
 
 jobs:
   test:

From 04375b996b40d2e41dc0d3f2e995c02f5ad45408 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 20 Jul 2022 16:27:32 +0530
Subject: [PATCH 066/171] update CHANGELOG with info tagged under correct
 released versions

---
 CHANGELOG.md | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 690848f..e4a1a7c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,11 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
-* [FEATURE: Try to find the latest **compatible** version of a gem if the latest version is not compatible with the desired Rails version when checking compatibility](https://github.com/fastruby/next_rails/pull/49)
 * [FEATURE: Better documentation for contributing and releasing versions of this gem](https://github.com/fastruby/next_rails/pull/53)
 
+# v1.1.0 / 2022-06-30 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.5...v1.1.0)
+
+* [FEATURE: Try to find the latest **compatible** version of a gem if the latest version is not compatible with the desired Rails version when checking compatibility](https://github.com/fastruby/next_rails/pull/49)
+
 * [FEATURE: Added option --version to get the version of the gem being used](https://github.com/fastruby/next_rails/pull/38)
 
 * [Added github action workflow](https://github.com/fastruby/next_rails/pull/40)

From c7013aa4c79fe2154e2fe6783d96b0054b3071f2 Mon Sep 17 00:00:00 2001
From: Bosco So <bosco.so@hingehealth.com>
Date: Fri, 18 Mar 2022 18:47:32 -0700
Subject: [PATCH 067/171] #34: added spec for `bundle_report outdated` to allow
 future refactoring

---
 spec/bundle_report_spec.rb | 49 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 spec/bundle_report_spec.rb

diff --git a/spec/bundle_report_spec.rb b/spec/bundle_report_spec.rb
new file mode 100644
index 0000000..ab5840d
--- /dev/null
+++ b/spec/bundle_report_spec.rb
@@ -0,0 +1,49 @@
+# frozen_string_literal: true
+
+require 'date'
+require 'tempfile'
+require_relative 'spec_helper'
+require_relative '../lib/next_rails/bundle_report'
+
+RSpec.describe NextRails::BundleReport do
+  describe '.outdated' do
+    let(:mock_version) { Struct.new(:version, :age) }
+    let(:mock_gem) { Struct.new(:name, :version, :age, :latest_version, :up_to_date?, :created_at, :sourced_from_git?) }
+    let(:format_str) { '%b %e, %Y' }
+    let(:alpha_date) { Date.parse('2022-01-01') }
+    let(:alpha_age) { alpha_date.strftime(format_str) }
+    let(:bravo_date) { Date.parse('2022-02-02') }
+    let(:bravo_age) { bravo_date.strftime(format_str) }
+    let(:charlie_date) { Date.parse('2022-03-03') }
+    let(:charlie_age) { charlie_date.strftime(format_str) }
+
+    before do
+      allow(NextRails::GemInfo).to receive(:all).and_return(
+        [
+          mock_gem.new('alpha', '0.0.1', alpha_age, mock_version.new('0.0.2', bravo_age), false, alpha_date, false),
+          mock_gem.new('bravo', '0.2.0', bravo_age, mock_version.new('0.2.2', charlie_age), false, bravo_date, true)
+        ]
+      )
+    end
+
+    context 'when writing human-readable output' do
+      subject { described_class.outdated }
+
+      it 'invokes $stdout.puts properly', :aggregate_failures do
+        allow($stdout)
+          .to receive(:puts)
+          .with("#{'alpha 0.0.1'.bold.white}: released #{alpha_age} (latest version, 0.0.2, released #{bravo_age})\n")
+        allow($stdout)
+          .to receive(:puts)
+          .with("#{'bravo 0.2.0'.bold.white}: released #{bravo_age} (latest version, 0.2.2, released #{charlie_age})\n")
+        allow($stdout).to receive(:puts).with('')
+        allow($stdout).to receive(:puts).with(<<~EO_MULTLINE_STRING)
+          #{'1'.yellow} gems are sourced from git
+          #{'2'.red} of the 2 gems are out-of-date (100%)
+        EO_MULTLINE_STRING
+
+        subject
+      end
+    end
+  end
+end

From b3437541485f675d4ce71c039738176486787182 Mon Sep 17 00:00:00 2001
From: Bosco So <bosco.so@hingehealth.com>
Date: Fri, 18 Mar 2022 19:25:45 -0700
Subject: [PATCH 068/171] #34: refactored STDOUT output portion of
 `NextRails::BundleReport.outdated` into separate class method

In preparation for add `output_to_json` method that can be called conditionally.

Passes spec written in previous commit.
---
 lib/next_rails/bundle_report.rb | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 15f2b84..7283f9c 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -98,22 +98,36 @@ def self.compatible_ruby_version(rails_version)
     def self.outdated
       gems = NextRails::GemInfo.all
       out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
-      percentage_out_of_date = ((out_of_date_gems.count / gems.count.to_f) * 100).round
       sourced_from_git = gems.select(&:sourced_from_git?)
 
-      out_of_date_gems.each do |_gem|
-        header = "#{_gem.name} #{_gem.version}"
+      output_to_io(out_of_date_gems, gems.count, sourced_from_git.count)
+    end
+
+    def self.outdated
+      gems = NextRails::GemInfo.all
+      out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
+      sourced_from_git = gems.select(&:sourced_from_git?)
+
+      output_to_stdout(out_of_date_gems, gems.count, sourced_from_git.count)
+    end
+
+    def self.output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_count)
+      out_of_date_gems.each do |gem|
+        header = "#{gem.name} #{gem.version}"
 
         puts <<~MESSAGE
-          #{header.bold.white}: released #{_gem.age} (latest version, #{_gem.latest_version.version}, released #{_gem.latest_version.age})
+          #{header.bold.white}: released #{gem.age} (latest version, #{gem.latest_version.version}, released #{gem.latest_version.age})
         MESSAGE
       end
 
-      puts ""
-      puts <<~MESSAGE
-        #{"#{sourced_from_git.count}".yellow} gems are sourced from git
-        #{"#{out_of_date_gems.length}".red} of the #{gems.count} gems are out-of-date (#{percentage_out_of_date}%)
+      percentage_out_of_date = ((out_of_date_gems.count / total_gem_count.to_f) * 100).round
+      footer = <<~MESSAGE
+        #{sourced_from_git_count.to_s.yellow} gems are sourced from git
+        #{out_of_date_gems.count.to_s.red} of the #{total_gem_count} gems are out-of-date (#{percentage_out_of_date}%)
       MESSAGE
+
+      puts ''
+      puts footer
     end
   end
 end

From 90c0afeacffb53288572715eb3027c22e7a8a322 Mon Sep 17 00:00:00 2001
From: Bosco So <bosco.so@hingehealth.com>
Date: Fri, 18 Mar 2022 19:30:56 -0700
Subject: [PATCH 069/171] #34: fix stoopid copy pasta typo

---
 lib/next_rails/bundle_report.rb | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 7283f9c..dd539b4 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -95,14 +95,6 @@ def self.compatible_ruby_version(rails_version)
       end
     end
 
-    def self.outdated
-      gems = NextRails::GemInfo.all
-      out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
-      sourced_from_git = gems.select(&:sourced_from_git?)
-
-      output_to_io(out_of_date_gems, gems.count, sourced_from_git.count)
-    end
-
     def self.outdated
       gems = NextRails::GemInfo.all
       out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)

From 90e7d2c35746bff125bf3335950840e381e2fe1a Mon Sep 17 00:00:00 2001
From: Bosco So <bosco.so@hingehealth.com>
Date: Fri, 18 Mar 2022 20:03:38 -0700
Subject: [PATCH 070/171] #34: added boolean argument to
 `NextRails::BundleReport.outdated` to conditionally output JSON

Added test-first spec to prevent regression.
---
 lib/next_rails/bundle_report.rb | 35 +++++++++++++++++++++++++++++++--
 spec/bundle_report_spec.rb      | 21 ++++++++++++++++++++
 2 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index dd539b4..dc6893d 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -95,12 +95,43 @@ def self.compatible_ruby_version(rails_version)
       end
     end
 
-    def self.outdated
+    def self.outdated(human_readable = true)
       gems = NextRails::GemInfo.all
       out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
       sourced_from_git = gems.select(&:sourced_from_git?)
 
-      output_to_stdout(out_of_date_gems, gems.count, sourced_from_git.count)
+      if human_readable
+        output_to_stdout(out_of_date_gems, gems.count, sourced_from_git.count)
+      else
+        output_to_json(out_of_date_gems, gems.count, sourced_from_git.count)
+      end
+    end
+
+    def self.output_to_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
+      obj = build_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
+      puts JSON.pretty_generate(obj)
+    end
+
+    def self.build_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
+      output = Hash.new { [] }
+      out_of_date_gems.each do |gem|
+        output[:gems] += [
+          {
+            name: gem.name,
+            installed_version: gem.version,
+            installed_age: gem.age,
+            latest_version: gem.latest_version.version,
+            latest_age: gem.latest_version.age
+          }
+        ]
+      end
+
+      output.merge(
+        {
+          sourced_from_git_count: sourced_from_git_count,
+          total_gem_count: total_gem_count
+        }
+      )
     end
 
     def self.output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_count)
diff --git a/spec/bundle_report_spec.rb b/spec/bundle_report_spec.rb
index ab5840d..e5beb87 100644
--- a/spec/bundle_report_spec.rb
+++ b/spec/bundle_report_spec.rb
@@ -45,5 +45,26 @@
         subject
       end
     end
+
+    context 'when writing JSON output' do
+      it 'JSON is correctly formatted' do
+        gems = NextRails::GemInfo.all
+        out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
+        sourced_from_git = gems.select(&:sourced_from_git?)
+
+        expect(NextRails::BundleReport.build_json(out_of_date_gems, gems.count, sourced_from_git.count)).to eq(
+          {
+            gems: [
+              { name: 'alpha', installed_version: '0.0.1', installed_age: alpha_age, latest_version: '0.0.2',
+                latest_age: bravo_age },
+              { name: 'bravo', installed_version: '0.2.0', installed_age: bravo_age, latest_version: '0.2.2',
+                latest_age: charlie_age }
+            ],
+            sourced_from_git_count: sourced_from_git.count,
+            total_gem_count: gems.count
+          }
+        )
+      end
+    end
   end
 end

From 080868925d74ea4495992b878766e4ad77666058 Mon Sep 17 00:00:00 2001
From: Bosco So <bosco.so@hingehealth.com>
Date: Fri, 18 Mar 2022 20:14:18 -0700
Subject: [PATCH 071/171] #34: connected CLI option parsing to
 `NextRails::BundleReport.outdated`

Also inverted boolean arg to make the conditionally easier to reason (no double negatives).
---
 exe/bundle_report               |  7 ++++++-
 lib/next_rails/bundle_report.rb | 10 +++++-----
 spec/bundle_report_spec.rb      |  4 ++--
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/exe/bundle_report b/exe/bundle_report
index cf702b5..ae0ba1f 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -17,6 +17,7 @@ at_exit do
       Examples:
         #{$0} compatibility --rails-version 5.0
         #{$0} outdated
+        #{$0} outdated --json
 
       ruby_check To find a compatible ruby version for the target rails version
 
@@ -36,6 +37,10 @@ at_exit do
       options[:include_rails_gems] = true
     end
 
+    opts.on("--json", "Output JSON in outdated report (defaults to false)") do
+      options[:json] = true
+    end
+
     opts.on_tail("-h", "--help", "Show this message") do
       puts opts
       exit
@@ -54,7 +59,7 @@ at_exit do
 
   case report_type
   when "ruby_check" then NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
-  when "outdated" then NextRails::BundleReport.outdated
+  when "outdated" then NextRails::BundleReport.outdated(options.fetch(:json, false))
   else
     NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
   end
diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index dc6893d..13bcb98 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -95,15 +95,15 @@ def self.compatible_ruby_version(rails_version)
       end
     end
 
-    def self.outdated(human_readable = true)
+    def self.outdated(output_in_json)
       gems = NextRails::GemInfo.all
       out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
       sourced_from_git = gems.select(&:sourced_from_git?)
 
-      if human_readable
-        output_to_stdout(out_of_date_gems, gems.count, sourced_from_git.count)
-      else
+      if output_in_json
         output_to_json(out_of_date_gems, gems.count, sourced_from_git.count)
+      else
+        output_to_stdout(out_of_date_gems, gems.count, sourced_from_git.count)
       end
     end
 
@@ -115,7 +115,7 @@ def self.output_to_json(out_of_date_gems, total_gem_count, sourced_from_git_coun
     def self.build_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
       output = Hash.new { [] }
       out_of_date_gems.each do |gem|
-        output[:gems] += [
+        output[:outdated_gems] += [
           {
             name: gem.name,
             installed_version: gem.version,
diff --git a/spec/bundle_report_spec.rb b/spec/bundle_report_spec.rb
index e5beb87..af7ee8d 100644
--- a/spec/bundle_report_spec.rb
+++ b/spec/bundle_report_spec.rb
@@ -27,7 +27,7 @@
     end
 
     context 'when writing human-readable output' do
-      subject { described_class.outdated }
+      subject { described_class.outdated(false) }
 
       it 'invokes $stdout.puts properly', :aggregate_failures do
         allow($stdout)
@@ -54,7 +54,7 @@
 
         expect(NextRails::BundleReport.build_json(out_of_date_gems, gems.count, sourced_from_git.count)).to eq(
           {
-            gems: [
+            outdated_gems: [
               { name: 'alpha', installed_version: '0.0.1', installed_age: alpha_age, latest_version: '0.0.2',
                 latest_age: bravo_age },
               { name: 'bravo', installed_version: '0.2.0', installed_age: bravo_age, latest_version: '0.2.2',

From ff81b23da1955d4767d2bcc59622274bfd08164a Mon Sep 17 00:00:00 2001
From: Bosco So <bosco.so@hingehealth.com>
Date: Fri, 18 Mar 2022 20:37:22 -0700
Subject: [PATCH 072/171] #34: last minor text changes before PR

---
 CHANGELOG.md | 1 +
 README.md    | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e4a1a7c..6c82f3a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,7 @@
 * [FEATURE: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock](https://github.com/fastruby/next_rails/pull/25)
 * [FEATURE: Drop `actionview` dependency because it is not really used](https://github.com/fastruby/next_rails/pull/26)
 * [BUGFIX: If shitlist path does not exist, create it for the user of the gem](https://github.com/fastruby/next_rails/pull/37)
+* [FEATURE: `bundle_report outdated` outputs in JSON format when passed optional argument](https://github.com/fastruby/next_rails/pull/33)
 
 # v1.0.4 / 2021-04-09 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.3...v1.0.4)
 
diff --git a/README.md b/README.md
index 17c7fa7..b7e7d44 100644
--- a/README.md
+++ b/README.md
@@ -29,10 +29,17 @@ Learn about your Gemfile and see what needs updating.
 ```bash
 # Show all out-of-date gems
 bundle_report outdated
+
 # Show five oldest, out-of-date gems
 bundle_report outdated | head -n 5
+
+# Show all out-of-date gems in machine readable JSON format
+bundle_report outdated --json
+
 # Show gems that don't work with Rails 5.2.0
 bundle_report compatibility --rails-version=5.2.0
+
+# Show the usual help message
 bundle_report --help
 # Find minimum compatible ruby version with Rails 7.0.0
 bundle_report ruby_check --rails-version=7.0.0

From 8bad8af3f4a98751c81e6e952b531db1d33cb01a Mon Sep 17 00:00:00 2001
From: Bosco So <bosco.so@hingehealth.com>
Date: Fri, 18 Mar 2022 20:47:07 -0700
Subject: [PATCH 073/171] #34: linking to the correct PR URL. Dooh!

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6c82f3a..0d3d99e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
 * [FEATURE: Better documentation for contributing and releasing versions of this gem](https://github.com/fastruby/next_rails/pull/53)
+* [FEATURE: `bundle_report outdated` outputs in JSON format when passed optional argument](https://github.com/fastruby/next_rails/pull/35)
 
 # v1.1.0 / 2022-06-30 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.5...v1.1.0)
 
@@ -28,7 +29,6 @@
 * [FEATURE: Initialize the Gemfile.next.lock to avoid major version jumps when used without an initial Gemfile.next.lock](https://github.com/fastruby/next_rails/pull/25)
 * [FEATURE: Drop `actionview` dependency because it is not really used](https://github.com/fastruby/next_rails/pull/26)
 * [BUGFIX: If shitlist path does not exist, create it for the user of the gem](https://github.com/fastruby/next_rails/pull/37)
-* [FEATURE: `bundle_report outdated` outputs in JSON format when passed optional argument](https://github.com/fastruby/next_rails/pull/33)
 
 # v1.0.4 / 2021-04-09 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.3...v1.0.4)
 

From 8845b135f744dad01dd9d9a7c2cfa2e9595df91c Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 27 Jul 2022 14:02:56 +0530
Subject: [PATCH 074/171] updated as per review and spec

---
 exe/bundle_report               | 4 ++--
 lib/next_rails/bundle_report.rb | 4 ++--
 spec/bundle_report_spec.rb      | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/exe/bundle_report b/exe/bundle_report
index ae0ba1f..8408433 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -38,7 +38,7 @@ at_exit do
     end
 
     opts.on("--json", "Output JSON in outdated report (defaults to false)") do
-      options[:json] = true
+      options[:format] = 'json'
     end
 
     opts.on_tail("-h", "--help", "Show this message") do
@@ -59,7 +59,7 @@ at_exit do
 
   case report_type
   when "ruby_check" then NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
-  when "outdated" then NextRails::BundleReport.outdated(options.fetch(:json, false))
+  when "outdated" then NextRails::BundleReport.outdated(options.fetch(:format, nil))
   else
     NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
   end
diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 13bcb98..255666f 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -95,12 +95,12 @@ def self.compatible_ruby_version(rails_version)
       end
     end
 
-    def self.outdated(output_in_json)
+    def self.outdated(format = nil)
       gems = NextRails::GemInfo.all
       out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
       sourced_from_git = gems.select(&:sourced_from_git?)
 
-      if output_in_json
+      if format == 'json'
         output_to_json(out_of_date_gems, gems.count, sourced_from_git.count)
       else
         output_to_stdout(out_of_date_gems, gems.count, sourced_from_git.count)
diff --git a/spec/bundle_report_spec.rb b/spec/bundle_report_spec.rb
index af7ee8d..e3ea52f 100644
--- a/spec/bundle_report_spec.rb
+++ b/spec/bundle_report_spec.rb
@@ -27,7 +27,7 @@
     end
 
     context 'when writing human-readable output' do
-      subject { described_class.outdated(false) }
+      subject { described_class.outdated }
 
       it 'invokes $stdout.puts properly', :aggregate_failures do
         allow($stdout)

From 1f999d23de8d7d2232b0a5f8ef66eb719a8d7c43 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 27 Jul 2022 14:10:59 +0530
Subject: [PATCH 075/171] updated latest PR to changelog

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0d3d99e..2ca6677 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,7 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
 * [FEATURE: Better documentation for contributing and releasing versions of this gem](https://github.com/fastruby/next_rails/pull/53)
-* [FEATURE: `bundle_report outdated` outputs in JSON format when passed optional argument](https://github.com/fastruby/next_rails/pull/35)
+* [FEATURE: `bundle_report outdated` outputs in JSON format when passed optional argument](https://github.com/fastruby/next_rails/pull/61)
 
 # v1.1.0 / 2022-06-30 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.5...v1.1.0)
 

From b70b9f1505903b7d255f694adf08f469b48d8323 Mon Sep 17 00:00:00 2001
From: Dennis Khan <khandennis@gmail.com>
Date: Thu, 28 Jul 2022 16:54:17 -0400
Subject: [PATCH 076/171] Fix for up_to_date? method

`bundle_report outdated` is currently failing with "undefined local variable or method `latest_version'".
We need to define latest_version method to filter out up-to-date gems.
---
 lib/next_rails/gem_info.rb            | 9 +++++++++
 spec/ten_years_rails/gem_info_spec.rb | 8 ++++++++
 2 files changed, 17 insertions(+)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index dc8b9f2..8c2453b 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -88,6 +88,15 @@ def state(rails_version)
       end
     end
 
+    def latest_version
+      latest_gem_specification = Gem.latest_spec_for(name)
+      return NullGemInfo.new unless latest_gem_specification
+
+      GemInfo.new(latest_gem_specification)
+    rescue
+      NullGemInfo.new
+    end
+
     def compatible_with_rails?(rails_version:)
       unsatisfied_rails_dependencies(rails_version: rails_version).empty?
     end
diff --git a/spec/ten_years_rails/gem_info_spec.rb b/spec/ten_years_rails/gem_info_spec.rb
index f0cbfa8..77970d0 100644
--- a/spec/ten_years_rails/gem_info_spec.rb
+++ b/spec/ten_years_rails/gem_info_spec.rb
@@ -7,6 +7,7 @@
   let(:spec) do
     Gem::Specification.new do |s|
       s.date = release_date
+      s.version = "1.0.0"
     end
   end
 
@@ -25,4 +26,11 @@
       expect(subject.age).to eq(result)
     end
   end
+
+  describe "#up_to_date?" do
+    it "is up to date" do
+      allow(Gem).to receive(:latest_spec_for).and_return(spec)
+      expect(subject.up_to_date?).to be_truthy
+    end
+  end
 end

From 0bdde67a83d5e3ec9db87e024ce9afc3a8838466 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Tue, 9 Aug 2022 14:39:45 -0400
Subject: [PATCH 077/171] SimpleCov must be loaded as the very first thing

If not, coverage reporting and calculation will be inaccurate. This is a known gotcha with SimpleCov.

Fixes https://github.com/fastruby/next_rails/issues/65

Added entry to the CHANGELOG doc
---
 CHANGELOG.md        |  1 +
 spec/spec_helper.rb | 11 ++++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e4a1a7c..286f8a2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.0.4...main)
 
+* [BUGFIX: SimpleCov was not reporting accurately due to a bug in the spec helper code](https://github.com/fastruby/next_rails/pull/66)
 * [FEATURE: Better documentation for contributing and releasing versions of this gem](https://github.com/fastruby/next_rails/pull/53)
 
 # v1.1.0 / 2022-06-30 [(commits)](https://github.com/fastruby/next_rails/compare/v1.0.5...v1.1.0)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 2f42824..e56af3c 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,8 +1,3 @@
-require "bundler/setup"
-require "next_rails"
-
-require 'webmock/rspec'
-WebMock.disable_net_connect!(allow_localhost: true)
 
 if ENV['COVERAGE'] == 'true'
   require 'simplecov'
@@ -23,6 +18,12 @@
   end
 end
 
+require "bundler/setup"
+require "next_rails"
+
+require 'webmock/rspec'
+WebMock.disable_net_connect!(allow_localhost: true)
+
 RSpec.configure do |config|
   # Enable flags like --only-failures and --next-failure
   config.example_status_persistence_file_path = ".rspec_status"

From c1d717df95ce10c6947b1d5b154c24a0c2db1eb5 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Wed, 10 Aug 2022 10:17:16 -0300
Subject: [PATCH 078/171] Limit version of webmock on tests

---
 next_rails.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 02a0c77..09f4c60 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
   spec.add_development_dependency "rexml", "3.1.7.3" # limited on purpose, new versions don't work with old rubies
-  spec.add_development_dependency "webmock"
+  spec.add_development_dependency "webmock", "3.14.0" # limited on purpose, new versions don't work with old rubies
 end

From a79a05a3e74df4c813f0728202d72298cb832c00 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 11 Aug 2022 20:44:06 +0000
Subject: [PATCH 079/171] Update webmock requirement from = 3.14.0 to = 3.16.2

Updates the requirements on [webmock](https://github.com/bblimke/webmock) to permit the latest version.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.14.0...v3.16.2)

---
updated-dependencies:
- dependency-name: webmock
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
---
 next_rails.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 09f4c60..75f3e72 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
   spec.add_development_dependency "rexml", "3.1.7.3" # limited on purpose, new versions don't work with old rubies
-  spec.add_development_dependency "webmock", "3.14.0" # limited on purpose, new versions don't work with old rubies
+  spec.add_development_dependency "webmock", "3.16.2" # limited on purpose, new versions don't work with old rubies
 end

From f534dff96eea533e41ec7c00dfaa0f2009dad12b Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Fri, 12 Aug 2022 16:32:42 +0530
Subject: [PATCH 080/171] Release v1.2.0

---
 CHANGELOG.md              | 4 +++-
 lib/next_rails/version.rb | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 813d620..771feb0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,6 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.1.0...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.0...main)
+
+# v1.2.0 / 2022-08-12 [(commits)](https://github.com/fastruby/next_rails/compare/v1.1.0...v1.2.0)
 
 - [FEATURE: Support Ruby versions as old as Ruby 2.0](https://github.com/fastruby/next_rails/pull/54)
 
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index 5bb07dc..eba3796 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,3 +1,3 @@
 module NextRails
-  VERSION = "1.1.0"
+  VERSION = "1.2.0"
 end

From 3e930fb8cf70f3d8b7568389f2339f2b31a14bc7 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Tue, 16 Aug 2022 18:05:17 +0530
Subject: [PATCH 081/171] fixed spec failure after main merge

---
 lib/next_rails/bundle_report.rb | 2 +-
 spec/bundle_report_spec.rb      | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index b211501..5b88bb2 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -153,4 +153,4 @@ def self.output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_co
       puts footer
     end
   end
-end
+end
\ No newline at end of file
diff --git a/spec/bundle_report_spec.rb b/spec/bundle_report_spec.rb
index e3ea52f..0aa92a6 100644
--- a/spec/bundle_report_spec.rb
+++ b/spec/bundle_report_spec.rb
@@ -27,7 +27,7 @@
     end
 
     context 'when writing human-readable output' do
-      subject { described_class.outdated }
+      #subject { described_class.outdated }
 
       it 'invokes $stdout.puts properly', :aggregate_failures do
         allow($stdout)
@@ -41,8 +41,6 @@
           #{'1'.yellow} gems are sourced from git
           #{'2'.red} of the 2 gems are out-of-date (100%)
         EO_MULTLINE_STRING
-
-        subject
       end
     end
 

From e3de8d6a2f4cd777741a2d8a87190116cc7bd14c Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Tue, 16 Aug 2022 18:07:16 +0530
Subject: [PATCH 082/171] replaced the squibble with dash

---
 spec/bundle_report_spec.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spec/bundle_report_spec.rb b/spec/bundle_report_spec.rb
index 0aa92a6..325d986 100644
--- a/spec/bundle_report_spec.rb
+++ b/spec/bundle_report_spec.rb
@@ -37,7 +37,7 @@
           .to receive(:puts)
           .with("#{'bravo 0.2.0'.bold.white}: released #{bravo_age} (latest version, 0.2.2, released #{charlie_age})\n")
         allow($stdout).to receive(:puts).with('')
-        allow($stdout).to receive(:puts).with(<<~EO_MULTLINE_STRING)
+        allow($stdout).to receive(:puts).with(<<-EO_MULTLINE_STRING)
           #{'1'.yellow} gems are sourced from git
           #{'2'.red} of the 2 gems are out-of-date (100%)
         EO_MULTLINE_STRING

From d965fbbfd6016d47a9d5fa0dbfb877a80fc28185 Mon Sep 17 00:00:00 2001
From: Dennis Khan <khandennis@gmail.com>
Date: Wed, 21 Sep 2022 13:18:34 -0400
Subject: [PATCH 083/171] resolve conflicts

---
 lib/next_rails/gem_info.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index 8c2453b..3c86973 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -97,7 +97,7 @@ def latest_version
       NullGemInfo.new
     end
 
-    def compatible_with_rails?(rails_version:)
+    def compatible_with_rails?(rails_version: nil)
       unsatisfied_rails_dependencies(rails_version: rails_version).empty?
     end
 

From f8d4d4726b7b57f465cc79ee5f89e5d629f7a923 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Thu, 22 Sep 2022 08:33:57 +0530
Subject: [PATCH 084/171] updated CHANGELOG for next release

---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4be15ae..e2028bc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@
 
 - [FEATURE: Better documentation for contributing and releasing versions of this gem](https://github.com/fastruby/next_rails/pull/53)
 
+- [BUGFIX: bundle_report outdated was giving an exception due to missing method latest_version](https://github.com/fastruby/next_rails/pull/62)
+
 # v1.2.0 / 2022-08-12 [(commits)](https://github.com/fastruby/next_rails/compare/v1.1.0...v1.2.0)
 
 - [FEATURE: Support Ruby versions as old as Ruby 2.0](https://github.com/fastruby/next_rails/pull/54)

From 638e86e80dc541aa502b0aa7a069cbd387cf13d4 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Mon, 26 Sep 2022 17:09:15 +0530
Subject: [PATCH 085/171] release 1.2.1

---
 CHANGELOG.md              | 4 +++-
 lib/next_rails/version.rb | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e2028bc..64f5c1b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,6 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.0...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.1...main)
+
+# v1.2.1 / 2022-09-26 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.0...v1.2.1)
 
 - [BUGFIX: SimpleCov was not reporting accurately due to a bug in the spec helper code](https://github.com/fastruby/next_rails/pull/66)
 
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index eba3796..b822245 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,3 +1,3 @@
 module NextRails
-  VERSION = "1.2.0"
+  VERSION = "1.2.1"
 end

From 39e647b707fa03e94f5a7d9ca4e7f23bb211708b Mon Sep 17 00:00:00 2001
From: Mateus Pereira <mateus@ombulabs.com>
Date: Mon, 26 Sep 2022 22:39:27 -0300
Subject: [PATCH 086/171] [OSS-64] Add templates for bug report, feature
 request and pull request (#64)

* Add templates for bug report, feature request and pull request

* Add entry to `CHANGELOG.md`
---
 .github/ISSUE_TEMPLATE/bug_report.md      | 56 +++++++++--------------
 .github/ISSUE_TEMPLATE/feature_request.md | 37 ++++-----------
 CHANGELOG.md                              |  1 +
 pull_request_template.md                  | 16 +++++--
 4 files changed, 43 insertions(+), 67 deletions(-)

diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 58f4848..e09dcdd 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -6,46 +6,32 @@ labels: bug
 assignees: ""
 ---
 
-**IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.**
+<!--- Before creating a bug report, please, answer the following questions -->
+<!--- Did you check the documentation for answers? -->
+<!--- Did you make sure that this bug has not already been reported? -->
 
-**Before we start...:**
+## Expected Behavior
+<!--- Tell us what should happen -->
+<!--- For example: When I [do X], it should [produce Y] -->
 
-- [ ] I checked the documentation and found no answer
-- [ ] I checked to make sure that this issue has not already been filed
-- [ ] I'm reporting the issue to the correct repository (for multi-repository projects)
+## Actual Behavior
+<!--- Tell us what happens instead -->
+<!--- For example: When I [did X], it [produced Y] -->
 
-**Version, Branch, or Commit:**
+## Possible Fix
+<!--- Optionally suggest a fix or work around -->
 
-What branch/commit/version of "next_rails" you are using?
+## To Reproduce
+<!--- Optionally provide a link to a live example -->
 
-**Expected behavior:**
+<!--- Otherwise, please provide a set of reproduction steps -->
+1.
+2.
+3.
+4.
 
-Please include a detailed description of the behavior you were expecting when you encountered this issue.
-
-**Actual behavior:**
-
-Please include a detailed description of the actual behavior of the application.
-
-**Steps to reproduce:**
-
-How do I achieve this behavior? Use the following format to provide a step-by-step guide:
-
-1. Step 1: ...
-2. Step 2: ...
-
-**Context and environment:**
-
-Provide any relevant information about your setup (Customize the list accordingly based on what info is relevant to this project)
-
-1. Version of the software the issue is being opened for.
-2. Operating System
-3. Operating System version
-4. Ruby version
-
-_Delete any information that is not relevant._
-
-**Logs**
-
-Include relevant log snippets or files here.
+## Additional Information
+<!--- Include any relevant details about your environment (branch, browser, OS) -->
+<!--- and the bug (screenshots, logs, etc) -->
 
 **I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md)**
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index 5bde9f1..51442ac 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -6,35 +6,18 @@ labels: enhancement
 assignees: ""
 ---
 
-**IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.**
+<!--- Before creating a feature request, please, answer the following questions -->
+<!--- Did you check the documentation for this feature? -->
+<!--- Did you make sure that this feature has not already been requested? -->
 
-**Before we start...:**
+## Description
+<!--- Provide a description of the change or addition you are proposing -->
 
-- [ ] I checked the documentation and didn't find this feature
-- [ ] I checked to make sure that this feature has not already been requested
+## Possible Implementation
+<!--- Optionally suggest an idea to implement or a workaround to fix the issue -->
 
-**Branch/Commit:**
-
-Inform what branch/commit/version of "next_rails" you are using.
-
-**Describe the feature:**
-
-Please include a detailed description of the feature you are requesting and any detail on it’s expected behavior.
-
-> **As a \<role name\>** > **I do \<something\>** > **And then I do \<another action\>** > **And I see \<some result\>**
-
-**Problem:**
-
-Please include a detailed description of the problem this feature would solve.
-
-> **As a \<role name\>** > **I want to \<do something\>** > **So that I can achieve a \<goal\>**
-
-**Mockups:**
-
-Include any mockup idea related to the requested feature if it applies.
-
-**Resources:**
-
-If you have resources related to the implementation or research for this feature, add them here.
+## Resources:
+<!--- If you have resources related to the implementation or research for this feature, add them here. -->
+<!--- If possible, include any mockup ideas related to the requested feature. -->
 
 **I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md)**
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 64f5c1b..91bf8a3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.1...main)
+* [CHORE: Added updated templates for bug fixes, feature requests and pull requests](https://github.com/fastruby/next_rails/pull/64) as per [this RFC](https://github.com/fastruby/RFCs/blob/main/2021-10-13-github-templates.md)
 
 # v1.2.1 / 2022-09-26 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.0...v1.2.1)
 
diff --git a/pull_request_template.md b/pull_request_template.md
index d3cf4ee..83dfcff 100644
--- a/pull_request_template.md
+++ b/pull_request_template.md
@@ -1,9 +1,15 @@
-**IMPORTANT**: Please read the README before submitting pull requests for this project. Additionally, if your PR closes any open GitHub issues, make sure you include Closes #XXXX in your comment or use the option on the PR's sidebar to add related issues to auto-close the issue that your PR fixes.
+## Description
+<!--- Describe your changes in detail -->
 
-- [ ] Add an entry to `CHANGELOG.md` that links to this PR under the "main (unreleased)" heading.
+## Motivation and Context
+<!--- Why is this change required? What problem does it solve? -->
+<!--- If it fixes an open issue, please link to the issue here. -->
 
-Description:
+## How Has This Been Tested?
+<!--- Include any relevant details about your testing environment and the steps you followed -->
+<!--- For example: I am using [Safari|Firefox|Chrome] then I visit [the users path] -->
 
-Please include a summary of the change and which issue is fixed or which feature is introduced. If changes to the behavior are made, clearly describe what changes.
+## Screenshots:
+<!-- Add screenshots (applicable to any UI changes) -->
 
-I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md).
+**I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md)**

From 0866aa655371782bbc421f236db980f7f83e0f24 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 28 Oct 2022 08:36:21 -0400
Subject: [PATCH 087/171] Implement changes submitted in #63

---
 lib/next_rails/bundle_report.rb | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 5b88bb2..3c1e99b 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -5,8 +5,10 @@
 require "net/http"
 
 module NextRails
-  class BundleReport
-    def self.compatibility(rails_version: nil, include_rails_gems: nil)
+  module BundleReport
+    extend self
+
+    def compatibility(rails_version: nil, include_rails_gems: nil)
       incompatible_gems = NextRails::GemInfo.all.reject do |gem|
         gem.compatible_with_rails?(rails_version: rails_version) || (!include_rails_gems && gem.from_rails?)
       end.sort_by { |gem| gem.name }
@@ -50,13 +52,13 @@ def self.compatibility(rails_version: nil, include_rails_gems: nil)
       puts ERB.new(template, nil, "-").result(binding)
     end
 
-    def self.gem_header(_gem)
+    def gem_header(_gem)
       header = "#{_gem.name} #{_gem.version}".bold
       header << " (loaded from git)".magenta if _gem.sourced_from_git?
       header
     end
 
-    def self.compatible_ruby_version(rails_version)
+    def compatible_ruby_version(rails_version)
       # find all the versions of rails gem
       uri = URI('https://rubygems.org/api/v1/versions/rails.json')
       res = Net::HTTP.get_response(uri)
@@ -95,7 +97,7 @@ def self.compatible_ruby_version(rails_version)
       end
     end
 
-    def self.outdated(format = nil)
+    def outdated(format = nil)
       gems = NextRails::GemInfo.all
       out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
       sourced_from_git = gems.select(&:sourced_from_git?)
@@ -107,12 +109,12 @@ def self.outdated(format = nil)
       end
     end
 
-    def self.output_to_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
+    def output_to_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
       obj = build_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
       puts JSON.pretty_generate(obj)
     end
 
-    def self.build_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
+    def build_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
       output = Hash.new { [] }
       out_of_date_gems.each do |gem|
         output[:outdated_gems] += [
@@ -134,7 +136,7 @@ def self.build_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
       )
     end
 
-    def self.output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_count)
+    def output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_count)
       out_of_date_gems.each do |gem|
         header = "#{gem.name} #{gem.version}"
 

From 92dd6124f1221ce1d115945feda12d05dc4dc94c Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 28 Oct 2022 08:39:11 -0400
Subject: [PATCH 088/171] Added a mention of PR #63

---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e3ab5d1..afe0303 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.1...main)
 * [CHORE: Added updated templates for bug fixes, feature requests and pull requests](https://github.com/fastruby/next_rails/pull/64) as per [this RFC](https://github.com/fastruby/RFCs/blob/main/2021-10-13-github-templates.md)
+* [FEATURE: Turn BundleReport into a module](https://github.com/fastruby/next_rails/pull/63)
 
 # v1.2.1 / 2022-09-26 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.0...v1.2.1)
 

From 395585ea7436f7cc8fc8c72892f9512bdd25ec27 Mon Sep 17 00:00:00 2001
From: Sean Dickinson <sean@bythepixel.com>
Date: Fri, 9 Dec 2022 15:18:07 -0500
Subject: [PATCH 089/171] tests: capture error

---
 spec/next_rails/gem_info_spec.rb | 36 ++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 spec/next_rails/gem_info_spec.rb

diff --git a/spec/next_rails/gem_info_spec.rb b/spec/next_rails/gem_info_spec.rb
new file mode 100644
index 0000000..439c062
--- /dev/null
+++ b/spec/next_rails/gem_info_spec.rb
@@ -0,0 +1,36 @@
+require_relative ".././spec_helper"
+require_relative "../../lib/next_rails/gem_info"
+
+RSpec.describe NextRails::GemInfo do
+  describe "#state" do
+    let(:mock_gem) { Struct.new(:name, :version, :runtime_dependencies) }
+    let(:mocked_dependency) { Struct.new(:name, :requirement) }
+    it "returns :incompatible if gem specifies a rails dependency but no compatible version is found" do
+
+      mocked_dependency_requirement = double("requirement")
+      allow(mocked_dependency_requirement).to receive(:satisfied_by?).and_return(false)
+      runtime_deps = [mocked_dependency.new("rails", mocked_dependency_requirement)]
+      incompatible_gem = mock_gem.new('incompatible', '0.0.1', runtime_deps)
+      rails_version = "7.0.0"
+      gem_info = NextRails::GemInfo.new(incompatible_gem)
+
+      expect(gem_info.state(rails_version)).to eq(:incompatible)
+    end
+
+  end
+
+  describe "#find_latest_compatible" do
+    let(:mock_gem) { Struct.new(:name, :version) }
+    it "sets latest_compatible_version to NullGem if no specs are found" do
+      fetcher_double = double("spec_fetcher")
+      allow(fetcher_double).to receive(:available_specs).and_return([[],[]])
+      allow(Gem::SpecFetcher).to receive(:new).and_return(fetcher_double)
+      gem = mock_gem.new('gem_name', "0.0.1")
+
+      gem_info = NextRails::GemInfo.new(gem)
+      gem_info.find_latest_compatible
+      expect(gem_info.latest_compatible_version).to be_a(NextRails::GemInfo::NullGemInfo)
+    end
+
+  end
+end
\ No newline at end of file

From d2fc51344889c2d38b27f01f66d85831c43a1407 Mon Sep 17 00:00:00 2001
From: Sean Dickinson <sean@bythepixel.com>
Date: Fri, 9 Dec 2022 15:18:36 -0500
Subject: [PATCH 090/171] feat: safe access

---
 lib/next_rails/gem_info.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index fe548a6..3e62c63 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -79,7 +79,7 @@ def from_rails?
     def state(rails_version)
       if compatible_with_rails?(rails_version: rails_version)
         :compatible
-      elsif latest_compatible_version.version == "NOT FOUND"
+      elsif latest_compatible_version&.version == "NOT FOUND"
         :no_new_version
       elsif latest_compatible_version
         :found_compatible

From 21bcc2a0fac8930924c46d3b6aa26518cff8860a Mon Sep 17 00:00:00 2001
From: Sean Dickinson <sean@bythepixel.com>
Date: Tue, 13 Dec 2022 08:39:33 -0500
Subject: [PATCH 091/171] fix: add another spec

---
 spec/next_rails/gem_info_spec.rb | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/spec/next_rails/gem_info_spec.rb b/spec/next_rails/gem_info_spec.rb
index 439c062..169d96e 100644
--- a/spec/next_rails/gem_info_spec.rb
+++ b/spec/next_rails/gem_info_spec.rb
@@ -6,26 +6,48 @@
     let(:mock_gem) { Struct.new(:name, :version, :runtime_dependencies) }
     let(:mocked_dependency) { Struct.new(:name, :requirement) }
     it "returns :incompatible if gem specifies a rails dependency but no compatible version is found" do
-
+      # set up a mock gem with with a rails dependency that is unsatisfied by the version given
       mocked_dependency_requirement = double("requirement")
       allow(mocked_dependency_requirement).to receive(:satisfied_by?).and_return(false)
       runtime_deps = [mocked_dependency.new("rails", mocked_dependency_requirement)]
       incompatible_gem = mock_gem.new('incompatible', '0.0.1', runtime_deps)
+
       rails_version = "7.0.0"
       gem_info = NextRails::GemInfo.new(incompatible_gem)
 
       expect(gem_info.state(rails_version)).to eq(:incompatible)
     end
 
+    it "returns :no_new_version if a gem specifies an unsatisfied rails dependency and no other specs are returned" do
+      # set up a mock gem with with a rails dependency that is unsatisfied by the version given
+      mocked_dependency_requirement = double("requirement")
+      allow(mocked_dependency_requirement).to receive(:satisfied_by?).and_return(false)
+      runtime_deps = [mocked_dependency.new("rails", mocked_dependency_requirement)]
+      incompatible_gem = mock_gem.new('incompatible', '0.0.1', runtime_deps)
+
+      # 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)
+
+      rails_version = "7.0.0"
+      gem_info = NextRails::GemInfo.new(incompatible_gem)
+      gem_info.find_latest_compatible
+
+      expect(gem_info.state(rails_version)).to eq(:no_new_version)
+    end
+
   end
 
   describe "#find_latest_compatible" do
     let(:mock_gem) { Struct.new(:name, :version) }
     it "sets latest_compatible_version to NullGem if no specs are found" do
+      gem = mock_gem.new('gem_name', "0.0.1")
+
+      # 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)
-      gem = mock_gem.new('gem_name', "0.0.1")
 
       gem_info = NextRails::GemInfo.new(gem)
       gem_info.find_latest_compatible

From 977d663607c360c093298ecef4038f9b10c519f5 Mon Sep 17 00:00:00 2001
From: Sean Dickinson <sean@bythepixel.com>
Date: Tue, 13 Dec 2022 08:40:04 -0500
Subject: [PATCH 092/171] fix: don't use safe access operator

- needs to compile with older versions of ruby
---
 lib/next_rails/gem_info.rb | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index 3e62c63..4510305 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -77,14 +77,14 @@ def from_rails?
     end
 
     def state(rails_version)
-      if compatible_with_rails?(rails_version: rails_version)
-        :compatible
-      elsif latest_compatible_version&.version == "NOT FOUND"
+      return :compatible if compatible_with_rails?(rails_version: rails_version)
+
+      if latest_compatible_version.nil?
+        :incompatible
+      elsif latest_compatible_version.version == "NOT FOUND"
         :no_new_version
-      elsif latest_compatible_version
-        :found_compatible
       else
-        :incompatible
+        :found_compatible
       end
     end
 

From 670265f84ad040fdd09c47b67453d762ecf71fb0 Mon Sep 17 00:00:00 2001
From: Sean Dickinson <sean@bythepixel.com>
Date: Tue, 13 Dec 2022 09:11:32 -0500
Subject: [PATCH 093/171] fix: maintain conditional shape

---
 lib/next_rails/gem_info.rb | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index 4510305..8cc801b 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -77,14 +77,14 @@ def from_rails?
     end
 
     def state(rails_version)
-      return :compatible if compatible_with_rails?(rails_version: rails_version)
-
-      if latest_compatible_version.nil?
-        :incompatible
-      elsif latest_compatible_version.version == "NOT FOUND"
+      if compatible_with_rails?(rails_version: rails_version)
+        :compatible
+      elsif latest_compatible_version && latest_compatible_version.version == "NOT FOUND"
         :no_new_version
-      else
+      elsif latest_compatible_version
         :found_compatible
+      else
+        :incompatible
       end
     end
 

From fae0b62538c6f54bb2f7a34e6fb0b54605752d18 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 4 Jan 2023 19:22:48 +0530
Subject: [PATCH 094/171] doc update

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index b7e7d44..c36dd48 100644
--- a/README.md
+++ b/README.md
@@ -122,7 +122,7 @@ next rails s        # Start server using Gemfile.next
 
 ## Installation
 
-Add this line to your application's Gemfile:
+Add this line to your application's Gemfile (if you add this gem to a group, make sure it is the test env group):
 
 ```ruby
 gem 'next_rails'

From da49b5b6b15b8b33ba6c55d57b8654c6697fe650 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Mon, 23 Jan 2023 16:37:07 +0530
Subject: [PATCH 095/171] updated doc

---
 README.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index c36dd48..cfa6022 100644
--- a/README.md
+++ b/README.md
@@ -122,7 +122,9 @@ next rails s        # Start server using Gemfile.next
 
 ## Installation
 
-Add this line to your application's Gemfile (if you add this gem to a group, make sure it is the test env group):
+Add this line to your application's Gemfile
+
+> NOTE: If you add this gem to a group, make sure it is the test env group
 
 ```ruby
 gem 'next_rails'

From 53308547f3c4abb6360ad409efdaa28bacf034c0 Mon Sep 17 00:00:00 2001
From: Mateus Pereira <mateusdeap@gmail.com>
Date: Mon, 6 Feb 2023 10:41:22 -0300
Subject: [PATCH 096/171] Add test case to capture issue

---
 spec/deprecation_tracker_spec.rb | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/spec/deprecation_tracker_spec.rb b/spec/deprecation_tracker_spec.rb
index 7f49c42..e017c0c 100644
--- a/spec/deprecation_tracker_spec.rb
+++ b/spec/deprecation_tracker_spec.rb
@@ -2,6 +2,8 @@
 require_relative "spec_helper"
 require_relative "../lib/deprecation_tracker"
 
+RSpec::Matchers.define_negated_matcher :not_raise_error, :raise_error
+
 RSpec.describe DeprecationTracker do
   let(:shitlist_path) do
     shitlist_path = Tempfile.new("tmp").path
@@ -269,5 +271,18 @@
 
       expect(warn_messages).to eq(["oh", "no"])
     end
+
+    describe "bug when warning uses the uplevel keyword argument" do
+      context "given I setup the DeprecationTracker::KernelWarnTracker with a callback that manipulates messages as Strings" do
+
+        DeprecationTracker::KernelWarnTracker.callbacks << -> (message) { message.gsub("Rails.root/", "") }
+
+        context "and given that I call code that emits a warning using the uplevel keyword arg" do
+          it "throws a MissingMethod Error" do
+            expect { Kernel.warn("Oh no", uplevel: 1) }.to not_raise_error.and output.to_stderr
+          end
+        end
+      end
+    end
   end
 end

From 9258e04e5a924954e71cb278372fb371b6d92b35 Mon Sep 17 00:00:00 2001
From: Mateus Pereira <mateusdeap@gmail.com>
Date: Mon, 6 Feb 2023 10:56:59 -0300
Subject: [PATCH 097/171] Add `uplevel` keyword argument

---
 lib/deprecation_tracker.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index ed60506..70ed784 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -18,7 +18,7 @@ def self.callbacks
       @callbacks ||= []
     end
 
-    def warn(*messages)
+    def warn(*messages, uplevel: nil)
       KernelWarnTracker.callbacks.each do |callback|
         messages.each { |message| callback.(message) }
       end

From f1b1f9b2f2574a1e1dbadad902b7b66b39d2b62b Mon Sep 17 00:00:00 2001
From: Mateus Pereira <mateusdeap@gmail.com>
Date: Mon, 6 Feb 2023 12:17:54 -0300
Subject: [PATCH 098/171] Forward all arguments only if ruby version is higher
 than `2.5.0`

---
 lib/deprecation_tracker.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index 70ed784..adc005f 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -23,7 +23,11 @@ def warn(*messages, uplevel: nil)
         messages.each { |message| callback.(message) }
       end
 
-      super
+      if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0")
+        super *messages
+      else
+        super
+      end
     end
   end
 

From 5b9bfd19fec636fdd06435ade6f10e56aa33e067 Mon Sep 17 00:00:00 2001
From: Mateus Pereira <mateusdeap@gmail.com>
Date: Tue, 7 Feb 2023 06:11:01 -0300
Subject: [PATCH 099/171] Add `CHANGELOG.md` entry

---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index afe0303..8e168d0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.1...main)
+* [BUGFIX: Fixed `KernelWarnTracker#warn signature to match `Kernel#warn` for ruby 2.5+](https://github.com/fastruby/next_rails/pull/82)
 * [CHORE: Added updated templates for bug fixes, feature requests and pull requests](https://github.com/fastruby/next_rails/pull/64) as per [this RFC](https://github.com/fastruby/RFCs/blob/main/2021-10-13-github-templates.md)
 * [FEATURE: Turn BundleReport into a module](https://github.com/fastruby/next_rails/pull/63)
 

From 7fbffcee70e5f305eafddd65a1141cf8f58318f7 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 3 Mar 2023 09:15:58 -0500
Subject: [PATCH 100/171] Bump version to 1.2.2

---
 CHANGELOG.md              | 4 +++-
 lib/next_rails/version.rb | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8e168d0..53a6446 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,6 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.1...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.2...main)
+* Your changes/patches go here.
+# v1.2.2 / 2023-03-03 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.1...v1.2.2)
 * [BUGFIX: Fixed `KernelWarnTracker#warn signature to match `Kernel#warn` for ruby 2.5+](https://github.com/fastruby/next_rails/pull/82)
 * [CHORE: Added updated templates for bug fixes, feature requests and pull requests](https://github.com/fastruby/next_rails/pull/64) as per [this RFC](https://github.com/fastruby/RFCs/blob/main/2021-10-13-github-templates.md)
 * [FEATURE: Turn BundleReport into a module](https://github.com/fastruby/next_rails/pull/63)
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index b822245..e37be0c 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 module NextRails
-  VERSION = "1.2.1"
+  VERSION = "1.2.2"
 end

From 89802edf9ddfb65f7ee8540efbd058bc2011d5e6 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 3 Mar 2023 09:18:17 -0500
Subject: [PATCH 101/171] Test next_rails with more versions of ruby

---
 .github/workflows/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a047d01..73489f3 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -13,7 +13,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: [3.1, 2.7.5, 2.3, 2.2, 2.1.9, 2.0.0]
+        ruby-version: [3.2, 3.1, 3.0, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0.0]
 
     steps:
       - uses: actions/checkout@v2

From faac7ad6efb66537e1e63cc26d641eaa372f5b30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20V=C3=A1squez?= <juan@ombulabs.com>
Date: Thu, 9 Mar 2023 13:42:51 -0600
Subject: [PATCH 102/171] Update deprecation warning file name

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index cfa6022..4766beb 100644
--- a/README.md
+++ b/README.md
@@ -98,7 +98,7 @@ deprecations run
 deprecations --help # For more options and examples
 ```
 
-Right now, the path to the shitlist is hardcoded so make sure you store yours at `spec/support/deprecations.shitlist.json`.
+Right now, the path to the shitlist is hardcoded so make sure you store yours at `spec/support/deprecation_warning.shitlist.json`.
 
 #### `next_rails` command
 

From e3a5500fe1ea6476045e55d5a4f6d6b75ea52a09 Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Thu, 6 Apr 2023 13:05:18 -0600
Subject: [PATCH 103/171] Add new rails gems to the list

---
 lib/next_rails/gem_info.rb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index 8cc801b..1b1a210 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -39,6 +39,8 @@ def state(_)
       "activejob",
       "activestorage",
       "activesupport",
+      "actionmailbox",
+      "actiontext",
       "railties",
     ].freeze
 

From 6061ad9c701b7942ffb5611ac4c083c32128faae Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Thu, 6 Apr 2023 13:52:30 -0600
Subject: [PATCH 104/171] Pass trim_mode to ERB.new

---
 lib/next_rails/bundle_report.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 3c1e99b..0304f2a 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -49,7 +49,7 @@ def compatibility(rails_version: nil, include_rails_gems: nil)
 <%= incompatible_gems.length.to_s.red %> gems incompatible with Rails <%= rails_version %>
       ERB
 
-      puts ERB.new(template, nil, "-").result(binding)
+      puts ERB.new(template, trim_mode: "-").result(binding)
     end
 
     def gem_header(_gem)

From 28deb209589f63e0a23f0d60994006e41b4875e8 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Wed, 12 Apr 2023 13:00:53 -0600
Subject: [PATCH 105/171] release work for v1.2.3

---
 CHANGELOG.md              | 9 ++++++++-
 lib/next_rails/version.rb | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53a6446..434901c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.2...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.3...main)
 * Your changes/patches go here.
+
+# v1.2.3 / 2023-04-12 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.2...v1.2.3)
+
+- [Fix ERB deprecation warning in Ruby 3.1]
+
+- [Remove Rails gems from compatibility check]
+
 # v1.2.2 / 2023-03-03 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.1...v1.2.2)
 * [BUGFIX: Fixed `KernelWarnTracker#warn signature to match `Kernel#warn` for ruby 2.5+](https://github.com/fastruby/next_rails/pull/82)
 * [CHORE: Added updated templates for bug fixes, feature requests and pull requests](https://github.com/fastruby/next_rails/pull/64) as per [this RFC](https://github.com/fastruby/RFCs/blob/main/2021-10-13-github-templates.md)
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index e37be0c..16a4dc0 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.2.2"
+  VERSION = "1.2.3"
 end

From 226a2dcfdd57cecbbb982b5550b85b0bf1fe0c53 Mon Sep 17 00:00:00 2001
From: Michael Toppa <public@toppa.com>
Date: Thu, 13 Apr 2023 15:27:54 -0600
Subject: [PATCH 106/171] Update the `warn` method signature to support Rails
 3.1

---
 lib/deprecation_tracker.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index adc005f..89cd337 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -18,13 +18,15 @@ def self.callbacks
       @callbacks ||= []
     end
 
-    def warn(*messages, uplevel: nil)
+    def warn(*messages, uplevel: nil, category: nil)
       KernelWarnTracker.callbacks.each do |callback|
         messages.each { |message| callback.(message) }
       end
 
       if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0")
-        super *messages
+        super(*messages)
+      elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0")
+        super(*messages, uplevel: nil)
       else
         super
       end

From 4eba1d522973bc86cf2ded86f38b68664bda2e76 Mon Sep 17 00:00:00 2001
From: rishijain <jainrishi.37@gmail.com>
Date: Thu, 20 Apr 2023 20:17:05 -0600
Subject: [PATCH 107/171] release work for v1.2.4

---
 CHANGELOG.md              | 6 +++++-
 lib/next_rails/version.rb | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 434901c..2e4d874 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.3...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.4...main)
 * Your changes/patches go here.
 
+# v1.2.4 / 2023-04-21 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.3...v1.2.4)
+
+- [BUGFIX: Update the warn method signature to support for Ruby 3]
+
 # v1.2.3 / 2023-04-12 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.2...v1.2.3)
 
 - [Fix ERB deprecation warning in Ruby 3.1]
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index 16a4dc0..6fca062 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.2.3"
+  VERSION = "1.2.4"
 end

From eddefb5d553a94fadb88d3a30b9143b1c3c5ea27 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Wed, 24 May 2023 10:49:36 -0400
Subject: [PATCH 108/171] Add tests for the next? method

---
 spec/spec_helper.rb          |  2 +-
 spec/ten_years_rails_spec.rb | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index e56af3c..72c132f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,4 +1,3 @@
-
 if ENV['COVERAGE'] == 'true'
   require 'simplecov'
   SimpleCov.start do
@@ -20,6 +19,7 @@
 
 require "bundler/setup"
 require "next_rails"
+require "climate_control"
 
 require 'webmock/rspec'
 WebMock.disable_net_connect!(allow_localhost: true)
diff --git a/spec/ten_years_rails_spec.rb b/spec/ten_years_rails_spec.rb
index 1399699..1947c89 100644
--- a/spec/ten_years_rails_spec.rb
+++ b/spec/ten_years_rails_spec.rb
@@ -2,4 +2,31 @@
   it "has a version number" do
     expect(NextRails::VERSION).not_to be nil
   end
+
+  describe "NextRails.next?" do
+    context "when BUNDLE_GEMFILE is not set" do
+      it "returns false" do
+        expect(NextRails.next?).to be_falsey
+      end
+    end
+
+    context "when BUNDLE_GEMFILE is set" do
+      context "when it is set to Gemfile.next" do
+        it "returns true" do
+          ClimateControl.modify BUNDLE_GEMFILE: "Gemfile.next" do
+            expect(NextRails.next?).to be_truthy
+          end
+        end
+      end
+
+      context "when it is set to something else" do
+        it "returns false" do
+          ClimateControl.modify BUNDLE_GEMFILE: "Gemfile4" do
+            expect(NextRails.next?).to be_falsey
+          end
+        end
+      end
+    end
+  end
+
 end

From b9566ae140f549fca0dfac03ccef430764db0ae9 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Wed, 24 May 2023 10:49:48 -0400
Subject: [PATCH 109/171] Add climate_control as development dependency

---
 next_rails.gemspec | 1 +
 1 file changed, 1 insertion(+)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 75f3e72..f8461fa 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
 
   spec.add_dependency "colorize", ">= 0.8.1"
   spec.add_development_dependency "bundler", ">= 1.16", "< 3.0"
+  spec.add_development_dependency "climate_control"
   spec.add_development_dependency "rake"
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"

From 53b7cdb5f8b1606b4c3fd98d0bdf9317238e4230 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Wed, 24 May 2023 10:49:58 -0400
Subject: [PATCH 110/171] Add basic implementation of the next? method

---
 lib/next_rails.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/next_rails.rb b/lib/next_rails.rb
index 105b252..761151e 100644
--- a/lib/next_rails.rb
+++ b/lib/next_rails.rb
@@ -1,8 +1,14 @@
+# frozen_string_literal: true
+
 require "next_rails/gem_info"
 require "next_rails/version"
 require "next_rails/bundle_report"
 require "deprecation_tracker"
 
 module NextRails
-  # Your code goes here...
+  extend self
+
+  def next?
+    ENV["BUNDLE_GEMFILE"] == "Gemfile.next"
+  end
 end

From 256941c110f4987d4db4b8c6653f7b08c0dd3f74 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Wed, 24 May 2023 12:01:17 -0400
Subject: [PATCH 111/171] More documentation for the next? method

---
 CHANGELOG.md |  3 +++
 README.md    | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e4d874..7784ba4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,9 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.4...main)
+
 * Your changes/patches go here.
 
+* [FEATURE: Add NextRails.next? for application usage (e.g. Rails shims)](https://github.com/fastruby/next_rails/pull/97)
+
 # v1.2.4 / 2023-04-21 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.3...v1.2.4)
 
 - [BUGFIX: Update the warn method signature to support for Ruby 3]
diff --git a/README.md b/README.md
index 4766beb..ebdd766 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,26 @@ bundle_report --help
 bundle_report ruby_check --rails-version=7.0.0
 ```
 
+### Application usage
+
+Every now and then it will be necessary to add code like this to your
+application:
+
+```ruby
+if NextRails.next?
+  # Do things "the Rails 7 way"
+else
+  # Do things "the Rails 6.1 way"
+end
+```
+
+The `NextRails.next?` method will use your environment
+(e.g. `ENV['BUNDLE_GEMFILE]`) to determine whether your application is
+running with the next set of dependencies or the current set of dependencies.
+
+This might come in handy if you need to inject
+[Ruby or Rails shims](https://www.fastruby.io/blog/rails/upgrades/rails-upgrade-shims.html).
+
 ### Deprecation tracking
 
 If you're using RSpec, add this snippet to `rails_helper.rb` or `spec_helper.rb` (whichever loads Rails).

From ac16f14a78159790c868aaf67f8a2cf76f6de317 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Wed, 24 May 2023 12:01:30 -0400
Subject: [PATCH 112/171] Had to add a new method to make the tests pass

---
 lib/next_rails.rb | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/lib/next_rails.rb b/lib/next_rails.rb
index 761151e..db2a661 100644
--- a/lib/next_rails.rb
+++ b/lib/next_rails.rb
@@ -6,9 +6,19 @@
 require "deprecation_tracker"
 
 module NextRails
-  extend self
 
-  def next?
-    ENV["BUNDLE_GEMFILE"] == "Gemfile.next"
+  # This method will check your environment
+  # (e.g. `ENV['BUNDLE_GEMFILE]`) to determine whether your application is
+  # running with the next set of dependencies or the current set of dependencies.
+  #
+  # @return [Boolean]
+  def self.next?
+    @@next_bundle_gemfile ||= ENV["BUNDLE_GEMFILE"] == "Gemfile.next"
+  end
+
+  # This method will reset the @@next_bundle_gemfile variable. Then next time
+  # you call `NextRails.next?` it will check the environment once again.
+  def self.reset_next_bundle_gemfile
+    @@next_bundle_gemfile = nil
   end
 end

From 4f7d0ab095d04194eed5736a32d723b86496a59a Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Wed, 24 May 2023 12:01:48 -0400
Subject: [PATCH 113/171] A util method call is needed to reproduce real usage
 of `NextRails.next?`

---
 spec/ten_years_rails_spec.rb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/spec/ten_years_rails_spec.rb b/spec/ten_years_rails_spec.rb
index 1947c89..e9a0798 100644
--- a/spec/ten_years_rails_spec.rb
+++ b/spec/ten_years_rails_spec.rb
@@ -13,6 +13,8 @@
     context "when BUNDLE_GEMFILE is set" do
       context "when it is set to Gemfile.next" do
         it "returns true" do
+          NextRails.reset_next_bundle_gemfile
+
           ClimateControl.modify BUNDLE_GEMFILE: "Gemfile.next" do
             expect(NextRails.next?).to be_truthy
           end
@@ -21,6 +23,8 @@
 
       context "when it is set to something else" do
         it "returns false" do
+          NextRails.reset_next_bundle_gemfile
+
           ClimateControl.modify BUNDLE_GEMFILE: "Gemfile4" do
             expect(NextRails.next?).to be_falsey
           end

From 44a735cc6c84e1e351ca9d1e83b2cc2f1937e14b Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Wed, 24 May 2023 12:02:18 -0400
Subject: [PATCH 114/171] Rename file to be more accurate

---
 spec/{ten_years_rails_spec.rb => next_rails_spec.rb} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename spec/{ten_years_rails_spec.rb => next_rails_spec.rb} (100%)

diff --git a/spec/ten_years_rails_spec.rb b/spec/next_rails_spec.rb
similarity index 100%
rename from spec/ten_years_rails_spec.rb
rename to spec/next_rails_spec.rb

From 823109503e15ce2ef330b9b6e6bc4bb09e577e2e Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Wed, 7 Jun 2023 11:19:56 -0300
Subject: [PATCH 115/171] Support ERB syntax in old Ruby versions

---
 lib/next_rails/bundle_report.rb | 15 ++++++++++++++-
 next_rails.gemspec              |  1 +
 spec/bundle_report_spec.rb      |  9 +++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 0304f2a..41b7be4 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -17,6 +17,10 @@ def compatibility(rails_version: nil, include_rails_gems: nil)
 
       incompatible_gems_by_state = incompatible_gems.group_by { |gem| gem.state(rails_version) }
 
+      puts erb_output(incompatible_gems_by_state, incompatible_gems, rails_version)
+    end
+
+    def erb_output(incompatible_gems_by_state, incompatible_gems, rails_version)
       template = <<-ERB
 <% if incompatible_gems_by_state[:found_compatible] -%>
 <%= "=> Incompatible with Rails #{rails_version} (with new versions that are compatible):".white.bold %>
@@ -49,7 +53,16 @@ def compatibility(rails_version: nil, include_rails_gems: nil)
 <%= incompatible_gems.length.to_s.red %> gems incompatible with Rails <%= rails_version %>
       ERB
 
-      puts ERB.new(template, trim_mode: "-").result(binding)
+      erb_version = ERB.version
+      if erb_version =~ /erb.rb \[([\d\.]+) .*\]/
+        erb_version = $1
+      end
+
+      if Gem::Version.new(erb_version) < Gem::Version.new("2.2")
+        ERB.new(template, nil, "-").result(binding)
+      else
+        ERB.new(template, trim_mode: "-").result(binding)
+      end
     end
 
     def gem_header(_gem)
diff --git a/next_rails.gemspec b/next_rails.gemspec
index 75f3e72..ece5d46 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
+  spec.add_development_dependency "byebug"
   spec.add_development_dependency "rexml", "3.1.7.3" # limited on purpose, new versions don't work with old rubies
   spec.add_development_dependency "webmock", "3.16.2" # limited on purpose, new versions don't work with old rubies
 end
diff --git a/spec/bundle_report_spec.rb b/spec/bundle_report_spec.rb
index 325d986..0882764 100644
--- a/spec/bundle_report_spec.rb
+++ b/spec/bundle_report_spec.rb
@@ -65,4 +65,13 @@
       end
     end
   end
+
+  describe ".compatibility" do
+    describe "output" do
+      it "returns ERB generated output" do
+        output = NextRails::BundleReport.erb_output({}, [], 7.0)
+        expect(output).to match "gems incompatible with Rails 7.0"
+      end
+    end
+  end
 end

From 61eab9a331af3e512c3d353fd4c4d67f64ae00ea Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Wed, 7 Jun 2023 11:49:13 -0300
Subject: [PATCH 116/171] Use an older ubuntu for Ruby 2.2 and older

---
 .github/workflows/main.yml | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 73489f3..d19c412 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -13,7 +13,23 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: [3.2, 3.1, 3.0, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0.0]
+        ruby-version: [3.2, 3.1, 3.0, 2.7, 2.6, 2.5, 2.4, 2.3]
+
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Ruby ${{ matrix.ruby-version }}
+        uses: ruby/setup-ruby@v1
+        with:
+          ruby-version: ${{ matrix.ruby-version }}
+          bundler-cache: true
+      - name: Run rake task
+        run: bundle exec rake
+
+  test_older:
+    runs-on: ubuntu-20.04
+    strategy:
+      matrix:
+        ruby-version: [2.2, 2.1, 2.0.0]
 
     steps:
       - uses: actions/checkout@v2

From fd12e8bf865db515261e26cb9bc74c83843d95ec Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Tue, 6 Jun 2023 22:18:11 -0600
Subject: [PATCH 117/171] Add Module attribute and File check

This is trying to solve what [Ariel found in this comment.](https://github.com/fastruby/next_rails/pull/97#discussion_r1221539373)

Reference #97
---
 lib/next_rails.rb       |  5 ++++-
 spec/next_rails_spec.rb | 17 +++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/lib/next_rails.rb b/lib/next_rails.rb
index db2a661..c25dc9f 100644
--- a/lib/next_rails.rb
+++ b/lib/next_rails.rb
@@ -6,6 +6,7 @@
 require "deprecation_tracker"
 
 module NextRails
+  @@next_bundle_gemfile = nil
 
   # This method will check your environment
   # (e.g. `ENV['BUNDLE_GEMFILE]`) to determine whether your application is
@@ -13,7 +14,9 @@ module NextRails
   #
   # @return [Boolean]
   def self.next?
-    @@next_bundle_gemfile ||= ENV["BUNDLE_GEMFILE"] == "Gemfile.next"
+    return @@next_bundle_gemfile unless @@next_bundle_gemfile.nil?
+
+    @@next_bundle_gemfile = File.exist?(ENV["BUNDLE_GEMFILE"]) && File.basename(ENV["BUNDLE_GEMFILE"]) == "Gemfile.next"
   end
 
   # This method will reset the @@next_bundle_gemfile variable. Then next time
diff --git a/spec/next_rails_spec.rb b/spec/next_rails_spec.rb
index e9a0798..5f627cf 100644
--- a/spec/next_rails_spec.rb
+++ b/spec/next_rails_spec.rb
@@ -1,3 +1,5 @@
+require "fileutils"
+
 RSpec.describe NextRails do
   it "has a version number" do
     expect(NextRails::VERSION).not_to be nil
@@ -13,21 +15,36 @@
     context "when BUNDLE_GEMFILE is set" do
       context "when it is set to Gemfile.next" do
         it "returns true" do
+          FileUtils.touch("Gemfile.next")
           NextRails.reset_next_bundle_gemfile
 
           ClimateControl.modify BUNDLE_GEMFILE: "Gemfile.next" do
             expect(NextRails.next?).to be_truthy
           end
         end
+
+        context "when Gemfile.next file does not exist" do
+          it "returns false" do
+            FileUtils.rm("Gemfile.next")
+            NextRails.reset_next_bundle_gemfile
+
+            ClimateControl.modify BUNDLE_GEMFILE: "Gemfile.next" do
+              expect(NextRails.next?).to be_falsey
+            end
+          end
+        end
       end
 
       context "when it is set to something else" do
         it "returns false" do
+          FileUtils.touch("Gemfile4")
           NextRails.reset_next_bundle_gemfile
 
           ClimateControl.modify BUNDLE_GEMFILE: "Gemfile4" do
             expect(NextRails.next?).to be_falsey
           end
+
+          FileUtils.rm("Gemfile4")
         end
       end
     end

From fb343946b4806e1948207ef6543e562eb5927b7a Mon Sep 17 00:00:00 2001
From: Ariel Juodziukynas <arieljuod@gmail.com>
Date: Fri, 9 Jun 2023 09:49:39 -0300
Subject: [PATCH 118/171] Update changelog

---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e4d874..c845ffa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,8 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.4...main)
 * Your changes/patches go here.
 
+- [BUGFIX: Support ERB versions older than 2.2.0](https://github.com/fastruby/next_rails/pull/100)
+
 # v1.2.4 / 2023-04-21 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.3...v1.2.4)
 
 - [BUGFIX: Update the warn method signature to support for Ruby 3]

From 8905ca06f431d32503b1c5f39126ff5a4c720bce Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Sat, 10 Jun 2023 22:49:37 -0600
Subject: [PATCH 119/171] Replace climate_control gem with stub_const

---
 next_rails.gemspec      |  2 --
 spec/next_rails_spec.rb | 15 ++++++---------
 spec/spec_helper.rb     |  5 ++++-
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index f8461fa..cc5f6ad 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -1,4 +1,3 @@
-
 lib = File.expand_path("../lib", __FILE__)
 $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
 require "next_rails/version"
@@ -25,7 +24,6 @@ Gem::Specification.new do |spec|
 
   spec.add_dependency "colorize", ">= 0.8.1"
   spec.add_development_dependency "bundler", ">= 1.16", "< 3.0"
-  spec.add_development_dependency "climate_control"
   spec.add_development_dependency "rake"
   spec.add_development_dependency "rspec", "~> 3.0"
   spec.add_development_dependency "simplecov", "~> 0.17.1"
diff --git a/spec/next_rails_spec.rb b/spec/next_rails_spec.rb
index 5f627cf..9a6ca3f 100644
--- a/spec/next_rails_spec.rb
+++ b/spec/next_rails_spec.rb
@@ -18,9 +18,8 @@
           FileUtils.touch("Gemfile.next")
           NextRails.reset_next_bundle_gemfile
 
-          ClimateControl.modify BUNDLE_GEMFILE: "Gemfile.next" do
-            expect(NextRails.next?).to be_truthy
-          end
+          with_env("BUNDLE_GEMFILE" => "Gemfile.next")
+          expect(NextRails.next?).to be_truthy
         end
 
         context "when Gemfile.next file does not exist" do
@@ -28,9 +27,8 @@
             FileUtils.rm("Gemfile.next")
             NextRails.reset_next_bundle_gemfile
 
-            ClimateControl.modify BUNDLE_GEMFILE: "Gemfile.next" do
-              expect(NextRails.next?).to be_falsey
-            end
+            with_env("BUNDLE_GEMFILE" => "Gemfile.next")
+            expect(NextRails.next?).to be_falsey
           end
         end
       end
@@ -40,9 +38,8 @@
           FileUtils.touch("Gemfile4")
           NextRails.reset_next_bundle_gemfile
 
-          ClimateControl.modify BUNDLE_GEMFILE: "Gemfile4" do
-            expect(NextRails.next?).to be_falsey
-          end
+          with_env("BUNDLE_GEMFILE" => "Gemfile4")
+          expect(NextRails.next?).to be_falsey
 
           FileUtils.rm("Gemfile4")
         end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 72c132f..e0d6de2 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -19,7 +19,6 @@
 
 require "bundler/setup"
 require "next_rails"
-require "climate_control"
 
 require 'webmock/rspec'
 WebMock.disable_net_connect!(allow_localhost: true)
@@ -45,3 +44,7 @@
       to_return(status: 200, body: "[{\"number\": \"7.0.0\"}, {\"number\": \"6.1.6\"}]", headers: {})
   end
 end
+
+def with_env(env_hash)
+  stub_const("ENV", env_hash)
+end

From aaa9485ce7b2973e6dab6da9edca5fff6a76db49 Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Wed, 14 Jun 2023 02:12:11 -0600
Subject: [PATCH 120/171] Merge ENV variable

Addressing Ariel's suggestion
---
 spec/spec_helper.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index e0d6de2..819479b 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -46,5 +46,5 @@
 end
 
 def with_env(env_hash)
-  stub_const("ENV", env_hash)
+  stub_const("ENV", ENV.to_hash.merge!(env_hash))
 end

From 3a3df5098cc6b2219192c00e48904cde9638152a Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Fri, 16 Jun 2023 13:23:34 -0600
Subject: [PATCH 121/171] Release work for v1.3.0

---
 CHANGELOG.md              | 4 +++-
 lib/next_rails/version.rb | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6378ed8..6f8eef1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,9 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.4...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.3.0...main)
 
 * Your changes/patches go here.
 
+# v1.3.0 / 2023-06-16 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.4...v1.3.0)
+
 - [FEATURE: Add NextRails.next? for application usage (e.g. Rails shims)](https://github.com/fastruby/next_rails/pull/97)
 - [BUGFIX: Support ERB versions older than 2.2.0](https://github.com/fastruby/next_rails/pull/100)
 
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index 6fca062..e738d56 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.2.4"
+  VERSION = "1.3.0"
 end

From dcb47f2c8acea29d7fe8d025d1f750d90423dbbb Mon Sep 17 00:00:00 2001
From: Fiona <fionadlapham@gmail.com>
Date: Mon, 11 Sep 2023 15:28:02 -0400
Subject: [PATCH 122/171] Remove code owners

---
 CODEOWNERS | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 CODEOWNERS

diff --git a/CODEOWNERS b/CODEOWNERS
deleted file mode 100644
index 4aec9b5..0000000
--- a/CODEOWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# These code owners will be the default owners to everything in the repository.
-# Unless a posterior rule has precedence, they will be automatically requested
-# for review when a pull request is opened.
-*       @fastruby/black-bunny-brigade

From 4752fc9dd4d49d5ca35f779f66622604b208c6f2 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 3 Nov 2023 11:54:52 -0400
Subject: [PATCH 123/171] We haven't used Travis CI in years

---
 .travis.yml | 10 ----------
 1 file changed, 10 deletions(-)
 delete mode 100644 .travis.yml

diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 4782f18..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-sudo: false
-language: ruby
-rvm:
-  - 2.3.3
-  - 2.4.10
-  - 2.5.8
-  - 2.6.6
-  - 2.7.2
-  - 3.0.2
-before_install: gem install bundler -v 1.16.1

From 41531e842ff41f980d0d1bfc0a28de706eb90d58 Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Sat, 18 May 2024 16:55:57 -0600
Subject: [PATCH 124/171] [FEATURE] Support compatibility for Ruby versions

the `bundle_report compatibility` now supports the `--ruby-version` flag
to ask it for incompatible gems with the given Ruby version.

Closes https://github.com/fastruby/next_rails/issues/17
Closes https://github.com/fastruby/next_rails/issues/115
---
 CHANGELOG.md                                  |  2 +
 README.md                                     |  8 +-
 exe/bundle_report                             | 11 ++-
 lib/next_rails.rb                             |  1 +
 lib/next_rails/bundle_report.rb               |  6 +-
 .../ruby_version_compatibility.rb             | 44 ++++++++++
 lib/next_rails/gem_info.rb                    |  4 +
 .../ruby_version_compatibility_spec.rb        | 86 +++++++++++++++++++
 8 files changed, 157 insertions(+), 5 deletions(-)
 create mode 100644 lib/next_rails/bundle_report/ruby_version_compatibility.rb
 create mode 100644 spec/next_rails/bundle_report/ruby_version_compatibility_spec.rb

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f8eef1..dde37f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
 
 * Your changes/patches go here.
 
+- [FEATURE: Support compatibility for Ruby versions](https://github.com/fastruby/next_rails/pull/116)
+
 # v1.3.0 / 2023-06-16 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.4...v1.3.0)
 
 - [FEATURE: Add NextRails.next? for application usage (e.g. Rails shims)](https://github.com/fastruby/next_rails/pull/97)
diff --git a/README.md b/README.md
index ebdd766..d6a4add 100644
--- a/README.md
+++ b/README.md
@@ -39,10 +39,14 @@ bundle_report outdated --json
 # Show gems that don't work with Rails 5.2.0
 bundle_report compatibility --rails-version=5.2.0
 
-# Show the usual help message
-bundle_report --help
+# Show gems that don't work with Ruby 3.0
+bundle_report compatibility --ruby-version=3.0
+
 # Find minimum compatible ruby version with Rails 7.0.0
 bundle_report ruby_check --rails-version=7.0.0
+
+# Show the usual help message
+bundle_report --help
 ```
 
 ### Application usage
diff --git a/exe/bundle_report b/exe/bundle_report
index 8408433..d8b92de 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -16,6 +16,7 @@ at_exit do
 
       Examples:
         #{$0} compatibility --rails-version 5.0
+        #{$0} compatibility --ruby-version 3.3
         #{$0} outdated
         #{$0} outdated --json
 
@@ -33,6 +34,10 @@ at_exit do
       options[:rails_version] = rails_version
     end
 
+    opts.on("--ruby-version [STRING]", "Ruby version to check compatibility against (defaults to 2.3)") do |ruby_version|
+      options[:ruby_version] = ruby_version
+    end
+
     opts.on("--include-rails-gems", "Include Rails gems in compatibility report (defaults to false)") do
       options[:include_rails_gems] = true
     end
@@ -61,7 +66,11 @@ at_exit do
   when "ruby_check" then NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
   when "outdated" then NextRails::BundleReport.outdated(options.fetch(:format, nil))
   else
-    NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
+    if options[:ruby_version]
+      NextRails::BundleReport.compatibility(ruby_version: options.fetch(:ruby_version, "2.3"))
+    else
+      NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
+    end
   end
 end
 
diff --git a/lib/next_rails.rb b/lib/next_rails.rb
index c25dc9f..7da5a14 100644
--- a/lib/next_rails.rb
+++ b/lib/next_rails.rb
@@ -3,6 +3,7 @@
 require "next_rails/gem_info"
 require "next_rails/version"
 require "next_rails/bundle_report"
+require "next_rails/bundle_report/ruby_version_compatibility"
 require "deprecation_tracker"
 
 module NextRails
diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 41b7be4..e5fe2ae 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -8,7 +8,9 @@ module NextRails
   module BundleReport
     extend self
 
-    def compatibility(rails_version: nil, include_rails_gems: nil)
+    def compatibility(rails_version: nil, ruby_version: nil, include_rails_gems: nil)
+      return puts RubyVersionCompatibility.new(options: { ruby_version: ruby_version }).generate if ruby_version
+
       incompatible_gems = NextRails::GemInfo.all.reject do |gem|
         gem.compatible_with_rails?(rails_version: rails_version) || (!include_rails_gems && gem.from_rails?)
       end.sort_by { |gem| gem.name }
@@ -168,4 +170,4 @@ def output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_count)
       puts footer
     end
   end
-end
\ No newline at end of file
+end
diff --git a/lib/next_rails/bundle_report/ruby_version_compatibility.rb b/lib/next_rails/bundle_report/ruby_version_compatibility.rb
new file mode 100644
index 0000000..7fa8f74
--- /dev/null
+++ b/lib/next_rails/bundle_report/ruby_version_compatibility.rb
@@ -0,0 +1,44 @@
+require "colorize"
+
+class NextRails::BundleReport::RubyVersionCompatibility
+  MINIMAL_VERSION = 1.0
+  attr_reader :gems, :options
+
+  def initialize(gems: NextRails::GemInfo.all, options: {})
+    @gems = gems
+    @options = options
+  end
+
+  def generate
+    return invalid_message unless valid?
+
+    message
+  end
+
+  private
+
+  def message
+    output = "=> Incompatible gems with Ruby #{ruby_version}:".white.bold
+    incompatible.each do |gem|
+      output += "\n#{gem.name} - required Ruby version: #{gem.gem_specification.required_ruby_version}".magenta
+    end
+    output += "\n\n#{incompatible.length} incompatible #{incompatible.one? ? 'gem' : 'gems' } with Ruby #{ruby_version}".red
+    output
+  end
+
+  def incompatible
+    gems.reject { |gem| gem.compatible_with_ruby?(ruby_version) }
+  end
+
+  def ruby_version
+    options[:ruby_version].to_f
+  end
+
+  def invalid_message
+    "=> Invalid Ruby version: #{options[:ruby_version]}.".red.bold
+  end
+
+  def valid?
+    ruby_version > MINIMAL_VERSION
+  end
+end
diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index 1b1a210..d6060f9 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -147,5 +147,9 @@ def spec_compatible_with_rails?(specification: nil, rails_version: nil)
         rails_dependency.requirement.satisfied_by?(Gem::Version.new(rails_version))
       end
     end
+
+    def compatible_with_ruby?(ruby_version)
+      gem_specification.required_ruby_version.satisfied_by?(Gem::Version.new(ruby_version))
+    end
   end
 end
diff --git a/spec/next_rails/bundle_report/ruby_version_compatibility_spec.rb b/spec/next_rails/bundle_report/ruby_version_compatibility_spec.rb
new file mode 100644
index 0000000..ff416f3
--- /dev/null
+++ b/spec/next_rails/bundle_report/ruby_version_compatibility_spec.rb
@@ -0,0 +1,86 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+require "next_rails/bundle_report/ruby_version_compatibility"
+
+RSpec.describe NextRails::BundleReport::RubyVersionCompatibility do
+  let(:ruby_3_0_gem) do
+    Gem::Specification.new do |s|
+      s.name = "ruby_3_0_gem"
+      s.version = "1.0.0"
+      s.required_ruby_version = ">= 3.0"
+    end
+  end
+
+  let(:ruby_2_5_gem) do
+    Gem::Specification.new do |s|
+      s.name = "ruby_2_5_gem"
+      s.version = "1.0.0"
+      s.required_ruby_version = ">= 2.5"
+    end
+  end
+
+  let(:ruby_2_3_to_2_5_gem) do
+    Gem::Specification.new do |s|
+      s.name = "ruby_2_3_to_2_5_gem"
+      s.version = "1.0.0"
+      s.required_ruby_version = [">= 2.3", "< 2.5"]
+    end
+  end
+
+  let(:no_ruby_version_gem) do
+    Gem::Specification.new do |s|
+      s.name = "no_ruby_version_gem"
+      s.version = "1.0.0"
+    end
+  end
+
+  describe "#generate" do
+    context "with invalid ruby version" do
+      it "returns invalid message" do
+        options = { ruby_version: "hola" }
+
+        result = described_class.new(gems: [], options: options).generate
+        expect(result).to include "Invalid Ruby version: hola"
+      end
+    end
+
+    context "with valid ruby version" do
+      it "returns 0 incompatible gems" do
+        options = { ruby_version: "3.0" }
+        gems = [NextRails::GemInfo.new(ruby_3_0_gem)]
+
+        result = described_class.new(gems: gems, options: options).generate
+        expect(result).to include "0 incompatible gems with Ruby 3.0"
+      end
+
+      it "returns 1 incompatible gem" do
+        options = { ruby_version: "2.5" }
+        gems = [NextRails::GemInfo.new(ruby_3_0_gem)]
+
+        result = described_class.new(gems: gems, options: options).generate
+
+        expect(result).to include "Incompatible gems with Ruby 2.5"
+        expect(result).to include "ruby_3_0_gem - required Ruby version: >= 3.0"
+        expect(result).to include "1 incompatible gem with Ruby 2.5"
+      end
+
+      it "returns 2 incompatible gems" do
+        options = { ruby_version: "2.7" }
+        gems = [
+          NextRails::GemInfo.new(ruby_3_0_gem),
+          NextRails::GemInfo.new(ruby_2_5_gem),
+          NextRails::GemInfo.new(ruby_2_3_to_2_5_gem),
+          NextRails::GemInfo.new(no_ruby_version_gem)
+        ]
+
+        result = described_class.new(gems: gems, options: options).generate
+
+        expect(result).to include "Incompatible gems with Ruby 2.7"
+        expect(result).to include "ruby_3_0_gem - required Ruby version: >= 3.0"
+        expect(result).to include "ruby_2_3_to_2_5_gem - required Ruby version:" # >= 2.3, < 2.5"
+        expect(result).to include "2 incompatible gems with Ruby 2.7"
+      end
+    end
+  end
+end

From 7ebdc22909280876079faac6001e780e881c9c2b Mon Sep 17 00:00:00 2001
From: Tim Kelly <timlkelly@users.noreply.github.com>
Date: Fri, 23 Aug 2024 13:59:16 -0500
Subject: [PATCH 125/171] Replace Colorize with Rainbow

---
 exe/deprecations                | 4 +++-
 lib/deprecation_tracker.rb      | 4 +++-
 lib/next_rails/bundle_report.rb | 6 ++++--
 next_rails.gemspec              | 2 +-
 spec/bundle_report_spec.rb      | 2 ++
 5 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/exe/deprecations b/exe/deprecations
index 3d476de..b4712d6 100755
--- a/exe/deprecations
+++ b/exe/deprecations
@@ -1,9 +1,11 @@
 #!/usr/bin/env ruby
 require "json"
-require "colorize"
+require "rainbow/refinement"
 require "optparse"
 require "set"
 
+using Rainbow
+
 def run_tests(deprecation_warnings, opts = {})
   tracker_mode = opts[:tracker_mode]
   next_mode = opts[:next_mode]
diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index 89cd337..7277773 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -1,6 +1,8 @@
-require "colorize"
+require "rainbow/refinement"
 require "json"
 
+using Rainbow
+
 # A shitlist for deprecation warnings during test runs. It has two modes: "save" and "compare"
 #
 # DEPRECATION_TRACKER=save
diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 41b7be4..49070c4 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -1,9 +1,11 @@
-require "colorize"
+require "rainbow/refinement"
 require "cgi"
 require "erb"
 require "json"
 require "net/http"
 
+using Rainbow
+
 module NextRails
   module BundleReport
     extend self
@@ -168,4 +170,4 @@ def output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_count)
       puts footer
     end
   end
-end
\ No newline at end of file
+end
diff --git a/next_rails.gemspec b/next_rails.gemspec
index cf69fe6..e073411 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
   spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
   spec.require_paths = ["lib"]
 
-  spec.add_dependency "colorize", ">= 0.8.1"
+  spec.add_dependency "rainbow", ">= 3"
   spec.add_development_dependency "bundler", ">= 1.16", "< 3.0"
   spec.add_development_dependency "rake"
   spec.add_development_dependency "rspec", "~> 3.0"
diff --git a/spec/bundle_report_spec.rb b/spec/bundle_report_spec.rb
index 0882764..a5c97ae 100644
--- a/spec/bundle_report_spec.rb
+++ b/spec/bundle_report_spec.rb
@@ -5,6 +5,8 @@
 require_relative 'spec_helper'
 require_relative '../lib/next_rails/bundle_report'
 
+using Rainbow
+
 RSpec.describe NextRails::BundleReport do
   describe '.outdated' do
     let(:mock_version) { Struct.new(:version, :age) }

From 2330b3cfb68c13c29ac492ac8afd9d374d75777f Mon Sep 17 00:00:00 2001
From: Tim Kelly <timlkelly@users.noreply.github.com>
Date: Fri, 23 Aug 2024 15:38:23 -0500
Subject: [PATCH 126/171] Update changelog

---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f8eef1..4b51ce5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
 
 * Your changes/patches go here.
 
+- [CHORE: Remove GPL licensed dependency Colorize and replace it with Rainbow]
+
 # v1.3.0 / 2023-06-16 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.4...v1.3.0)
 
 - [FEATURE: Add NextRails.next? for application usage (e.g. Rails shims)](https://github.com/fastruby/next_rails/pull/97)

From ed1746c9f3ba23d6af98fe0a7da575944b8a821b Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 9 Sep 2024 14:38:12 -0400
Subject: [PATCH 127/171] Use rainbows instead of colorize

---
 lib/next_rails/bundle_report/ruby_version_compatibility.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/next_rails/bundle_report/ruby_version_compatibility.rb b/lib/next_rails/bundle_report/ruby_version_compatibility.rb
index 7fa8f74..414cf39 100644
--- a/lib/next_rails/bundle_report/ruby_version_compatibility.rb
+++ b/lib/next_rails/bundle_report/ruby_version_compatibility.rb
@@ -1,6 +1,8 @@
-require "colorize"
+require "rainbow/refinement"
 
 class NextRails::BundleReport::RubyVersionCompatibility
+  using Rainbow
+
   MINIMAL_VERSION = 1.0
   attr_reader :gems, :options
 

From c73bed3f2bf0c66c0d2a0f6dae96b1dad2a982ef Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Mon, 9 Sep 2024 14:39:10 -0400
Subject: [PATCH 128/171] Use Ruby 2.6 and higher

---
 .github/workflows/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index d19c412..b0234f0 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -13,7 +13,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: [3.2, 3.1, 3.0, 2.7, 2.6, 2.5, 2.4, 2.3]
+        ruby-version: ["3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
 
     steps:
       - uses: actions/checkout@v2

From d6daf4d39f9e4f56ea53ea7e3a8f29ea50b9829a Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Sun, 22 Sep 2024 00:04:12 -0600
Subject: [PATCH 129/171] Fix colorize missing call

Pull Request #120 removed Colorize in favor of Rainbow,
`bundle_report/ruby_version_compatibility.rb` was using Colorize and we
need to update it to use Rainbow
---
 CHANGELOG.md                                               | 1 +
 lib/next_rails/bundle_report/ruby_version_compatibility.rb | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 09a3023..c041a1a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
 
 * Your changes/patches go here.
 
+- [CHORE: Update compatibility for Ruby versions to use Rainbow](https://github.com/fastruby/next_rails/pull/125)
 - [FEATURE: Support compatibility for Ruby versions](https://github.com/fastruby/next_rails/pull/116)
 - [CHORE: Remove GPL licensed dependency Colorize and replace it with Rainbow]
 
diff --git a/lib/next_rails/bundle_report/ruby_version_compatibility.rb b/lib/next_rails/bundle_report/ruby_version_compatibility.rb
index 7fa8f74..40ca2cf 100644
--- a/lib/next_rails/bundle_report/ruby_version_compatibility.rb
+++ b/lib/next_rails/bundle_report/ruby_version_compatibility.rb
@@ -1,4 +1,6 @@
-require "colorize"
+require "rainbow/refinement"
+
+using Rainbow
 
 class NextRails::BundleReport::RubyVersionCompatibility
   MINIMAL_VERSION = 1.0

From 94e431a6adb68fdd532dc28067233b1b4c559294 Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Mon, 23 Sep 2024 21:05:09 -0600
Subject: [PATCH 130/171] Remove older ruby tests

Ruby 2.0 does not support Rainbow 3
---
 .github/workflows/main.yml | 16 ----------------
 CHANGELOG.md               |  1 +
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index d19c412..19d5d95 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -24,19 +24,3 @@ jobs:
           bundler-cache: true
       - name: Run rake task
         run: bundle exec rake
-
-  test_older:
-    runs-on: ubuntu-20.04
-    strategy:
-      matrix:
-        ruby-version: [2.2, 2.1, 2.0.0]
-
-    steps:
-      - uses: actions/checkout@v2
-      - name: Set up Ruby ${{ matrix.ruby-version }}
-        uses: ruby/setup-ruby@v1
-        with:
-          ruby-version: ${{ matrix.ruby-version }}
-          bundler-cache: true
-      - name: Run rake task
-        run: bundle exec rake
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c041a1a..d8cd995 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
 
 * Your changes/patches go here.
 
+- [CHORE: Remove 2.0.0, 2.1, 2.2 Ruby support](https://github.com/fastruby/next_rails/pull/126)
 - [CHORE: Update compatibility for Ruby versions to use Rainbow](https://github.com/fastruby/next_rails/pull/125)
 - [FEATURE: Support compatibility for Ruby versions](https://github.com/fastruby/next_rails/pull/116)
 - [CHORE: Remove GPL licensed dependency Colorize and replace it with Rainbow]

From e9a816b388015efe50565a38690a07c55cb51cf9 Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Sun, 19 May 2024 13:51:12 -0600
Subject: [PATCH 131/171] Fix spec namespaces

There were some not needed `require_relative` calls if the `spec` folder
were ordered according to the `lib` folder.

So, I removed them and organized the test suite accordingly the classes at library
---
 CHANGELOG.md                          |  1 +
 spec/bundle_report_spec.rb            | 79 --------------------------
 spec/deprecation_tracker_spec.rb      |  6 +-
 spec/next_rails/bundle_report_spec.rb | 80 ++++++++++++++++++++++++++-
 spec/next_rails/gem_info_spec.rb      | 45 +++++++++++++--
 spec/next_rails_spec.rb               |  4 ++
 spec/ten_years_rails/gem_info_spec.rb | 36 ------------
 7 files changed, 127 insertions(+), 124 deletions(-)
 delete mode 100644 spec/bundle_report_spec.rb
 delete mode 100644 spec/ten_years_rails/gem_info_spec.rb

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d8cd995..8d9d2f0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.3.0...main)
 
 * Your changes/patches go here.
+- [CHORE: Use next_rails namespace on spec tests.](https://github.com/fastruby/next_rails/pull/117)
 
 - [CHORE: Remove 2.0.0, 2.1, 2.2 Ruby support](https://github.com/fastruby/next_rails/pull/126)
 - [CHORE: Update compatibility for Ruby versions to use Rainbow](https://github.com/fastruby/next_rails/pull/125)
diff --git a/spec/bundle_report_spec.rb b/spec/bundle_report_spec.rb
deleted file mode 100644
index a5c97ae..0000000
--- a/spec/bundle_report_spec.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-# frozen_string_literal: true
-
-require 'date'
-require 'tempfile'
-require_relative 'spec_helper'
-require_relative '../lib/next_rails/bundle_report'
-
-using Rainbow
-
-RSpec.describe NextRails::BundleReport do
-  describe '.outdated' do
-    let(:mock_version) { Struct.new(:version, :age) }
-    let(:mock_gem) { Struct.new(:name, :version, :age, :latest_version, :up_to_date?, :created_at, :sourced_from_git?) }
-    let(:format_str) { '%b %e, %Y' }
-    let(:alpha_date) { Date.parse('2022-01-01') }
-    let(:alpha_age) { alpha_date.strftime(format_str) }
-    let(:bravo_date) { Date.parse('2022-02-02') }
-    let(:bravo_age) { bravo_date.strftime(format_str) }
-    let(:charlie_date) { Date.parse('2022-03-03') }
-    let(:charlie_age) { charlie_date.strftime(format_str) }
-
-    before do
-      allow(NextRails::GemInfo).to receive(:all).and_return(
-        [
-          mock_gem.new('alpha', '0.0.1', alpha_age, mock_version.new('0.0.2', bravo_age), false, alpha_date, false),
-          mock_gem.new('bravo', '0.2.0', bravo_age, mock_version.new('0.2.2', charlie_age), false, bravo_date, true)
-        ]
-      )
-    end
-
-    context 'when writing human-readable output' do
-      #subject { described_class.outdated }
-
-      it 'invokes $stdout.puts properly', :aggregate_failures do
-        allow($stdout)
-          .to receive(:puts)
-          .with("#{'alpha 0.0.1'.bold.white}: released #{alpha_age} (latest version, 0.0.2, released #{bravo_age})\n")
-        allow($stdout)
-          .to receive(:puts)
-          .with("#{'bravo 0.2.0'.bold.white}: released #{bravo_age} (latest version, 0.2.2, released #{charlie_age})\n")
-        allow($stdout).to receive(:puts).with('')
-        allow($stdout).to receive(:puts).with(<<-EO_MULTLINE_STRING)
-          #{'1'.yellow} gems are sourced from git
-          #{'2'.red} of the 2 gems are out-of-date (100%)
-        EO_MULTLINE_STRING
-      end
-    end
-
-    context 'when writing JSON output' do
-      it 'JSON is correctly formatted' do
-        gems = NextRails::GemInfo.all
-        out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
-        sourced_from_git = gems.select(&:sourced_from_git?)
-
-        expect(NextRails::BundleReport.build_json(out_of_date_gems, gems.count, sourced_from_git.count)).to eq(
-          {
-            outdated_gems: [
-              { name: 'alpha', installed_version: '0.0.1', installed_age: alpha_age, latest_version: '0.0.2',
-                latest_age: bravo_age },
-              { name: 'bravo', installed_version: '0.2.0', installed_age: bravo_age, latest_version: '0.2.2',
-                latest_age: charlie_age }
-            ],
-            sourced_from_git_count: sourced_from_git.count,
-            total_gem_count: gems.count
-          }
-        )
-      end
-    end
-  end
-
-  describe ".compatibility" do
-    describe "output" do
-      it "returns ERB generated output" do
-        output = NextRails::BundleReport.erb_output({}, [], 7.0)
-        expect(output).to match "gems incompatible with Rails 7.0"
-      end
-    end
-  end
-end
diff --git a/spec/deprecation_tracker_spec.rb b/spec/deprecation_tracker_spec.rb
index e017c0c..a3fda3a 100644
--- a/spec/deprecation_tracker_spec.rb
+++ b/spec/deprecation_tracker_spec.rb
@@ -1,5 +1,9 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+
+require "date"
 require "tempfile"
-require_relative "spec_helper"
 require_relative "../lib/deprecation_tracker"
 
 RSpec::Matchers.define_negated_matcher :not_raise_error, :raise_error
diff --git a/spec/next_rails/bundle_report_spec.rb b/spec/next_rails/bundle_report_spec.rb
index 07b26b5..f69bd8a 100644
--- a/spec/next_rails/bundle_report_spec.rb
+++ b/spec/next_rails/bundle_report_spec.rb
@@ -1,7 +1,81 @@
-require_relative ".././spec_helper"
-require_relative "../../lib/next_rails/bundle_report"
+# frozen_string_literal: true
+
+require "rainbow/refinement"
+
+using Rainbow
+
+require "spec_helper"
 
 RSpec.describe NextRails::BundleReport do
+  describe '.outdated' do
+    let(:mock_version) { Struct.new(:version, :age) }
+    let(:mock_gem) { Struct.new(:name, :version, :age, :latest_version, :up_to_date?, :created_at, :sourced_from_git?) }
+    let(:format_str) { '%b %e, %Y' }
+    let(:alpha_date) { Date.parse('2022-01-01') }
+    let(:alpha_age) { alpha_date.strftime(format_str) }
+    let(:bravo_date) { Date.parse('2022-02-02') }
+    let(:bravo_age) { bravo_date.strftime(format_str) }
+    let(:charlie_date) { Date.parse('2022-03-03') }
+    let(:charlie_age) { charlie_date.strftime(format_str) }
+
+    before do
+      allow(NextRails::GemInfo).to receive(:all).and_return(
+        [
+          mock_gem.new('alpha', '0.0.1', alpha_age, mock_version.new('0.0.2', bravo_age), false, alpha_date, false),
+          mock_gem.new('bravo', '0.2.0', bravo_age, mock_version.new('0.2.2', charlie_age), false, bravo_date, true)
+        ]
+      )
+    end
+
+    context 'when writing human-readable output' do
+      #subject { described_class.outdated }
+
+      it 'invokes $stdout.puts properly', :aggregate_failures do
+        allow($stdout)
+          .to receive(:puts)
+          .with("#{'alpha 0.0.1'.bold.white}: released #{alpha_age} (latest version, 0.0.2, released #{bravo_age})\n")
+        allow($stdout)
+          .to receive(:puts)
+          .with("#{'bravo 0.2.0'.bold.white}: released #{bravo_age} (latest version, 0.2.2, released #{charlie_age})\n")
+        allow($stdout).to receive(:puts).with('')
+        allow($stdout).to receive(:puts).with(<<-EO_MULTLINE_STRING)
+          #{'1'.yellow} gems are sourced from git
+          #{'2'.red} of the 2 gems are out-of-date (100%)
+        EO_MULTLINE_STRING
+      end
+    end
+
+    context 'when writing JSON output' do
+      it 'JSON is correctly formatted' do
+        gems = NextRails::GemInfo.all
+        out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
+        sourced_from_git = gems.select(&:sourced_from_git?)
+
+        expect(NextRails::BundleReport.build_json(out_of_date_gems, gems.count, sourced_from_git.count)).to eq(
+          {
+            outdated_gems: [
+              { name: 'alpha', installed_version: '0.0.1', installed_age: alpha_age, latest_version: '0.0.2',
+                latest_age: bravo_age },
+              { name: 'bravo', installed_version: '0.2.0', installed_age: bravo_age, latest_version: '0.2.2',
+                latest_age: charlie_age }
+            ],
+            sourced_from_git_count: sourced_from_git.count,
+            total_gem_count: gems.count
+          }
+        )
+      end
+    end
+  end
+
+  describe ".compatibility" do
+    describe "output" do
+      it "returns ERB generated output" do
+        output = NextRails::BundleReport.erb_output({}, [], 7.0)
+        expect(output).to match "gems incompatible with Rails 7.0"
+      end
+    end
+  end
+
   describe "#compatible_ruby_version" do
     context "when rails_version is a valid one" do
       it "returns the correct ruby version" do
@@ -18,7 +92,7 @@
         expect(ruby_version).to eq(">= 2.7.0")
       end
     end
-    
+
     context "when rails_version is an invalid one" do
       it "returns nil for ruby version" do
         rails_version = { rails_version: "0.0.0" }
diff --git a/spec/next_rails/gem_info_spec.rb b/spec/next_rails/gem_info_spec.rb
index 169d96e..043a741 100644
--- a/spec/next_rails/gem_info_spec.rb
+++ b/spec/next_rails/gem_info_spec.rb
@@ -1,10 +1,46 @@
-require_relative ".././spec_helper"
-require_relative "../../lib/next_rails/gem_info"
+# frozen_string_literal: true
+
+require "spec_helper"
+
+require "timecop"
 
 RSpec.describe NextRails::GemInfo do
+  let(:release_date) { Time.utc(2019, 7, 6, 0, 0, 0) }
+  let(:now) { Time.utc(2019, 7, 6, 12, 0, 0) }
+  let(:spec) do
+    Gem::Specification.new do |s|
+      s.date = release_date
+      s.version = "1.0.0"
+    end
+  end
+
+  subject { NextRails::GemInfo.new(spec) }
+
+  describe "#age" do
+    around do |example|
+      Timecop.travel(now) do
+        example.run
+      end
+    end
+
+    let(:result) { now.strftime("%b %e, %Y") }
+
+    it "returns a date" do
+      expect(subject.age).to eq(result)
+    end
+  end
+
+  describe "#up_to_date?" do
+    it "is up to date" do
+      allow(Gem).to receive(:latest_spec_for).and_return(spec)
+      expect(subject.up_to_date?).to be_truthy
+    end
+  end
+
   describe "#state" do
     let(:mock_gem) { Struct.new(:name, :version, :runtime_dependencies) }
     let(:mocked_dependency) { Struct.new(:name, :requirement) }
+
     it "returns :incompatible if gem specifies a rails dependency but no compatible version is found" do
       # set up a mock gem with with a rails dependency that is unsatisfied by the version given
       mocked_dependency_requirement = double("requirement")
@@ -36,11 +72,11 @@
 
       expect(gem_info.state(rails_version)).to eq(:no_new_version)
     end
-
   end
 
   describe "#find_latest_compatible" do
     let(:mock_gem) { Struct.new(:name, :version) }
+
     it "sets latest_compatible_version to NullGem if no specs are found" do
       gem = mock_gem.new('gem_name', "0.0.1")
 
@@ -53,6 +89,5 @@
       gem_info.find_latest_compatible
       expect(gem_info.latest_compatible_version).to be_a(NextRails::GemInfo::NullGemInfo)
     end
-
   end
-end
\ No newline at end of file
+end
diff --git a/spec/next_rails_spec.rb b/spec/next_rails_spec.rb
index 9a6ca3f..34c0d17 100644
--- a/spec/next_rails_spec.rb
+++ b/spec/next_rails_spec.rb
@@ -1,3 +1,7 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+
 require "fileutils"
 
 RSpec.describe NextRails do
diff --git a/spec/ten_years_rails/gem_info_spec.rb b/spec/ten_years_rails/gem_info_spec.rb
deleted file mode 100644
index 77970d0..0000000
--- a/spec/ten_years_rails/gem_info_spec.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-require "spec_helper"
-require "timecop"
-
-RSpec.describe NextRails::GemInfo do
-  let(:release_date) { Time.utc(2019, 7, 6, 0, 0, 0) }
-  let(:now) { Time.utc(2019, 7, 6, 12, 0, 0) }
-  let(:spec) do
-    Gem::Specification.new do |s|
-      s.date = release_date
-      s.version = "1.0.0"
-    end
-  end
-
-  subject { NextRails::GemInfo.new(spec) }
-
-  describe "#age" do
-    around do |example|
-      Timecop.travel(now) do
-        example.run
-      end
-    end
-
-    let(:result) { now.strftime("%b %e, %Y") }
-
-    it "returns a date" do
-      expect(subject.age).to eq(result)
-    end
-  end
-
-  describe "#up_to_date?" do
-    it "is up to date" do
-      allow(Gem).to receive(:latest_spec_for).and_return(spec)
-      expect(subject.up_to_date?).to be_truthy
-    end
-  end
-end

From ca33d92b2a9529b32bba6b85e2c3cdfba4f3f23a Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Tue, 24 Sep 2024 10:27:26 -0400
Subject: [PATCH 132/171] Update README.md

Fixes #27
---
 README.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.md b/README.md
index d6a4add..6eec4b0 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 # Next Rails
 
+[![Continuous Integration](https://github.com/fastruby/next_rails/actions/workflows/main.yml/badge.svg)](https://github.com/fastruby/next_rails/actions/workflows/main.yml)
+
 This is a toolkit to upgrade your next Rails application. It will help you
 set up dual booting, track deprecation warnings, and get a report on outdated
 dependencies for any Rails application.

From ffa6b4af2460ff8b7fb8d89a8a6b649c0ba4ca24 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Tue, 24 Sep 2024 10:28:28 -0400
Subject: [PATCH 133/171] Update main.yml

More explicit workflow name
---
 .github/workflows/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a5c19f8..9cf0d16 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,4 +1,4 @@
-name: Run rake task
+name: Continuous Integration
 
 on:
   push:

From 440db37e4160ebabaa4e70ea3a54629271251428 Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Tue, 24 Sep 2024 23:09:38 -0600
Subject: [PATCH 134/171] Release work for v1.4.0

---
 CHANGELOG.md              | 6 ++++--
 lib/next_rails/version.rb | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d9d2f0..c49644c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,10 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.3.0...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.0...main)
 
 * Your changes/patches go here.
-- [CHORE: Use next_rails namespace on spec tests.](https://github.com/fastruby/next_rails/pull/117)
 
+# v1.4.0 / 2024-09-24 [(commits)](https://github.com/fastruby/next_rails/compare/v1.3.0...v1.4.0)
+
+- [CHORE: Use next_rails namespace on spec tests.](https://github.com/fastruby/next_rails/pull/117)
 - [CHORE: Remove 2.0.0, 2.1, 2.2 Ruby support](https://github.com/fastruby/next_rails/pull/126)
 - [CHORE: Update compatibility for Ruby versions to use Rainbow](https://github.com/fastruby/next_rails/pull/125)
 - [FEATURE: Support compatibility for Ruby versions](https://github.com/fastruby/next_rails/pull/116)
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index e738d56..ef27762 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.3.0"
+  VERSION = "1.4.0"
 end

From e50e05a0d5e11124e48e8bfc89737e82f2c9bd83 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 30 Sep 2024 20:28:30 +0000
Subject: [PATCH 135/171] Update rexml requirement from = 3.1.7.3 to = 3.3.8

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
---
 next_rails.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index e073411..197957b 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -29,6 +29,6 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
   spec.add_development_dependency "byebug"
-  spec.add_development_dependency "rexml", "3.1.7.3" # limited on purpose, new versions don't work with old rubies
+  spec.add_development_dependency "rexml", "3.3.8" # limited on purpose, new versions don't work with old rubies
   spec.add_development_dependency "webmock", "3.16.2" # limited on purpose, new versions don't work with old rubies
 end

From bb9f0ae269621c93aec3e5d0dcac01859ea46b60 Mon Sep 17 00:00:00 2001
From: Jan Bator <jan@bloomandwild.com>
Date: Tue, 22 Oct 2024 15:04:41 +0200
Subject: [PATCH 136/171] Use Rainbow directly instead of relying on String
 refinement.

---
 exe/bundle_report                             |  2 +-
 exe/deprecations                              | 14 ++++-----
 lib/deprecation_tracker.rb                    |  8 ++---
 lib/next_rails/bundle_report.rb               | 30 +++++++++----------
 .../ruby_version_compatibility.rb             | 12 ++++----
 spec/next_rails/bundle_report_spec.rb         | 13 ++++----
 6 files changed, 34 insertions(+), 45 deletions(-)

diff --git a/exe/bundle_report b/exe/bundle_report
index d8b92de..0708464 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -55,7 +55,7 @@ at_exit do
   begin
     option_parser.parse!
   rescue OptionParser::ParseError => e
-    STDERR.puts e.message.red
+    STDERR.puts Rainbow(e.message).red
     puts option_parser
     exit 1
   end
diff --git a/exe/deprecations b/exe/deprecations
index b4712d6..60f366e 100755
--- a/exe/deprecations
+++ b/exe/deprecations
@@ -1,11 +1,9 @@
 #!/usr/bin/env ruby
 require "json"
-require "rainbow/refinement"
+require "rainbow"
 require "optparse"
 require "set"
 
-using Rainbow
-
 def run_tests(deprecation_warnings, opts = {})
   tracker_mode = opts[:tracker_mode]
   next_mode = opts[:next_mode]
@@ -30,11 +28,11 @@ def print_info(deprecation_warnings, opts = {})
     end
   end.sort_by {|message, data| data[:occurrences] }.reverse.to_h
 
-  puts "Ten most common deprecation warnings:".underline
+  puts Rainbow("Ten most common deprecation warnings:").underline
   frequency_by_message.take(10).each do |message, data|
-    puts "Occurrences: #{data.fetch(:occurrences)}".bold
+    puts Rainbow("Occurrences: #{data.fetch(:occurrences)}").bold
     puts "Test files: #{data.fetch(:test_files).to_a.join(" ")}" if verbose
-    puts message.red
+    puts Rainbow(message).red
     puts "----------"
   end
 end
@@ -106,10 +104,10 @@ case options.fetch(:mode, "info")
 when "run" then run_tests(deprecation_warnings, next_mode: options[:next], tracker_mode: options[:tracker_mode])
 when "info" then print_info(deprecation_warnings, verbose: options[:verbose])
 when nil
-  STDERR.puts "Must pass a mode: run or info".red
+  STDERR.puts Rainbow("Must pass a mode: run or info").red
   puts option_parser
   exit 1
 else
-  STDERR.puts "Unknown mode: #{options[:mode]}".red
+  STDERR.puts Rainbow("Unknown mode: #{options[:mode]}").red
   exit 1
 end
diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index 7277773..7d76360 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -1,8 +1,6 @@
-require "rainbow/refinement"
+require "rainbow"
 require "json"
 
-using Rainbow
-
 # A shitlist for deprecation warnings during test runs. It has two modes: "save" and "compare"
 #
 # DEPRECATION_TRACKER=save
@@ -152,7 +150,7 @@ def compare
     end
 
     if changed_buckets.length > 0
-      message = <<-MESSAGE.red
+      message = <<-MESSAGE
         ⚠️  Deprecation warnings have changed!
 
         Code called by the following spec files is now generating different deprecation warnings:
@@ -170,7 +168,7 @@ def compare
         See \e[4;37mdev-docs/testing/deprecation_tracker.md\e[0;31m for more information.
       MESSAGE
 
-      raise UnexpectedDeprecations, message
+      raise UnexpectedDeprecations, Rainbow(message).red
     end
   end
 
diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index d30812b..bd74639 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -1,11 +1,9 @@
-require "rainbow/refinement"
+require "rainbow"
 require "cgi"
 require "erb"
 require "json"
 require "net/http"
 
-using Rainbow
-
 module NextRails
   module BundleReport
     extend self
@@ -27,8 +25,8 @@ def compatibility(rails_version: nil, ruby_version: nil, include_rails_gems: nil
     def erb_output(incompatible_gems_by_state, incompatible_gems, rails_version)
       template = <<-ERB
 <% if incompatible_gems_by_state[:found_compatible] -%>
-<%= "=> Incompatible with Rails #{rails_version} (with new versions that are compatible):".white.bold %>
-<%= "These gems will need to be upgraded before upgrading to Rails #{rails_version}.".italic %>
+<%= Rainbow("=> Incompatible with Rails #{rails_version} (with new versions that are compatible):").white.bold %>
+<%= Rainbow("These gems will need to be upgraded before upgrading to Rails #{rails_version}.").italic %>
 
 <% incompatible_gems_by_state[:found_compatible].each do |gem| -%>
 <%= gem_header(gem) %> - upgrade to <%= gem.latest_compatible_version.version %>
@@ -36,8 +34,8 @@ def erb_output(incompatible_gems_by_state, incompatible_gems, rails_version)
 
 <% end -%>
 <% if incompatible_gems_by_state[:incompatible] -%>
-<%= "=> Incompatible with Rails #{rails_version} (with no new compatible versions):".white.bold %>
-<%= "These gems will need to be removed or replaced before upgrading to Rails #{rails_version}.".italic %>
+<%= Rainbow("=> Incompatible with Rails #{rails_version} (with no new compatible versions):").white.bold %>
+<%= Rainbow("These gems will need to be removed or replaced before upgrading to Rails #{rails_version}.").italic %>
 
 <% incompatible_gems_by_state[:incompatible].each do |gem| -%>
 <%= gem_header(gem) %> - new version, <%= gem.latest_version.version %>, is not compatible with Rails #{rails_version}
@@ -45,16 +43,16 @@ def erb_output(incompatible_gems_by_state, incompatible_gems, rails_version)
 
 <% end -%>
 <% if incompatible_gems_by_state[:no_new_version] -%>
-<%= "=> Incompatible with Rails #{rails_version} (with no new versions):".white.bold %>
-<%= "These gems will need to be upgraded by us or removed before upgrading to Rails #{rails_version}.".italic %>
-<%= "This list is likely to contain internal gems, like Cuddlefish.".italic %>
+<%= Rainbow("=> Incompatible with Rails #{rails_version} (with no new versions):").white.bold %>
+<%= Rainbow("These gems will need to be upgraded by us or removed before upgrading to Rails #{rails_version}.").italic %>
+<%= Rainbow("This list is likely to contain internal gems, like Cuddlefish.").italic %>
 
 <% incompatible_gems_by_state[:no_new_version].each do |gem| -%>
 <%= gem_header(gem) %> - new version not found
 <% end -%>
 
 <% end -%>
-<%= incompatible_gems.length.to_s.red %> gems incompatible with Rails <%= rails_version %>
+<%= Rainbow(incompatible_gems.length.to_s).red %> gems incompatible with Rails <%= rails_version %>
       ERB
 
       erb_version = ERB.version
@@ -70,8 +68,8 @@ def erb_output(incompatible_gems_by_state, incompatible_gems, rails_version)
     end
 
     def gem_header(_gem)
-      header = "#{_gem.name} #{_gem.version}".bold
-      header << " (loaded from git)".magenta if _gem.sourced_from_git?
+      header = Rainbow("#{_gem.name} #{_gem.version}").bold
+      header << Rainbow(" (loaded from git)").magenta if _gem.sourced_from_git?
       header
     end
 
@@ -158,14 +156,14 @@ def output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_count)
         header = "#{gem.name} #{gem.version}"
 
         puts <<-MESSAGE
-          #{header.bold.white}: released #{gem.age} (latest version, #{gem.latest_version.version}, released #{gem.latest_version.age})
+          #{Rainbow(header.bold.white)}: released #{gem.age} (latest version, #{gem.latest_version.version}, released #{gem.latest_version.age})
         MESSAGE
       end
 
       percentage_out_of_date = ((out_of_date_gems.count / total_gem_count.to_f) * 100).round
       footer = <<-MESSAGE
-        #{sourced_from_git_count.to_s.yellow} gems are sourced from git
-        #{out_of_date_gems.count.to_s.red} of the #{total_gem_count} gems are out-of-date (#{percentage_out_of_date}%)
+        #{Rainbow(sourced_from_git_count.to_s).yellow} gems are sourced from git
+        #{Rainbow(out_of_date_gems.count.to_s).red} of the #{total_gem_count} gems are out-of-date (#{percentage_out_of_date}%)
       MESSAGE
 
       puts ''
diff --git a/lib/next_rails/bundle_report/ruby_version_compatibility.rb b/lib/next_rails/bundle_report/ruby_version_compatibility.rb
index 414cf39..c841275 100644
--- a/lib/next_rails/bundle_report/ruby_version_compatibility.rb
+++ b/lib/next_rails/bundle_report/ruby_version_compatibility.rb
@@ -1,8 +1,6 @@
-require "rainbow/refinement"
+require "rainbow"
 
 class NextRails::BundleReport::RubyVersionCompatibility
-  using Rainbow
-
   MINIMAL_VERSION = 1.0
   attr_reader :gems, :options
 
@@ -20,11 +18,11 @@ def generate
   private
 
   def message
-    output = "=> Incompatible gems with Ruby #{ruby_version}:".white.bold
+    output = Rainbow("=> Incompatible gems with Ruby #{ruby_version}:").white.bold
     incompatible.each do |gem|
-      output += "\n#{gem.name} - required Ruby version: #{gem.gem_specification.required_ruby_version}".magenta
+      output += Rainbow("\n#{gem.name} - required Ruby version: #{gem.gem_specification.required_ruby_version}").magenta
     end
-    output += "\n\n#{incompatible.length} incompatible #{incompatible.one? ? 'gem' : 'gems' } with Ruby #{ruby_version}".red
+    output += Rainbow("\n\n#{incompatible.length} incompatible #{incompatible.one? ? 'gem' : 'gems' } with Ruby #{ruby_version}").red
     output
   end
 
@@ -37,7 +35,7 @@ def ruby_version
   end
 
   def invalid_message
-    "=> Invalid Ruby version: #{options[:ruby_version]}.".red.bold
+    Rainbow("=> Invalid Ruby version: #{options[:ruby_version]}.").red.bold
   end
 
   def valid?
diff --git a/spec/next_rails/bundle_report_spec.rb b/spec/next_rails/bundle_report_spec.rb
index f69bd8a..e159a7a 100644
--- a/spec/next_rails/bundle_report_spec.rb
+++ b/spec/next_rails/bundle_report_spec.rb
@@ -1,9 +1,6 @@
 # frozen_string_literal: true
 
-require "rainbow/refinement"
-
-using Rainbow
-
+require "rainbow"
 require "spec_helper"
 
 RSpec.describe NextRails::BundleReport do
@@ -33,14 +30,14 @@
       it 'invokes $stdout.puts properly', :aggregate_failures do
         allow($stdout)
           .to receive(:puts)
-          .with("#{'alpha 0.0.1'.bold.white}: released #{alpha_age} (latest version, 0.0.2, released #{bravo_age})\n")
+          .with("#{Rainbow('alpha 0.0.1').bold.white}: released #{alpha_age} (latest version, 0.0.2, released #{bravo_age})\n")
         allow($stdout)
           .to receive(:puts)
-          .with("#{'bravo 0.2.0'.bold.white}: released #{bravo_age} (latest version, 0.2.2, released #{charlie_age})\n")
+          .with("#{Rainbow('bravo 0.2.0').bold.white}: released #{bravo_age} (latest version, 0.2.2, released #{charlie_age})\n")
         allow($stdout).to receive(:puts).with('')
         allow($stdout).to receive(:puts).with(<<-EO_MULTLINE_STRING)
-          #{'1'.yellow} gems are sourced from git
-          #{'2'.red} of the 2 gems are out-of-date (100%)
+          #{Rainbow('1').yellow} gems are sourced from git
+          #{Rainbow('2').red} of the 2 gems are out-of-date (100%)
         EO_MULTLINE_STRING
       end
     end

From 706daa8111efcff02ae499415277023b4305dcc3 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Tue, 22 Oct 2024 22:25:32 -0400
Subject: [PATCH 137/171] Bump new version of next_rails

---
 CHANGELOG.md              | 4 ++++
 lib/next_rails/version.rb | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c49644c..eaed30b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
 
 * Your changes/patches go here.
 
+# v1.4.1 / 2024-10-22 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.0...v1.4.1)
+
+- [BUGFIX: Fix performance regression due to rainbow refinement](https://github.com/fastruby/next_rails/pull/131)
+
 # v1.4.0 / 2024-09-24 [(commits)](https://github.com/fastruby/next_rails/compare/v1.3.0...v1.4.0)
 
 - [CHORE: Use next_rails namespace on spec tests.](https://github.com/fastruby/next_rails/pull/117)
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index ef27762..fe11ec6 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.4.0"
+  VERSION = "1.4.1"
 end

From 172b00f9824e056ea15b46e80534e067acb6347b Mon Sep 17 00:00:00 2001
From: Mikeify <mmotherwell@gmail.com>
Date: Fri, 25 Oct 2024 19:41:45 +1100
Subject: [PATCH 138/171] fix(rainbow change): the methods (bold & white) are
 not on String but Rainbow

---
 lib/next_rails/bundle_report.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index bd74639..771035c 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -156,7 +156,7 @@ def output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_count)
         header = "#{gem.name} #{gem.version}"
 
         puts <<-MESSAGE
-          #{Rainbow(header.bold.white)}: released #{gem.age} (latest version, #{gem.latest_version.version}, released #{gem.latest_version.age})
+          #{Rainbow(header).bold.white}: released #{gem.age} (latest version, #{gem.latest_version.version}, released #{gem.latest_version.age})
         MESSAGE
       end
 

From 05fcfe1ef11e383c9d95a4100322824f21dd4eb5 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 25 Oct 2024 13:39:48 -0400
Subject: [PATCH 139/171] Bump version to 1.4.2 and document the patch

---
 CHANGELOG.md              | 6 +++++-
 lib/next_rails/version.rb | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index eaed30b..84b58ff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,11 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.0...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.2...main)
 
 * Your changes/patches go here.
 
+# v1.4.2 / 2024-10-25 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.1...v1.4.2)
+
+- [BUGFIX: Rainbow patch: the methods (bold & white) are not on String](https://github.com/fastruby/next_rails/pull/132)
+
 # v1.4.1 / 2024-10-22 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.0...v1.4.1)
 
 - [BUGFIX: Fix performance regression due to rainbow refinement](https://github.com/fastruby/next_rails/pull/131)
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index fe11ec6..a47cebd 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.4.1"
+  VERSION = "1.4.2"
 end

From 816e5b6434811fc766a0da2219b78b28598708aa Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Tue, 4 Feb 2025 13:38:38 -0600
Subject: [PATCH 140/171] Add Ruby 3.4 support

Ruby 3.4 is removing the `base64` default gem to [became bundled](https://rubyreferences.github.io/rubychanges/3.4.html#default-gems-that-became-bundled)

Making the current webmock (v3.16.2) gem incompatible because it has a dependency on the `base64` gem,
to fix it we are bumping webmock to v3.20.0 which [removed the
`base64`](https://github.com/bblimke/webmock/pull/1046) dependency.

> [!NOTE]
> As an alternative solution, we can leave the current `webmock` version untoched
and add the `base64` gem as a dependency.
---
 .github/workflows/main.yml | 2 +-
 CHANGELOG.md               | 2 ++
 next_rails.gemspec         | 4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9cf0d16..caf6872 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -13,7 +13,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: ["3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
+        ruby-version: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
 
     steps:
       - uses: actions/checkout@v2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 84b58ff..a3b3708 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,7 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.2...main)
 
+- [Add Ruby 3.4 support](https://github.com/fastruby/next_rails/pull/133)
+
 * Your changes/patches go here.
 
 # v1.4.2 / 2024-10-25 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.1...v1.4.2)
diff --git a/next_rails.gemspec b/next_rails.gemspec
index 197957b..7d6713f 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
   spec.homepage     = "https://github.com/fastruby/next_rails"
   spec.license       = "MIT"
 
-  spec.required_ruby_version = ">= 2.0"
+  spec.required_ruby_version = ">= 2.0", "< 3.5"
 
   spec.files         = `git ls-files -z`.split("\x0").reject do |f|
     f.match(%r{^(test|spec|features)/})
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "timecop", "~> 0.9.1"
   spec.add_development_dependency "byebug"
   spec.add_development_dependency "rexml", "3.3.8" # limited on purpose, new versions don't work with old rubies
-  spec.add_development_dependency "webmock", "3.16.2" # limited on purpose, new versions don't work with old rubies
+  spec.add_development_dependency "webmock", "3.20.0"
 end

From 626f4ebd22488d546b91f0facfe1142bc468fed8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20V=C3=A1squez?= <juan@ombulabs.com>
Date: Thu, 6 Feb 2025 22:37:18 -0600
Subject: [PATCH 141/171] Update next_rails.gemspec

---
 next_rails.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 7d6713f..dc59c4b 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
   spec.homepage     = "https://github.com/fastruby/next_rails"
   spec.license       = "MIT"
 
-  spec.required_ruby_version = ">= 2.0", "< 3.5"
+  spec.required_ruby_version = ">= 2.0"
 
   spec.files         = `git ls-files -z`.split("\x0").reject do |f|
     f.match(%r{^(test|spec|features)/})

From d6788535aa0cc81d4a2ef9fe137b1ca939f17cf8 Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Mon, 17 Feb 2025 16:09:14 -0600
Subject: [PATCH 142/171] Add next_rails --init to replace next --init

1. I added a message to deprecate the current `next --init` command
   (eventually, we should remove it).
2. Moved the `next --init` functionality into the `NextRails::Init` class
3. Still need to move the `bundle exec next` functionallity. (next step? depends on the acceptance of this PR).

Closes https://github.com/fastruby/next_rails/issues/113
---
 CHANGELOG.md                 |  1 +
 exe/next.sh                  |  1 +
 exe/next_rails               |  7 +++
 lib/next_rails.rb            |  1 +
 lib/next_rails/init.rb       | 82 ++++++++++++++++++++++++++++++++++++
 spec/next_rails/init_spec.rb | 64 ++++++++++++++++++++++++++++
 6 files changed, 156 insertions(+)
 create mode 100644 lib/next_rails/init.rb
 create mode 100644 spec/next_rails/init_spec.rb

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a3b3708..cf4855d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.2...main)
 
+- [Add next_rails --init](https://github.com/fastruby/next_rails/pull/139)
 - [Add Ruby 3.4 support](https://github.com/fastruby/next_rails/pull/133)
 
 * Your changes/patches go here.
diff --git a/exe/next.sh b/exe/next.sh
index 2681395..510c8d0 100755
--- a/exe/next.sh
+++ b/exe/next.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 if [[ "${@}" == "--init" ]]; then
+  echo "The next --init command is deprecated. Please use the next_rails --init command instead."
   # Add next? top of Gemfile
   cat <<-STRING > Gemfile.tmp
 def next?
diff --git a/exe/next_rails b/exe/next_rails
index c7bf342..4c686c5 100755
--- a/exe/next_rails
+++ b/exe/next_rails
@@ -1,6 +1,7 @@
 #!/usr/bin/env ruby
 require "optparse"
 require "next_rails/version"
+require "next_rails"
 
 options = {}
 option_parser = OptionParser.new do |opts|
@@ -11,6 +12,10 @@ option_parser = OptionParser.new do |opts|
       bin/next_rails --version info # Show the version of the gem installed
   MESSAGE
 
+  opts.on("--init", "Setup the dual-boot configuration") do
+    options[:init] = true
+  end
+
   opts.on("--version", "show version of the gem") do
     options[:version] = true
   end
@@ -23,6 +28,8 @@ end
 
 option_parser.parse!
 
+puts NextRails::Init.call if options.fetch(:init, false)
+
 if options.fetch(:version, false)
   puts NextRails::VERSION
   exit 2
diff --git a/lib/next_rails.rb b/lib/next_rails.rb
index 7da5a14..27412cf 100644
--- a/lib/next_rails.rb
+++ b/lib/next_rails.rb
@@ -2,6 +2,7 @@
 
 require "next_rails/gem_info"
 require "next_rails/version"
+require "next_rails/init"
 require "next_rails/bundle_report"
 require "next_rails/bundle_report/ruby_version_compatibility"
 require "deprecation_tracker"
diff --git a/lib/next_rails/init.rb b/lib/next_rails/init.rb
new file mode 100644
index 0000000..2ce6c7d
--- /dev/null
+++ b/lib/next_rails/init.rb
@@ -0,0 +1,82 @@
+# frozen_string_literal: true
+
+require 'fileutils'
+
+module NextRails
+  # This class is responsible for installing the dual-boot files for your.
+  class Init
+    def self.call
+      new.call
+    end
+
+    def call
+      return gemfiles_message unless gemfiles?
+      return next_gemfiles_message if next_gemfiles?
+
+      add_next_conditional
+      create_sym_link
+      copy_gemfile_lock
+      message
+    end
+
+    private
+
+    def gemfiles?
+      %w[Gemfile Gemfile.lock].any? { |file| File.exist?(file) }
+    end
+
+    def gemfiles_message
+      'You must have a Gemfile and Gemfile.lock to run the next_rails --init command.'
+    end
+
+    def next_gemfiles?
+      %w[Gemfile.next Gemfile.next.lock].any? { |file| File.exist?(file) }
+    end
+
+    def next_gemfiles_message
+      'The next_rails --init command has already been run.'
+    end
+
+    def add_next_conditional
+      File.open('Gemfile.tmp', 'w') do |file|
+        file.write <<-STRING
+def next?
+  File.basename(__FILE__) == "Gemfile.next"
+end
+        STRING
+      end
+
+      File.open('Gemfile', 'r') do |original|
+        File.open('Gemfile.tmp', 'a') do |temp|
+          temp.write(original.read)
+        end
+      end
+
+      File.rename('Gemfile.tmp', 'Gemfile')
+    end
+
+    def create_sym_link
+      File.symlink('Gemfile', 'Gemfile.next')
+    end
+
+    def copy_gemfile_lock
+      FileUtils.cp('Gemfile.lock', 'Gemfile.next.lock')
+    end
+
+    def message
+      <<-MESSAGE
+Created Gemfile.next (a symlink to your Gemfile). Your Gemfile has been modified to support dual-booting!
+
+There's just one more step: modify your Gemfile to use a newer version of Rails using the \`next?\` helper method.
+
+For example, here's how to go from 5.2.8.1 to 6.0.6.1:
+
+if next?
+  gem "rails", "6.0.6.1"
+else
+  gem "rails", "5.2.8.1"
+end
+      MESSAGE
+    end
+  end
+end
diff --git a/spec/next_rails/init_spec.rb b/spec/next_rails/init_spec.rb
new file mode 100644
index 0000000..37a2615
--- /dev/null
+++ b/spec/next_rails/init_spec.rb
@@ -0,0 +1,64 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require 'fileutils'
+
+RSpec.describe NextRails::Init do
+  let(:gemfile_content) { "source 'https://rubygems.org'\ngem 'rails'\n" }
+
+  before(:all) do
+    FileUtils.cp('Gemfile', 'Gemfile.original')
+  end
+
+  after(:all) do
+    FileUtils.cp('Gemfile.original', 'Gemfile')
+    FileUtils.rm_f('Gemfile.original')
+  end
+
+  before do
+    FileUtils.rm_f('Gemfile')
+    FileUtils.rm_f('Gemfile.lock')
+    FileUtils.rm_f('Gemfile.next')
+    FileUtils.rm_f('Gemfile.next.lock')
+  end
+
+  after do
+    FileUtils.rm_f('Gemfile')
+    FileUtils.rm_f('Gemfile.lock')
+    FileUtils.rm_f('Gemfile.next')
+    FileUtils.rm_f('Gemfile.next.lock')
+  end
+
+  describe '.call' do
+    it 'already has next Gemfile files' do
+      File.write('Gemfile', gemfile_content)
+      FileUtils.touch('Gemfile.lock')
+      File.write('Gemfile.next', gemfile_content)
+
+      expect(described_class.call).to eq('The next_rails --init command has already been run.')
+    end
+
+    it 'does not have Gemfile files' do
+      expect(described_class.call).to eq('You must have a Gemfile and Gemfile.lock to run the next_rails --init command.')
+    end
+
+    it 'creates Gemfile.next and Gemfile.next.lock' do
+      File.write('Gemfile', gemfile_content)
+      FileUtils.touch('Gemfile.lock')
+
+      expect do
+        described_class.call
+      end.to change { File.exist?('Gemfile.next') }.from(false).to(true)
+         .and change { File.exist?('Gemfile.next.lock') }.from(false).to(true)
+    end
+
+    it 'returns a success message' do
+      File.write('Gemfile', gemfile_content)
+      FileUtils.touch('Gemfile.lock')
+
+      message = described_class.call
+      expect(message).to include('Created Gemfile.next (a symlink to your Gemfile).')
+      expect(message).to include("For example, here's how to go from 5.2.8.1 to 6.0.6.1:")
+    end
+  end
+end

From 8a478e353aa69bb5e362f596c2ea9519fb496a2b Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Thu, 20 Feb 2025 15:39:14 -0600
Subject: [PATCH 143/171] Release work for v1.4.3

---
 CHANGELOG.md              | 10 +++++++---
 lib/next_rails/version.rb |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index cf4855d..eccfb1f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,14 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.2...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.3...main)
 
-- [Add next_rails --init](https://github.com/fastruby/next_rails/pull/139)
-- [Add Ruby 3.4 support](https://github.com/fastruby/next_rails/pull/133)
+- [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
 
 * Your changes/patches go here.
 
+# v1.4.3 / 2025-02-20 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.2...v1.4.3)
+
+- [Add next_rails --init](https://github.com/fastruby/next_rails/pull/139)
+- [Add Ruby 3.4 support](https://github.com/fastruby/next_rails/pull/133)
+
 # v1.4.2 / 2024-10-25 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.1...v1.4.2)
 
 - [BUGFIX: Rainbow patch: the methods (bold & white) are not on String](https://github.com/fastruby/next_rails/pull/132)
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index a47cebd..8d4ea73 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.4.2"
+  VERSION = "1.4.3"
 end

From 2b5ed88c2258861cd001335c906ea9cde15e2e6a Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Tue, 25 Feb 2025 10:22:32 -0500
Subject: [PATCH 144/171] Go back to testing with Ruby 2.5 (#141)

---
 .github/workflows/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index caf6872..127d266 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -13,7 +13,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
+        ruby-version: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5"]
 
     steps:
       - uses: actions/checkout@v2

From b0fad6b2bf8688b5b64e7a422f42a2c9926e8af6 Mon Sep 17 00:00:00 2001
From: daugaard <sorendaugaard@wundercapital.com>
Date: Tue, 25 Feb 2025 15:03:41 -0500
Subject: [PATCH 145/171] Update deprecation tracking for newer Rails versions

Since Rails 7.1 the preferred way to track deprecations is to use the
deprecation trackers via `Rails.application.deprecators`.

Here we change the implementation to use that if it is available,
otherwise fallback to tracking deprecations via the ActiveSupport
singleton object for older Rails versions.
---
 lib/deprecation_tracker.rb       | 12 ++++++++-
 spec/deprecation_tracker_spec.rb | 42 ++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index 7d76360..c7ade8d 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -73,7 +73,17 @@ def self.init_tracker(opts = {})
     mode = opts[:mode]
     transform_message = opts[:transform_message]
     deprecation_tracker = DeprecationTracker.new(shitlist_path, transform_message, mode)
-    if defined?(ActiveSupport)
+    # Since Rails 7.1 the preferred way to track deprecations is to use the deprecation trackers via
+    # `Rails.application.deprecators`.
+    # We fallback to tracking deprecations via the ActiveSupport singleton object if Rails.application.deprecators is
+    # not defined for older Rails versions.
+    if defined?(Rails) && defined?(Rails.application) && defined?(Rails.application.deprecators)
+      Rails.application.deprecators.each do |deprecator|
+        deprecator.behavior << -> (message, _callstack = nil, _deprecation_horizon = nil, _gem_name = nil) {
+          deprecation_tracker.add(message)
+        }
+      end
+    elsif defined?(ActiveSupport)
       ActiveSupport::Deprecation.behavior << -> (message, _callstack = nil, _deprecation_horizon = nil, _gem_name = nil) {
         deprecation_tracker.add(message)
       }
diff --git a/spec/deprecation_tracker_spec.rb b/spec/deprecation_tracker_spec.rb
index a3fda3a..21d7dfe 100644
--- a/spec/deprecation_tracker_spec.rb
+++ b/spec/deprecation_tracker_spec.rb
@@ -251,6 +251,48 @@
     end
   end
 
+  describe "#init_tracker" do
+    it "returns a new instance of DeprecationTracker" do
+      tracker = DeprecationTracker.init_tracker({mode: "save"})
+      expect(tracker).to be_a(DeprecationTracker)
+    end
+
+    it "subscribes to KernelWarnTracker deprecation events" do
+      expect do
+        DeprecationTracker.init_tracker({mode: "save"})
+      end.to change(DeprecationTracker::KernelWarnTracker.callbacks, :size).by(1)
+    end
+
+    context "when Rails.application.deprecation is not defined and ActiveSupport is defined" do
+      it "sets the ActiveSupport::Deprecation behavior" do
+        # Stub ActiveSupport::Deprecation with a simple behavior array
+        stub_const("ActiveSupport::Deprecation", Class.new {
+          def self.behavior
+            @behavior ||= []
+          end
+        })
+
+        expect do
+          DeprecationTracker.init_tracker({mode: "save"})
+        end.to change(ActiveSupport::Deprecation.behavior, :size).by(1)
+      end
+    end
+
+    context "when Rails.application.deprecation is defined" do
+      it "sets the behavior of each Rails.application.deprecators" do
+        # Stub Rails.application.deprecators with an array of mock deprecators
+        fake_deprecator_1 = double("Deprecator", behavior: [])
+        fake_deprecator_2 = double("Deprecator", behavior: [])
+        stub_const("Rails", Module.new)
+        allow(Rails).to receive_message_chain(:application, :deprecators).and_return([fake_deprecator_1, fake_deprecator_2])
+
+        expect do
+          DeprecationTracker.init_tracker({ mode: "save" })
+        end.to change(fake_deprecator_1.behavior, :size).by(1).and change(fake_deprecator_2.behavior, :size).by(1)
+      end
+    end
+  end
+
   describe DeprecationTracker::KernelWarnTracker do
     it "captures Kernel#warn" do
       warn_messages = []

From d83d1b77b0e7ae9a3c3117d2df23e93395feef74 Mon Sep 17 00:00:00 2001
From: daugaard <sorendaugaard@wundercapital.com>
Date: Tue, 25 Feb 2025 15:18:33 -0500
Subject: [PATCH 146/171] Update changelog.

---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index eccfb1f..2203018 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@
 
 * Your changes/patches go here.
 
+- [FEATURE: Update deprecation tracker to support newer Rails versions (7.1+)](https://github.com/fastruby/next_rails/pull/142)
+
 # v1.4.3 / 2025-02-20 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.2...v1.4.3)
 
 - [Add next_rails --init](https://github.com/fastruby/next_rails/pull/139)

From fa408827b8bf075c25dea905729360e8bcbf8c44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20V=C3=A1squez?= <juan@ombulabs.com>
Date: Wed, 26 Feb 2025 08:21:58 -0600
Subject: [PATCH 147/171] Use next_rails --init in docs (#143)

Since we are deprecating `next --init`, let's stop mentioning it in the
README.md
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 6eec4b0..6fa169a 100644
--- a/README.md
+++ b/README.md
@@ -140,7 +140,7 @@ next_rails --help # For more options and examples
 This command helps you dual-boot your application.
 
 ```bash
-next --init         # Create Gemfile.next and Gemfile.next.lock
+next_next --init    # Create Gemfile.next and Gemfile.next.lock
 vim Gemfile         # Tweak your dependencies conditionally using `next?`
 next bundle install # Install new gems
 next rails s        # Start server using Gemfile.next
@@ -168,7 +168,7 @@ Or install it yourself as:
 
 Execute:
 
-    $ next --init
+    $ next_rails --init
 
 Init will create a Gemfile.next and an initialized Gemfile.next.lock.
 The Gemfile.next.lock is initialized with the contents of your existing

From aca1c12429f861d97dfcea0539acb5c1ed7af1ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20V=C3=A1squez?= <juan@ombulabs.com>
Date: Wed, 26 Feb 2025 12:54:54 -0600
Subject: [PATCH 148/171] Release work for v1.4.4 (#144)

---
 CHANGELOG.md              | 4 +++-
 lib/next_rails/version.rb | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2203018..caffef8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,11 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.3...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.4...main)
 
 - [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
 
 * Your changes/patches go here.
 
+# v1.4.4 / 2025-02-26 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.3...v1.4.4)
+
 - [FEATURE: Update deprecation tracker to support newer Rails versions (7.1+)](https://github.com/fastruby/next_rails/pull/142)
 
 # v1.4.3 / 2025-02-20 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.2...v1.4.3)
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index 8d4ea73..f823a0c 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.4.3"
+  VERSION = "1.4.4"
 end

From 13181a7e07dd0c8b174ff9cac7ef8a1ac36022d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20V=C3=A1squez?= <juan@ombulabs.com>
Date: Fri, 7 Mar 2025 08:57:32 -0600
Subject: [PATCH 149/171] Move bundle_report rails compatibility logic into a
 class (#137)

* Move bundle_report rails compatibility logic into a class

I extracted it into a class because I think it will be easier to use the `incompatible_gems_by_state` data there.

Based on the code review

* Add incompatible with new compatible versions

* Update changelog

* Capture stdout to assert

Co-authored-by: Ariel <ariel@ombulabs.com>

---------

Co-authored-by: Ariel <ariel@ombulabs.com>
---
 CHANGELOG.md                                  |  1 +
 exe/bundle_report                             |  4 +-
 lib/next_rails.rb                             |  1 +
 lib/next_rails/bundle_report.rb               | 67 ++-------------
 .../rails_version_compatibility.rb            | 84 +++++++++++++++++++
 .../rails_version_compatibility_spec.rb       | 40 +++++++++
 .../ruby_version_compatibility_spec.rb        |  1 -
 spec/next_rails/bundle_report_spec.rb         | 19 +++--
 spec/spec_helper.rb                           |  9 ++
 9 files changed, 159 insertions(+), 67 deletions(-)
 create mode 100644 lib/next_rails/bundle_report/rails_version_compatibility.rb
 create mode 100644 spec/next_rails/bundle_report/rails_version_compatibility_spec.rb

diff --git a/CHANGELOG.md b/CHANGELOG.md
index caffef8..667bfcd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.4...main)
 
 - [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
+- [Move rails_version compatibility to its own class](https://github.com/fastruby/next_rails/pull/137)
 
 * Your changes/patches go here.
 
diff --git a/exe/bundle_report b/exe/bundle_report
index 0708464..25bbc8a 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -67,9 +67,9 @@ at_exit do
   when "outdated" then NextRails::BundleReport.outdated(options.fetch(:format, nil))
   else
     if options[:ruby_version]
-      NextRails::BundleReport.compatibility(ruby_version: options.fetch(:ruby_version, "2.3"))
+      NextRails::BundleReport.ruby_compatibility(ruby_version: options.fetch(:ruby_version, "2.3"))
     else
-      NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
+      NextRails::BundleReport.rails_compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
     end
   end
 end
diff --git a/lib/next_rails.rb b/lib/next_rails.rb
index 27412cf..ec8481e 100644
--- a/lib/next_rails.rb
+++ b/lib/next_rails.rb
@@ -5,6 +5,7 @@
 require "next_rails/init"
 require "next_rails/bundle_report"
 require "next_rails/bundle_report/ruby_version_compatibility"
+require "next_rails/bundle_report/rails_version_compatibility"
 require "deprecation_tracker"
 
 module NextRails
diff --git a/lib/next_rails/bundle_report.rb b/lib/next_rails/bundle_report.rb
index 771035c..76fec87 100644
--- a/lib/next_rails/bundle_report.rb
+++ b/lib/next_rails/bundle_report.rb
@@ -8,69 +8,18 @@ module NextRails
   module BundleReport
     extend self
 
-    def compatibility(rails_version: nil, ruby_version: nil, include_rails_gems: nil)
-      return puts RubyVersionCompatibility.new(options: { ruby_version: ruby_version }).generate if ruby_version
+    def ruby_compatibility(ruby_version: nil)
+      return unless ruby_version
 
-      incompatible_gems = NextRails::GemInfo.all.reject do |gem|
-        gem.compatible_with_rails?(rails_version: rails_version) || (!include_rails_gems && gem.from_rails?)
-      end.sort_by { |gem| gem.name }
-
-      incompatible_gems.each { |gem| gem.find_latest_compatible(rails_version: rails_version) }
-
-      incompatible_gems_by_state = incompatible_gems.group_by { |gem| gem.state(rails_version) }
-
-      puts erb_output(incompatible_gems_by_state, incompatible_gems, rails_version)
+      options = { ruby_version: ruby_version }
+      puts RubyVersionCompatibility.new(options: options).generate
     end
 
-    def erb_output(incompatible_gems_by_state, incompatible_gems, rails_version)
-      template = <<-ERB
-<% if incompatible_gems_by_state[:found_compatible] -%>
-<%= Rainbow("=> Incompatible with Rails #{rails_version} (with new versions that are compatible):").white.bold %>
-<%= Rainbow("These gems will need to be upgraded before upgrading to Rails #{rails_version}.").italic %>
-
-<% incompatible_gems_by_state[:found_compatible].each do |gem| -%>
-<%= gem_header(gem) %> - upgrade to <%= gem.latest_compatible_version.version %>
-<% end -%>
-
-<% end -%>
-<% if incompatible_gems_by_state[:incompatible] -%>
-<%= Rainbow("=> Incompatible with Rails #{rails_version} (with no new compatible versions):").white.bold %>
-<%= Rainbow("These gems will need to be removed or replaced before upgrading to Rails #{rails_version}.").italic %>
-
-<% incompatible_gems_by_state[:incompatible].each do |gem| -%>
-<%= gem_header(gem) %> - new version, <%= gem.latest_version.version %>, is not compatible with Rails #{rails_version}
-<% end -%>
-
-<% end -%>
-<% if incompatible_gems_by_state[:no_new_version] -%>
-<%= Rainbow("=> Incompatible with Rails #{rails_version} (with no new versions):").white.bold %>
-<%= Rainbow("These gems will need to be upgraded by us or removed before upgrading to Rails #{rails_version}.").italic %>
-<%= Rainbow("This list is likely to contain internal gems, like Cuddlefish.").italic %>
-
-<% incompatible_gems_by_state[:no_new_version].each do |gem| -%>
-<%= gem_header(gem) %> - new version not found
-<% end -%>
-
-<% end -%>
-<%= Rainbow(incompatible_gems.length.to_s).red %> gems incompatible with Rails <%= rails_version %>
-      ERB
-
-      erb_version = ERB.version
-      if erb_version =~ /erb.rb \[([\d\.]+) .*\]/
-        erb_version = $1
-      end
-
-      if Gem::Version.new(erb_version) < Gem::Version.new("2.2")
-        ERB.new(template, nil, "-").result(binding)
-      else
-        ERB.new(template, trim_mode: "-").result(binding)
-      end
-    end
+    def rails_compatibility(rails_version: nil, include_rails_gems: nil)
+      return unless rails_version
 
-    def gem_header(_gem)
-      header = Rainbow("#{_gem.name} #{_gem.version}").bold
-      header << Rainbow(" (loaded from git)").magenta if _gem.sourced_from_git?
-      header
+      options = { rails_version: rails_version, include_rails_gems: include_rails_gems }
+      puts RailsVersionCompatibility.new(options: options).generate
     end
 
     def compatible_ruby_version(rails_version)
diff --git a/lib/next_rails/bundle_report/rails_version_compatibility.rb b/lib/next_rails/bundle_report/rails_version_compatibility.rb
new file mode 100644
index 0000000..8d661ef
--- /dev/null
+++ b/lib/next_rails/bundle_report/rails_version_compatibility.rb
@@ -0,0 +1,84 @@
+class NextRails::BundleReport::RailsVersionCompatibility
+  def initialize(gems: NextRails::GemInfo.all, options: {})
+    @gems = gems
+    @options = options
+  end
+
+  def generate
+    erb_output
+  end
+
+  def incompatible_gems_by_state
+    @incompatible_gems_by_state ||= begin
+      incompatible_gems.each { |gem| gem.find_latest_compatible(rails_version: rails_version) }
+      incompatible_gems.group_by { |gem| gem.state(rails_version) }
+    end
+  end
+
+  private
+
+  def erb_output
+    template = <<-ERB
+<% if incompatible_gems_by_state[:found_compatible] -%>
+<%= Rainbow("=> Incompatible with Rails #{rails_version} (with new versions that are compatible):").white.bold %>
+<%= Rainbow("These gems will need to be upgraded before upgrading to Rails #{rails_version}.").italic %>
+
+<% incompatible_gems_by_state[:found_compatible].each do |gem| -%>
+<%= gem_header(gem) %> - upgrade to <%= gem.latest_compatible_version.version %>
+<% end -%>
+
+<% end -%>
+<% if incompatible_gems_by_state[:incompatible] -%>
+<%= Rainbow("=> Incompatible with Rails #{rails_version} (with no new compatible versions):").white.bold %>
+<%= Rainbow("These gems will need to be removed or replaced before upgrading to Rails #{rails_version}.").italic %>
+
+<% incompatible_gems_by_state[:incompatible].each do |gem| -%>
+<%= gem_header(gem) %> - new version, <%= gem.latest_version.version %>, is not compatible with Rails #{rails_version}
+<% end -%>
+
+<% end -%>
+<% if incompatible_gems_by_state[:no_new_version] -%>
+<%= Rainbow("=> Incompatible with Rails #{rails_version} (with no new versions):").white.bold %>
+<%= Rainbow("These gems will need to be upgraded by us or removed before upgrading to Rails #{rails_version}.").italic %>
+<%= Rainbow("This list is likely to contain internal gems, like Cuddlefish.").italic %>
+
+<% incompatible_gems_by_state[:no_new_version].each do |gem| -%>
+<%= gem_header(gem) %> - new version not found
+<% end -%>
+
+<% end -%>
+<%= Rainbow(incompatible_gems.length.to_s).red %> gems incompatible with Rails <%= rails_version %>
+    ERB
+
+    erb_version = ERB.version
+    if erb_version =~ /erb.rb \[([\d\.]+) .*\]/
+      erb_version = $1
+    end
+
+    if Gem::Version.new(erb_version) < Gem::Version.new("2.2")
+      ERB.new(template, nil, "-").result(binding)
+    else
+      ERB.new(template, trim_mode: "-").result(binding)
+    end
+  end
+
+  def gem_header(_gem)
+    header = Rainbow("#{_gem.name} #{_gem.version}").bold
+    header << Rainbow(" (loaded from git)").magenta if _gem.sourced_from_git?
+    header
+  end
+
+  def incompatible_gems
+    @incompatible_gems ||= @gems.reject do |gem|
+      gem.compatible_with_rails?(rails_version: rails_version) || (!include_rails_gems && gem.from_rails?)
+    end.sort_by { |gem| gem.name }
+  end
+
+  def rails_version
+    @options[:rails_version]
+  end
+
+  def include_rails_gems
+    @options[:include_rails_gems]
+  end
+end
diff --git a/spec/next_rails/bundle_report/rails_version_compatibility_spec.rb b/spec/next_rails/bundle_report/rails_version_compatibility_spec.rb
new file mode 100644
index 0000000..eda4ca4
--- /dev/null
+++ b/spec/next_rails/bundle_report/rails_version_compatibility_spec.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+
+RSpec.describe NextRails::BundleReport::RailsVersionCompatibility do
+  describe "#generate" do
+    it "returns non incompatible gems" do
+      output = NextRails::BundleReport::RailsVersionCompatibility.new(options: { rails_version: 7.0 }).generate
+      expect(output).to match "gems incompatible with Rails 7.0"
+    end
+
+    it "returns incompatible with compatible versions" do
+      next_rails_version = 7.1
+      specification = Gem::Specification.new do |s|
+        s.name = "audited"
+        s.version = "5.1.0"
+        s.add_dependency "rails", ">= 5.0", "< 7.1"
+      end
+      audited = NextRails::GemInfo.new(specification)
+      gems = [audited]
+
+      allow_any_instance_of(described_class).to receive(:incompatible_gems_by_state)
+        .and_return({ found_compatible: gems })
+
+      allow(audited).to receive(:latest_compatible_version).and_return(Gem::Version.new("5.8.0"))
+
+      output =
+        NextRails::BundleReport::RailsVersionCompatibility.new(
+          gems: gems,
+          options: { rails_version: next_rails_version, include_rails_gems: false }
+        ).generate
+
+      expect(output).to include("Incompatible with Rails 7.1 (with new versions that are compatible):")
+      expect(output).to include("These gems will need to be upgraded before upgrading to Rails 7.1.")
+      expect(output).to include("- upgrade to 5.8.0")
+      expect(output).to include("gems incompatible with Rails 7.1")
+    end
+  end
+end
+
diff --git a/spec/next_rails/bundle_report/ruby_version_compatibility_spec.rb b/spec/next_rails/bundle_report/ruby_version_compatibility_spec.rb
index ff416f3..be617c9 100644
--- a/spec/next_rails/bundle_report/ruby_version_compatibility_spec.rb
+++ b/spec/next_rails/bundle_report/ruby_version_compatibility_spec.rb
@@ -1,7 +1,6 @@
 # frozen_string_literal: true
 
 require "spec_helper"
-require "next_rails/bundle_report/ruby_version_compatibility"
 
 RSpec.describe NextRails::BundleReport::RubyVersionCompatibility do
   let(:ruby_3_0_gem) do
diff --git a/spec/next_rails/bundle_report_spec.rb b/spec/next_rails/bundle_report_spec.rb
index e159a7a..6eeb17a 100644
--- a/spec/next_rails/bundle_report_spec.rb
+++ b/spec/next_rails/bundle_report_spec.rb
@@ -64,12 +64,21 @@
     end
   end
 
-  describe ".compatibility" do
-    describe "output" do
-      it "returns ERB generated output" do
-        output = NextRails::BundleReport.erb_output({}, [], 7.0)
-        expect(output).to match "gems incompatible with Rails 7.0"
+  describe ".rails_compatibility" do
+    it "returns empty output invalid rails version" do
+      output = with_captured_stdout do
+        NextRails::BundleReport.rails_compatibility(rails_version: nil)
       end
+      expect(output).to be_empty
+    end
+  end
+
+  describe ".ruby_compatibility" do
+    it "returns empty output invalid ruby version" do
+      output = with_captured_stdout do
+        NextRails::BundleReport.ruby_compatibility(ruby_version: nil)
+      end
+      expect(output).to be_empty
     end
   end
 
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 819479b..1c55882 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -48,3 +48,12 @@
 def with_env(env_hash)
   stub_const("ENV", ENV.to_hash.merge!(env_hash))
 end
+
+def with_captured_stdout
+  old_stdout = $stdout
+  $stdout = StringIO.new
+  yield
+  $stdout.string
+ensure
+  $stdout = old_stdout
+end

From 2ff7cfa47fa436d9126cf3ac70c4764418919b53 Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Fri, 7 Mar 2025 09:00:24 -0600
Subject: [PATCH 150/171] Release work for v1.4.5

---
 CHANGELOG.md              | 7 +++++--
 lib/next_rails/version.rb | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 667bfcd..4796bf0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,13 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.4...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.5...main)
 
 - [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
-- [Move rails_version compatibility to its own class](https://github.com/fastruby/next_rails/pull/137)
 
 * Your changes/patches go here.
 
+# 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)
+
 # v1.4.4 / 2025-02-26 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.3...v1.4.4)
 
 - [FEATURE: Update deprecation tracker to support newer Rails versions (7.1+)](https://github.com/fastruby/next_rails/pull/142)
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index f823a0c..a94fe14 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.4.4"
+  VERSION = "1.4.5"
 end

From 45d765ef8d70bc5b37bd64368200acd1172ddb47 Mon Sep 17 00:00:00 2001
From: Juan Vasquez <juan@ombulabs.com>
Date: Fri, 7 Mar 2025 12:25:28 -0600
Subject: [PATCH 151/171] Exclude .gem binary to be commited

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index e2ae0d3..235bff1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@
 
 .ruby-version
 Gemfile.lock
+.gem

From 1a0b22b295eeeed1104888771c14fad1c890504c Mon Sep 17 00:00:00 2001
From: Eduardo Navarro <enavarro@suse.com>
Date: Mon, 31 Mar 2025 15:30:53 +0200
Subject: [PATCH 152/171] Fix typo next_next -> next_rails

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 6fa169a..552c8cc 100644
--- a/README.md
+++ b/README.md
@@ -140,7 +140,7 @@ next_rails --help # For more options and examples
 This command helps you dual-boot your application.
 
 ```bash
-next_next --init    # Create Gemfile.next and Gemfile.next.lock
+next_rails --init    # Create Gemfile.next and Gemfile.next.lock
 vim Gemfile         # Tweak your dependencies conditionally using `next?`
 next bundle install # Install new gems
 next rails s        # Start server using Gemfile.next

From 4fa3cd3a6231ac90fee8c1a869445b8de11a320e Mon Sep 17 00:00:00 2001
From: Francois Buys <buys.fran@gmail.com>
Date: Thu, 10 Apr 2025 21:25:23 +0200
Subject: [PATCH 153/171] BUG-149: Fix compatibilities performance bug

Use fetcher instead of new when we use Gem::SpecFetcher

Fixes: https://github.com/fastruby/next_rails/issues/149
---
 lib/next_rails/gem_info.rb       | 2 +-
 spec/next_rails/gem_info_spec.rb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/next_rails/gem_info.rb b/lib/next_rails/gem_info.rb
index d6060f9..1f9897f 100644
--- a/lib/next_rails/gem_info.rb
+++ b/lib/next_rails/gem_info.rb
@@ -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)
diff --git a/spec/next_rails/gem_info_spec.rb b/spec/next_rails/gem_info_spec.rb
index 043a741..98a7191 100644
--- a/spec/next_rails/gem_info_spec.rb
+++ b/spec/next_rails/gem_info_spec.rb
@@ -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

From f1df7f667aa8537e64113df9b845e2e1e2638915 Mon Sep 17 00:00:00 2001
From: Francois Buys <buys.fran@gmail.com>
Date: Thu, 10 Apr 2025 21:35:21 +0200
Subject: [PATCH 154/171] BUG-149: Add changelog entry

---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4796bf0..62b4b45 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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)

From 8b129c3f60f9f661cba2cc705617d3ec2fc5a127 Mon Sep 17 00:00:00 2001
From: Francois Buys <buys.fran@gmail.com>
Date: Tue, 15 Apr 2025 21:45:17 +0200
Subject: [PATCH 155/171] Release v1.4.6

---
 CHANGELOG.md              | 4 +++-
 lib/next_rails/version.rb | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 62b4b45..a3a7eae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,11 @@
-# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.5...main)
+# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.6...main)
 
 - [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
 
 * Your changes/patches go here.
 
+# v1.4.6 / 2025-04-15 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.5...v1.4.6)
+
 - [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)
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index a94fe14..e81698c 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.4.5"
+  VERSION = "1.4.6"
 end

From 3d35c23112a4f888af7301916eaa08e0c7fd975d Mon Sep 17 00:00:00 2001
From: Henrique <45046146+hmdros@users.noreply.github.com>
Date: Tue, 6 May 2025 17:28:54 -0300
Subject: [PATCH 156/171] Adds BundleReport CLI class to an entry point from
 executable file (#154)

* [wip] start moving executable code to CLI class

* [wip] add require to optparse

* [wip] remove duplicated require to optparse

* move require bundler/setup to executable file

* add todo to validate args

* remove .gem file from git

* refactor run method, add validation to arguments

* [wip] adding tests to new CLI class

* [wip] adjusting specs

* Specify which array option_parser.parse! should parse

* fix default behavior

* Move from single to double quotes

* Add changelog entry

---------

Co-authored-by: amandabizzinotto <amandabizzinotto@gmail.com>
Co-authored-by: Juan Vasquez <juan@ombulabs.com>
---
 CHANGELOG.md                              |   1 +
 exe/bundle_report                         |  76 +-------------
 lib/next_rails.rb                         |   1 +
 lib/next_rails/bundle_report/cli.rb       | 117 ++++++++++++++++++++++
 spec/next_rails/bundle_report/cli_spec.rb |  36 +++++++
 5 files changed, 157 insertions(+), 74 deletions(-)
 create mode 100644 lib/next_rails/bundle_report/cli.rb
 create mode 100644 spec/next_rails/bundle_report/cli_spec.rb

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a3a7eae..571dc37 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
 # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.6...main)
 
 - [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
+- [CHORE: Create an entry point for the BundleReport command](https://github.com/fastruby/next_rails/pull/154)
 
 * Your changes/patches go here.
 
diff --git a/exe/bundle_report b/exe/bundle_report
index 25bbc8a..bd0a711 100755
--- a/exe/bundle_report
+++ b/exe/bundle_report
@@ -1,78 +1,6 @@
 #!/usr/bin/env ruby
-#
-# Print a report on our Gemfile
-# Why not just use `bundle outdated`? It doesn't give us the information we care about (and it fails).
-#
-at_exit do
-  require "optparse"
-  require "next_rails"
-
-  options = {}
-  option_parser = OptionParser.new do |opts|
-    opts.banner = <<-EOS
-      Usage: #{$0} [report-type] [options]
-
-      report-type  There are two report types available: `outdated` and `compatibility`
-
-      Examples:
-        #{$0} compatibility --rails-version 5.0
-        #{$0} compatibility --ruby-version 3.3
-        #{$0} outdated
-        #{$0} outdated --json
-
-      ruby_check To find a compatible ruby version for the target rails version
-
-      Examples:
-        #{$0} ruby_check --rails-version 7.0.0
-
-    EOS
-
-    opts.separator ""
-    opts.separator "Options:"
-
-    opts.on("--rails-version [STRING]", "Rails version to check compatibility against (defaults to 5.0)") do |rails_version|
-      options[:rails_version] = rails_version
-    end
-
-    opts.on("--ruby-version [STRING]", "Ruby version to check compatibility against (defaults to 2.3)") do |ruby_version|
-      options[:ruby_version] = ruby_version
-    end
-
-    opts.on("--include-rails-gems", "Include Rails gems in compatibility report (defaults to false)") do
-      options[:include_rails_gems] = true
-    end
-
-    opts.on("--json", "Output JSON in outdated report (defaults to false)") do
-      options[:format] = 'json'
-    end
-
-    opts.on_tail("-h", "--help", "Show this message") do
-      puts opts
-      exit
-    end
-  end
-
-  begin
-    option_parser.parse!
-  rescue OptionParser::ParseError => e
-    STDERR.puts Rainbow(e.message).red
-    puts option_parser
-    exit 1
-  end
-
-  report_type = ARGV.first
-
-  case report_type
-  when "ruby_check" then NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
-  when "outdated" then NextRails::BundleReport.outdated(options.fetch(:format, nil))
-  else
-    if options[:ruby_version]
-      NextRails::BundleReport.ruby_compatibility(ruby_version: options.fetch(:ruby_version, "2.3"))
-    else
-      NextRails::BundleReport.rails_compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
-    end
-  end
-end
 
 # Needs to happen first
 require "bundler/setup"
+require "next_rails"
+NextRails::BundleReport::CLI.new(ARGV).run
diff --git a/lib/next_rails.rb b/lib/next_rails.rb
index ec8481e..6ccc4ba 100644
--- a/lib/next_rails.rb
+++ b/lib/next_rails.rb
@@ -4,6 +4,7 @@
 require "next_rails/version"
 require "next_rails/init"
 require "next_rails/bundle_report"
+require "next_rails/bundle_report/cli"
 require "next_rails/bundle_report/ruby_version_compatibility"
 require "next_rails/bundle_report/rails_version_compatibility"
 require "deprecation_tracker"
diff --git a/lib/next_rails/bundle_report/cli.rb b/lib/next_rails/bundle_report/cli.rb
new file mode 100644
index 0000000..db578bc
--- /dev/null
+++ b/lib/next_rails/bundle_report/cli.rb
@@ -0,0 +1,117 @@
+# frozen_string_literal: true
+
+require "optparse"
+require "next_rails"
+require "next_rails/bundle_report"
+
+class NextRails::BundleReport::CLI
+  def initialize(argv)
+    validate_arguments(argv)
+    @argv = argv
+  end
+
+  def validate_arguments(argv)
+    return unless argv.any?
+
+    valid_report_types = %w[outdated compatibility ruby_check]
+    report_type = argv.first
+
+    unless valid_report_types.include?(report_type)
+      raise ArgumentError, "Invalid report type '#{report_type}'. Valid types are: #{valid_report_types.join(', ')}."
+    end
+
+    argv.each do |arg|
+      if arg.start_with?("--rails-version") && !arg.match?(/--rails-version=+\d+(\.\d+)*$/)
+        raise ArgumentError, "Invalid Rails version format. Example: --rails-version=5.0.7"
+      end
+
+      if arg.start_with?("--ruby-version") && !arg.match?(/--ruby-version=+\d+(\.\d+)*$/)
+        raise ArgumentError, "Invalid Ruby version format. Example: --ruby-version=3.3"
+      end
+    end
+  end
+
+  def run
+    options = parse_options
+    execute_report(@argv.first, options)
+  end
+
+  private
+
+  def parse_options
+    options = {}
+    option_parser = OptionParser.new do |opts|
+      opts.banner = <<-EOS
+        Usage: #{$0} [report-type] [options]
+
+        report-type  There are three report types available: `outdated`, `compatibility` and `ruby_check`.
+
+        Examples:
+          #{$0} compatibility --rails-version 5.0
+          #{$0} compatibility --ruby-version 3.3
+          #{$0} outdated
+          #{$0} outdated --json
+
+        ruby_check To find a compatible ruby version for the target rails version
+
+        Examples:
+          #{$0} ruby_check --rails-version 7.0.0
+
+      EOS
+
+      opts.separator ""
+      opts.separator "Options:"
+
+      opts.on("--rails-version [STRING]",
+              "Rails version to check compatibility against (defaults to 5.0)") do |rails_version|
+        options[:rails_version] = rails_version
+      end
+
+      opts.on("--ruby-version [STRING]",
+              "Ruby version to check compatibility against (defaults to 2.3)") do |ruby_version|
+        options[:ruby_version] = ruby_version
+      end
+
+      opts.on("--include-rails-gems", "Include Rails gems in compatibility report (defaults to false)") do
+        options[:include_rails_gems] = true
+      end
+
+      opts.on("--json", "Output JSON in outdated report (defaults to false)") do
+        options[:format] = "json"
+      end
+
+      opts.on_tail("-h", "--help", "Show this message") do
+        puts opts
+        exit
+      end
+    end
+
+    begin
+      option_parser.parse!(@argv)
+    rescue OptionParser::ParseError => e
+      warn Rainbow(e.message).red
+      puts option_parser
+      exit 1
+    end
+
+    options
+  end
+
+  def execute_report(report_type, options)
+    case report_type
+    when "ruby_check"
+      NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
+    when "outdated"
+      NextRails::BundleReport.outdated(options.fetch(:format, nil))
+    else
+      if options[:ruby_version]
+        NextRails::BundleReport.ruby_compatibility(ruby_version: options.fetch(:ruby_version, "2.3"))
+      else
+        NextRails::BundleReport.rails_compatibility(
+          rails_version: options.fetch(:rails_version, "5.0"),
+          include_rails_gems: options.fetch(:include_rails_gems, false)
+        )
+      end
+    end
+  end
+end
diff --git a/spec/next_rails/bundle_report/cli_spec.rb b/spec/next_rails/bundle_report/cli_spec.rb
new file mode 100644
index 0000000..7cb89bf
--- /dev/null
+++ b/spec/next_rails/bundle_report/cli_spec.rb
@@ -0,0 +1,36 @@
+require "spec_helper"
+
+RSpec.describe NextRails::BundleReport::CLI do
+  describe '#initialize' do
+    it 'calls with called with any arguemnt' do
+      expect(NextRails::BundleReport).to receive(:rails_compatibility)
+      described_class.new([]).run
+    end
+
+    it 'raises if called with invalid arguments' do
+      expect { described_class.new(['invalid_report_type']) }
+        .to raise_error(ArgumentError,
+                        /Invalid report type 'invalid_report_type'. Valid types are: outdated, compatibility, ruby_check./)
+    end
+
+    it "calls outdated if called with outdated" do
+      expect(NextRails::BundleReport).to receive(:outdated)
+      described_class.new(["outdated"]).run
+    end
+
+    it "calls compatible_ruby_version if called with ruby_check" do
+      expect(NextRails::BundleReport).to receive(:compatible_ruby_version)
+      described_class.new(["ruby_check", "--rails-version=8.0.0"]).run
+    end
+
+    it 'calls rails_compatibility if called with compatibility with rails-version option' do
+      expect(NextRails::BundleReport).to receive(:rails_compatibility)
+      described_class.new(["compatibility", "--rails-version=8.0.0"]).run
+    end
+
+    it 'calls ruby_compatibility if called with compatibility with ruby-version option' do
+      expect(NextRails::BundleReport).to receive(:ruby_compatibility)
+      described_class.new(["compatibility", "--ruby-version=3.4.0"]).run
+    end
+  end
+end

From 7be29760577fc395d071b2b4766c9fddf27cfbc9 Mon Sep 17 00:00:00 2001
From: "G. Torres" <gelsey@ombulabs.com>
Date: Fri, 16 May 2025 14:51:11 -0400
Subject: [PATCH 157/171] Adds back old ruby versions

---
 .github/workflows/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 127d266..b0b804f 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -13,7 +13,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby-version: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5"]
+        ruby-version: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4", "2.3"]
 
     steps:
       - uses: actions/checkout@v2

From 5af16baff8d92b717f37c09727c11b8d53797e68 Mon Sep 17 00:00:00 2001
From: "G. Torres" <gelsey@ombulabs.com>
Date: Fri, 16 May 2025 15:33:34 -0400
Subject: [PATCH 158/171] Downgrades webmock and adds base64 to keep both Ruby
 3.4 support and add support back for older Ruby versions

---
 next_rails.gemspec | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index dc59c4b..0a9065c 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -30,5 +30,6 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "timecop", "~> 0.9.1"
   spec.add_development_dependency "byebug"
   spec.add_development_dependency "rexml", "3.3.8" # limited on purpose, new versions don't work with old rubies
-  spec.add_development_dependency "webmock", "3.20.0"
+  spec.add_development_dependency "webmock", "3.16.2"
+  spec.add_development_dependency "base64"
 end

From b673d9f451a5f04d39fe0161cbaea5d0b75129f5 Mon Sep 17 00:00:00 2001
From: "G. Torres" <gelsey@ombulabs.com>
Date: Fri, 16 May 2025 15:45:30 -0400
Subject: [PATCH 159/171] Downgrades rexml to most recent version that doesn't
 set required Ruby version

---
 next_rails.gemspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/next_rails.gemspec b/next_rails.gemspec
index 0a9065c..ce160b9 100644
--- a/next_rails.gemspec
+++ b/next_rails.gemspec
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "simplecov", "~> 0.17.1"
   spec.add_development_dependency "timecop", "~> 0.9.1"
   spec.add_development_dependency "byebug"
-  spec.add_development_dependency "rexml", "3.3.8" # limited on purpose, new versions don't work with old rubies
+  spec.add_development_dependency "rexml", "3.2.5" # limited on purpose, new versions don't work with old rubies
   spec.add_development_dependency "webmock", "3.16.2"
   spec.add_development_dependency "base64"
 end

From 7eb1d60cd204cc1a79355180a9cf5c038e71a0ed Mon Sep 17 00:00:00 2001
From: "G. Torres" <gelsey@ombulabs.com>
Date: Fri, 16 May 2025 16:26:19 -0400
Subject: [PATCH 160/171] Replaces match? with match to make code Ruby 2.3
 compatible

---
 lib/next_rails/bundle_report/cli.rb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/next_rails/bundle_report/cli.rb b/lib/next_rails/bundle_report/cli.rb
index db578bc..f40f77c 100644
--- a/lib/next_rails/bundle_report/cli.rb
+++ b/lib/next_rails/bundle_report/cli.rb
@@ -3,6 +3,7 @@
 require "optparse"
 require "next_rails"
 require "next_rails/bundle_report"
+require 'byebug'
 
 class NextRails::BundleReport::CLI
   def initialize(argv)
@@ -21,11 +22,11 @@ def validate_arguments(argv)
     end
 
     argv.each do |arg|
-      if arg.start_with?("--rails-version") && !arg.match?(/--rails-version=+\d+(\.\d+)*$/)
+      if arg.start_with?("--rails-version") && !/--rails-version=+\d+(\.\d+)*$/.match(arg)
         raise ArgumentError, "Invalid Rails version format. Example: --rails-version=5.0.7"
       end
 
-      if arg.start_with?("--ruby-version") && !arg.match?(/--ruby-version=+\d+(\.\d+)*$/)
+      if arg.start_with?("--ruby-version") && !/--ruby-version=+\d+(\.\d+)*$/.match(arg)
         raise ArgumentError, "Invalid Ruby version format. Example: --ruby-version=3.3"
       end
     end

From 9687f80a209d072ab3919e30b9ac6e9e8b9c2d6b Mon Sep 17 00:00:00 2001
From: "G. Torres" <gelsey@ombulabs.com>
Date: Fri, 16 May 2025 16:51:07 -0400
Subject: [PATCH 161/171] Updates Changelog

---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 571dc37..9f8f574 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
 
 - [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
 - [CHORE: Create an entry point for the BundleReport command](https://github.com/fastruby/next_rails/pull/154)
+- [CHORE: Bring back support of Ruby 2.3, 2.4 and 2.5](https://github.com/fastruby/next_rails/pull/155)
 
 * Your changes/patches go here.
 

From 2c367d578cadb583d7c02e1a99916cd4b20923d0 Mon Sep 17 00:00:00 2001
From: "G. Torres" <gelsey.torres@gmail.com>
Date: Thu, 22 May 2025 13:02:39 -0400
Subject: [PATCH 162/171] Update byebug to use double quotes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Juan Vásquez <juan@ombulabs.com>
---
 lib/next_rails/bundle_report/cli.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/next_rails/bundle_report/cli.rb b/lib/next_rails/bundle_report/cli.rb
index f40f77c..cefd1f4 100644
--- a/lib/next_rails/bundle_report/cli.rb
+++ b/lib/next_rails/bundle_report/cli.rb
@@ -3,7 +3,7 @@
 require "optparse"
 require "next_rails"
 require "next_rails/bundle_report"
-require 'byebug'
+require "byebug"
 
 class NextRails::BundleReport::CLI
   def initialize(argv)

From 5e1ea9a7380a3679df2a5e4d474ba99dfcc97f9d Mon Sep 17 00:00:00 2001
From: Julio Lucero <poramo@gmail.com>
Date: Tue, 20 May 2025 08:06:27 -0300
Subject: [PATCH 163/171] BUFIX: deprecation_tracker breaking with unknown
 keywords

---
 CHANGELOG.md                     |  4 ++++
 lib/deprecation_tracker.rb       | 10 +++++++---
 lib/next_rails/version.rb        |  2 +-
 spec/deprecation_tracker_spec.rb | 10 ++++++++++
 4 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9f8f574..2e1ae58 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,10 @@
 
 * Your changes/patches go here.
 
+# v1.4.7 / 2025-05-20 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.6...v1.4.7)
+
+- [BUFIX: deprecation_tracker breaking with unknown keywords](https://github.com/fastruby/next_rails/pull/156)
+
 # v1.4.6 / 2025-04-15 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.5...v1.4.6)
 
 - [BUFIX: Fix compatibilities performance bug](https://github.com/fastruby/next_rails/pull/150)
diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index c7ade8d..44c184a 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -18,7 +18,7 @@ def self.callbacks
       @callbacks ||= []
     end
 
-    def warn(*messages, uplevel: nil, category: nil)
+    def warn(*messages, uplevel: nil, category: nil, **kwargs)
       KernelWarnTracker.callbacks.each do |callback|
         messages.each { |message| callback.(message) }
       end
@@ -28,7 +28,11 @@ def warn(*messages, uplevel: nil, category: nil)
       elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0")
         super(*messages, uplevel: nil)
       else
-        super
+        begin
+          super(*messages, uplevel: uplevel, category: category, **kwargs)
+        rescue ArgumentError => e
+          super(*messages, uplevel: uplevel, category: category)
+        end
       end
     end
   end
@@ -43,7 +47,7 @@ def before_setup
           @@deprecation_tracker.bucket = test_file_name.gsub(Rails.root.to_s, ".")
           super
         end
-      
+
         def after_teardown
           super
           @@deprecation_tracker.bucket = nil
diff --git a/lib/next_rails/version.rb b/lib/next_rails/version.rb
index e81698c..d2c1d0c 100644
--- a/lib/next_rails/version.rb
+++ b/lib/next_rails/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module NextRails
-  VERSION = "1.4.6"
+  VERSION = "1.4.7"
 end
diff --git a/spec/deprecation_tracker_spec.rb b/spec/deprecation_tracker_spec.rb
index 21d7dfe..52aa6ea 100644
--- a/spec/deprecation_tracker_spec.rb
+++ b/spec/deprecation_tracker_spec.rb
@@ -330,5 +330,15 @@ def self.behavior
         end
       end
     end
+
+    describe "bug when warning uses unexpected keyword arguments" do
+      it "does not raise an error with unknown keyword args like :deprecation, :span, :stack" do
+        DeprecationTracker::KernelWarnTracker.callbacks << -> (message) { message.to_s }
+
+        expect {
+          warn("Unknown deprecation warning", deprecation: true, span: 1.2, stack: ["line1", "line2"])
+        }.to not_raise_error.and output.to_stderr
+      end
+    end
   end
 end

From aff7ca00a6cced955ed37d931c24cdbb37642368 Mon Sep 17 00:00:00 2001
From: Julio Lucero <poramo@gmail.com>
Date: Wed, 28 May 2025 11:09:58 -0300
Subject: [PATCH 164/171] Keep calling super to avoid error un Ruby > 3.0

---
 lib/deprecation_tracker.rb | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index 44c184a..8dbb4b1 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -28,11 +28,7 @@ def warn(*messages, uplevel: nil, category: nil, **kwargs)
       elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0")
         super(*messages, uplevel: nil)
       else
-        begin
-          super(*messages, uplevel: uplevel, category: category, **kwargs)
-        rescue ArgumentError => e
-          super(*messages, uplevel: uplevel, category: category)
-        end
+        super(*messages)
       end
     end
   end

From 9d3294ec96d89e7e4f7bc709cc4ac4e95354b72d Mon Sep 17 00:00:00 2001
From: Julio Lucero <poramo@gmail.com>
Date: Wed, 28 May 2025 11:25:06 -0300
Subject: [PATCH 165/171] Use keyword_args

---
 lib/deprecation_tracker.rb       | 17 +++++++++++------
 spec/deprecation_tracker_spec.rb | 21 +++++++++++++++++++++
 2 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index 8dbb4b1..a4d4869 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -23,12 +23,17 @@ def warn(*messages, uplevel: nil, category: nil, **kwargs)
         messages.each { |message| callback.(message) }
       end
 
-      if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0")
-        super(*messages)
-      elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0")
-        super(*messages, uplevel: nil)
-      else
-        super(*messages)
+      # Build keyword args supported by this Ruby version
+      keyword_args = {}
+      keyword_args[:uplevel] = uplevel if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.5.0")
+      keyword_args[:category] = category if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2.0")
+
+      begin
+        # Combine known safe keywords with any extras
+        super(*messages, **keyword_args, **kwargs)
+      rescue ArgumentError
+        # Fallback: only pass known safe keywords
+        super(*messages, **keyword_args)
       end
     end
   end
diff --git a/spec/deprecation_tracker_spec.rb b/spec/deprecation_tracker_spec.rb
index 52aa6ea..330723e 100644
--- a/spec/deprecation_tracker_spec.rb
+++ b/spec/deprecation_tracker_spec.rb
@@ -294,6 +294,8 @@ def self.behavior
   end
 
   describe DeprecationTracker::KernelWarnTracker do
+    before { DeprecationTracker::KernelWarnTracker.callbacks.clear }
+
     it "captures Kernel#warn" do
       warn_messages = []
       DeprecationTracker::KernelWarnTracker.callbacks << -> (message) { warn_messages << message }
@@ -340,5 +342,24 @@ def self.behavior
         }.to not_raise_error.and output.to_stderr
       end
     end
+
+    it "handles known and unknown keyword arguments without raising" do
+      warnings = []
+      DeprecationTracker::KernelWarnTracker.callbacks << ->(msg) { warnings << msg }
+
+      expect {
+        warn(
+          "This is a test warning",
+          uplevel: 1,
+          category: :deprecated,
+          deprecation: true,
+          span: 1.2,
+          stack: ["line"]
+        )
+      }.to not_raise_error
+
+      expect(warnings).to include("This is a test warning")
+    end
+
   end
 end

From 99576c22b5eb60f66bab2689d987473f40c6e040 Mon Sep 17 00:00:00 2001
From: Julio Lucero <poramo@gmail.com>
Date: Wed, 28 May 2025 17:51:29 -0300
Subject: [PATCH 166/171] Remove CHANGELOG.md updates

---
 CHANGELOG.md | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e1ae58..9f8f574 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,10 +6,6 @@
 
 * Your changes/patches go here.
 
-# v1.4.7 / 2025-05-20 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.6...v1.4.7)
-
-- [BUFIX: deprecation_tracker breaking with unknown keywords](https://github.com/fastruby/next_rails/pull/156)
-
 # v1.4.6 / 2025-04-15 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.5...v1.4.6)
 
 - [BUFIX: Fix compatibilities performance bug](https://github.com/fastruby/next_rails/pull/150)

From 9a1a8dc9b297f774ee1682fb53a3ab40f2705fd4 Mon Sep 17 00:00:00 2001
From: Julio Lucero <poramo@gmail.com>
Date: Thu, 29 May 2025 08:36:26 -0300
Subject: [PATCH 167/171] Do not send keyword_args as empty {}

---
 lib/deprecation_tracker.rb | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index a4d4869..a62a868 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -28,12 +28,14 @@ def warn(*messages, uplevel: nil, category: nil, **kwargs)
       keyword_args[:uplevel] = uplevel if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.5.0")
       keyword_args[:category] = category if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2.0")
 
-      begin
-        # Combine known safe keywords with any extras
-        super(*messages, **keyword_args, **kwargs)
-      rescue ArgumentError
-        # Fallback: only pass known safe keywords
-        super(*messages, **keyword_args)
+      if keyword_args.empty?
+        super(*messages)
+      else
+        begin
+          super(*messages, **keyword_args, **kwargs)
+        rescue ArgumentError
+          super(*messages, **keyword_args)
+        end
       end
     end
   end

From 806f05f294f30e80e08321868f1a0e30a7ca0933 Mon Sep 17 00:00:00 2001
From: Julio Lucero <poramo@gmail.com>
Date: Thu, 29 May 2025 13:37:41 -0300
Subject: [PATCH 168/171] Avoid using rescue

---
 lib/deprecation_tracker.rb | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/lib/deprecation_tracker.rb b/lib/deprecation_tracker.rb
index a62a868..47700c8 100644
--- a/lib/deprecation_tracker.rb
+++ b/lib/deprecation_tracker.rb
@@ -20,22 +20,20 @@ def self.callbacks
 
     def warn(*messages, uplevel: nil, category: nil, **kwargs)
       KernelWarnTracker.callbacks.each do |callback|
-        messages.each { |message| callback.(message) }
+        messages.each { |message| callback.call(message) }
       end
 
-      # Build keyword args supported by this Ruby version
-      keyword_args = {}
-      keyword_args[:uplevel] = uplevel if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.5.0")
-      keyword_args[:category] = category if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2.0")
+      ruby_version = Gem::Version.new(RUBY_VERSION)
 
-      if keyword_args.empty?
-        super(*messages)
+      if ruby_version >= Gem::Version.new("3.2.0")
+        # Kernel#warn supports uplevel, category
+        super(*messages, uplevel: uplevel, category: category)
+      elsif ruby_version >= Gem::Version.new("2.5.0")
+        # Kernel#warn supports only uplevel
+        super(*messages, uplevel: uplevel)
       else
-        begin
-          super(*messages, **keyword_args, **kwargs)
-        rescue ArgumentError
-          super(*messages, **keyword_args)
-        end
+        # No keyword args supported
+        super(*messages)
       end
     end
   end

From 82c3e97edd918c9ff15bc664059eecf187905e1e Mon Sep 17 00:00:00 2001
From: Julio Lucero <poramo@gmail.com>
Date: Fri, 30 May 2025 08:37:55 -0300
Subject: [PATCH 169/171] Add info under unreleasd CHANGELOG.md

---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9f8f574..66818ad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
 - [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
 - [CHORE: Create an entry point for the BundleReport command](https://github.com/fastruby/next_rails/pull/154)
 - [CHORE: Bring back support of Ruby 2.3, 2.4 and 2.5](https://github.com/fastruby/next_rails/pull/155)
+- [BUFIX: deprecation_tracker breaking with unknown keywords](https://github.com/fastruby/next_rails/pull/158)
 
 * Your changes/patches go here.
 

From e918dfea1e986fc4b7d1c8b16f15722bcd722897 Mon Sep 17 00:00:00 2001
From: Ernesto Tagwerker <ernesto+github@ombulabs.com>
Date: Fri, 30 May 2025 08:20:25 -0400
Subject: [PATCH 170/171] Update CHANGELOG.md

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 66818ad..d4317b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,7 @@
 - [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
 - [CHORE: Create an entry point for the BundleReport command](https://github.com/fastruby/next_rails/pull/154)
 - [CHORE: Bring back support of Ruby 2.3, 2.4 and 2.5](https://github.com/fastruby/next_rails/pull/155)
-- [BUFIX: deprecation_tracker breaking with unknown keywords](https://github.com/fastruby/next_rails/pull/158)
+- [BUGFIX: deprecation_tracker breaking with unknown keywords](https://github.com/fastruby/next_rails/pull/158)
 
 * Your changes/patches go here.
 

From 4fa2c89be49f545558ebda8a7e4ae17638a07a3a Mon Sep 17 00:00:00 2001
From: Olle Jonsson <olle.jonsson@gmail.com>
Date: Wed, 30 Jul 2025 16:59:02 +0200
Subject: [PATCH 171/171] CI: Use actions/checkout@v4 to avoid deprecation
 warnings

---
 .github/workflows/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index b0b804f..82cfc1c 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -16,7 +16,7 @@ jobs:
         ruby-version: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4", "2.3"]
 
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
       - name: Set up Ruby ${{ matrix.ruby-version }}
         uses: ruby/setup-ruby@v1
         with:
