next_rails 1.4.5 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +2 -2
- data/.gitignore +1 -0
- data/CHANGELOG.md +11 -1
- data/README.md +1 -1
- data/exe/bundle_report +2 -74
- data/lib/deprecation_tracker.rb +13 -8
- data/lib/next_rails/bundle_report/cli.rb +118 -0
- data/lib/next_rails/gem_info.rb +1 -1
- data/lib/next_rails/version.rb +1 -1
- data/lib/next_rails.rb +1 -0
- data/next_rails.gemspec +3 -2
- metadata +22 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 572221ca6f18d4f8f71c51828b55d2d1b492c4c4726f41492f368cabdb0b700a
|
|
4
|
+
data.tar.gz: ac0726a74c0123f222cd0f97670e53bd211a589194118e236235379897234a5a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1250d6b62572799abf1ba41dfd44fce17457576288342365cd60de543780cc9e1ec1eb8cb177daa2c0de297b69ec69d015d99ff324430ec92ff59e484a3bc720
|
|
7
|
+
data.tar.gz: 1fd84275eebf85ea59907f4e197288196a8e4bedf1acfc1a325e404bd19a1fe02faf78dec803d72dd6c858b1774356276efdc83a5f4e79df70d3ca0cc702415b
|
data/.github/workflows/main.yml
CHANGED
|
@@ -13,10 +13,10 @@ jobs:
|
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
strategy:
|
|
15
15
|
matrix:
|
|
16
|
-
ruby-version: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5"]
|
|
16
|
+
ruby-version: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4", "2.3"]
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
20
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
|
21
21
|
uses: ruby/setup-ruby@v1
|
|
22
22
|
with:
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.
|
|
1
|
+
# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.7...main)
|
|
2
2
|
|
|
3
3
|
- [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
|
|
4
4
|
|
|
5
5
|
* Your changes/patches go here.
|
|
6
6
|
|
|
7
|
+
# v1.4.7 / 2026-03-19 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.6...v1.4.7)
|
|
8
|
+
|
|
9
|
+
- [CHORE: Create an entry point for the BundleReport command](https://github.com/fastruby/next_rails/pull/154)
|
|
10
|
+
- [CHORE: Bring back support of Ruby 2.3, 2.4 and 2.5](https://github.com/fastruby/next_rails/pull/155)
|
|
11
|
+
- [BUGFIX: deprecation_tracker breaking with unknown keywords](https://github.com/fastruby/next_rails/pull/158)
|
|
12
|
+
|
|
13
|
+
# v1.4.6 / 2025-04-15 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.5...v1.4.6)
|
|
14
|
+
|
|
15
|
+
- [BUFIX: Fix compatibilities performance bug](https://github.com/fastruby/next_rails/pull/150)
|
|
16
|
+
|
|
7
17
|
# v1.4.5 / 2025-03-07 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.4...v1.4.5)
|
|
8
18
|
|
|
9
19
|
- [Move rails_version compatibility to its own class](https://github.com/fastruby/next_rails/pull/137)
|
data/README.md
CHANGED
|
@@ -140,7 +140,7 @@ next_rails --help # For more options and examples
|
|
|
140
140
|
This command helps you dual-boot your application.
|
|
141
141
|
|
|
142
142
|
```bash
|
|
143
|
-
|
|
143
|
+
next_rails --init # Create Gemfile.next and Gemfile.next.lock
|
|
144
144
|
vim Gemfile # Tweak your dependencies conditionally using `next?`
|
|
145
145
|
next bundle install # Install new gems
|
|
146
146
|
next rails s # Start server using Gemfile.next
|
data/exe/bundle_report
CHANGED
|
@@ -1,78 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
#
|
|
3
|
-
# Print a report on our Gemfile
|
|
4
|
-
# Why not just use `bundle outdated`? It doesn't give us the information we care about (and it fails).
|
|
5
|
-
#
|
|
6
|
-
at_exit do
|
|
7
|
-
require "optparse"
|
|
8
|
-
require "next_rails"
|
|
9
|
-
|
|
10
|
-
options = {}
|
|
11
|
-
option_parser = OptionParser.new do |opts|
|
|
12
|
-
opts.banner = <<-EOS
|
|
13
|
-
Usage: #{$0} [report-type] [options]
|
|
14
|
-
|
|
15
|
-
report-type There are two report types available: `outdated` and `compatibility`
|
|
16
|
-
|
|
17
|
-
Examples:
|
|
18
|
-
#{$0} compatibility --rails-version 5.0
|
|
19
|
-
#{$0} compatibility --ruby-version 3.3
|
|
20
|
-
#{$0} outdated
|
|
21
|
-
#{$0} outdated --json
|
|
22
|
-
|
|
23
|
-
ruby_check To find a compatible ruby version for the target rails version
|
|
24
|
-
|
|
25
|
-
Examples:
|
|
26
|
-
#{$0} ruby_check --rails-version 7.0.0
|
|
27
|
-
|
|
28
|
-
EOS
|
|
29
|
-
|
|
30
|
-
opts.separator ""
|
|
31
|
-
opts.separator "Options:"
|
|
32
|
-
|
|
33
|
-
opts.on("--rails-version [STRING]", "Rails version to check compatibility against (defaults to 5.0)") do |rails_version|
|
|
34
|
-
options[:rails_version] = rails_version
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
opts.on("--ruby-version [STRING]", "Ruby version to check compatibility against (defaults to 2.3)") do |ruby_version|
|
|
38
|
-
options[:ruby_version] = ruby_version
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
opts.on("--include-rails-gems", "Include Rails gems in compatibility report (defaults to false)") do
|
|
42
|
-
options[:include_rails_gems] = true
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
opts.on("--json", "Output JSON in outdated report (defaults to false)") do
|
|
46
|
-
options[:format] = 'json'
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
opts.on_tail("-h", "--help", "Show this message") do
|
|
50
|
-
puts opts
|
|
51
|
-
exit
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
begin
|
|
56
|
-
option_parser.parse!
|
|
57
|
-
rescue OptionParser::ParseError => e
|
|
58
|
-
STDERR.puts Rainbow(e.message).red
|
|
59
|
-
puts option_parser
|
|
60
|
-
exit 1
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
report_type = ARGV.first
|
|
64
|
-
|
|
65
|
-
case report_type
|
|
66
|
-
when "ruby_check" then NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
|
|
67
|
-
when "outdated" then NextRails::BundleReport.outdated(options.fetch(:format, nil))
|
|
68
|
-
else
|
|
69
|
-
if options[:ruby_version]
|
|
70
|
-
NextRails::BundleReport.ruby_compatibility(ruby_version: options.fetch(:ruby_version, "2.3"))
|
|
71
|
-
else
|
|
72
|
-
NextRails::BundleReport.rails_compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
2
|
|
|
77
3
|
# Needs to happen first
|
|
78
4
|
require "bundler/setup"
|
|
5
|
+
require "next_rails"
|
|
6
|
+
NextRails::BundleReport::CLI.new(ARGV).run
|
data/lib/deprecation_tracker.rb
CHANGED
|
@@ -18,17 +18,22 @@ class DeprecationTracker
|
|
|
18
18
|
@callbacks ||= []
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
def warn(*messages, uplevel: nil, category: nil)
|
|
21
|
+
def warn(*messages, uplevel: nil, category: nil, **kwargs)
|
|
22
22
|
KernelWarnTracker.callbacks.each do |callback|
|
|
23
|
-
messages.each { |message| callback.(message) }
|
|
23
|
+
messages.each { |message| callback.call(message) }
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
ruby_version = Gem::Version.new(RUBY_VERSION)
|
|
27
|
+
|
|
28
|
+
if ruby_version >= Gem::Version.new("3.2.0")
|
|
29
|
+
# Kernel#warn supports uplevel, category
|
|
30
|
+
super(*messages, uplevel: uplevel, category: category)
|
|
31
|
+
elsif ruby_version >= Gem::Version.new("2.5.0")
|
|
32
|
+
# Kernel#warn supports only uplevel
|
|
33
|
+
super(*messages, uplevel: uplevel)
|
|
30
34
|
else
|
|
31
|
-
|
|
35
|
+
# No keyword args supported
|
|
36
|
+
super(*messages)
|
|
32
37
|
end
|
|
33
38
|
end
|
|
34
39
|
end
|
|
@@ -43,7 +48,7 @@ class DeprecationTracker
|
|
|
43
48
|
@@deprecation_tracker.bucket = test_file_name.gsub(Rails.root.to_s, ".")
|
|
44
49
|
super
|
|
45
50
|
end
|
|
46
|
-
|
|
51
|
+
|
|
47
52
|
def after_teardown
|
|
48
53
|
super
|
|
49
54
|
@@deprecation_tracker.bucket = nil
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "optparse"
|
|
4
|
+
require "next_rails"
|
|
5
|
+
require "next_rails/bundle_report"
|
|
6
|
+
require "byebug"
|
|
7
|
+
|
|
8
|
+
class NextRails::BundleReport::CLI
|
|
9
|
+
def initialize(argv)
|
|
10
|
+
validate_arguments(argv)
|
|
11
|
+
@argv = argv
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def validate_arguments(argv)
|
|
15
|
+
return unless argv.any?
|
|
16
|
+
|
|
17
|
+
valid_report_types = %w[outdated compatibility ruby_check]
|
|
18
|
+
report_type = argv.first
|
|
19
|
+
|
|
20
|
+
unless valid_report_types.include?(report_type)
|
|
21
|
+
raise ArgumentError, "Invalid report type '#{report_type}'. Valid types are: #{valid_report_types.join(', ')}."
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
argv.each do |arg|
|
|
25
|
+
if arg.start_with?("--rails-version") && !/--rails-version=+\d+(\.\d+)*$/.match(arg)
|
|
26
|
+
raise ArgumentError, "Invalid Rails version format. Example: --rails-version=5.0.7"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
if arg.start_with?("--ruby-version") && !/--ruby-version=+\d+(\.\d+)*$/.match(arg)
|
|
30
|
+
raise ArgumentError, "Invalid Ruby version format. Example: --ruby-version=3.3"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def run
|
|
36
|
+
options = parse_options
|
|
37
|
+
execute_report(@argv.first, options)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
def parse_options
|
|
43
|
+
options = {}
|
|
44
|
+
option_parser = OptionParser.new do |opts|
|
|
45
|
+
opts.banner = <<-EOS
|
|
46
|
+
Usage: #{$0} [report-type] [options]
|
|
47
|
+
|
|
48
|
+
report-type There are three report types available: `outdated`, `compatibility` and `ruby_check`.
|
|
49
|
+
|
|
50
|
+
Examples:
|
|
51
|
+
#{$0} compatibility --rails-version 5.0
|
|
52
|
+
#{$0} compatibility --ruby-version 3.3
|
|
53
|
+
#{$0} outdated
|
|
54
|
+
#{$0} outdated --json
|
|
55
|
+
|
|
56
|
+
ruby_check To find a compatible ruby version for the target rails version
|
|
57
|
+
|
|
58
|
+
Examples:
|
|
59
|
+
#{$0} ruby_check --rails-version 7.0.0
|
|
60
|
+
|
|
61
|
+
EOS
|
|
62
|
+
|
|
63
|
+
opts.separator ""
|
|
64
|
+
opts.separator "Options:"
|
|
65
|
+
|
|
66
|
+
opts.on("--rails-version [STRING]",
|
|
67
|
+
"Rails version to check compatibility against (defaults to 5.0)") do |rails_version|
|
|
68
|
+
options[:rails_version] = rails_version
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
opts.on("--ruby-version [STRING]",
|
|
72
|
+
"Ruby version to check compatibility against (defaults to 2.3)") do |ruby_version|
|
|
73
|
+
options[:ruby_version] = ruby_version
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
opts.on("--include-rails-gems", "Include Rails gems in compatibility report (defaults to false)") do
|
|
77
|
+
options[:include_rails_gems] = true
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
opts.on("--json", "Output JSON in outdated report (defaults to false)") do
|
|
81
|
+
options[:format] = "json"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
|
85
|
+
puts opts
|
|
86
|
+
exit
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
begin
|
|
91
|
+
option_parser.parse!(@argv)
|
|
92
|
+
rescue OptionParser::ParseError => e
|
|
93
|
+
warn Rainbow(e.message).red
|
|
94
|
+
puts option_parser
|
|
95
|
+
exit 1
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
options
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def execute_report(report_type, options)
|
|
102
|
+
case report_type
|
|
103
|
+
when "ruby_check"
|
|
104
|
+
NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
|
|
105
|
+
when "outdated"
|
|
106
|
+
NextRails::BundleReport.outdated(options.fetch(:format, nil))
|
|
107
|
+
else
|
|
108
|
+
if options[:ruby_version]
|
|
109
|
+
NextRails::BundleReport.ruby_compatibility(ruby_version: options.fetch(:ruby_version, "2.3"))
|
|
110
|
+
else
|
|
111
|
+
NextRails::BundleReport.rails_compatibility(
|
|
112
|
+
rails_version: options.fetch(:rails_version, "5.0"),
|
|
113
|
+
include_rails_gems: options.fetch(:include_rails_gems, false)
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
data/lib/next_rails/gem_info.rb
CHANGED
|
@@ -109,7 +109,7 @@ module NextRails
|
|
|
109
109
|
|
|
110
110
|
def find_latest_compatible(rails_version: nil)
|
|
111
111
|
dependency = Gem::Dependency.new(@name)
|
|
112
|
-
fetcher = Gem::SpecFetcher.new
|
|
112
|
+
fetcher = Gem::SpecFetcher.fetcher # Use fetcher instead of ::new to reduce object allocation.
|
|
113
113
|
|
|
114
114
|
# list all available data for released gems
|
|
115
115
|
list, errors = fetcher.available_specs(:released)
|
data/lib/next_rails/version.rb
CHANGED
data/lib/next_rails.rb
CHANGED
|
@@ -4,6 +4,7 @@ require "next_rails/gem_info"
|
|
|
4
4
|
require "next_rails/version"
|
|
5
5
|
require "next_rails/init"
|
|
6
6
|
require "next_rails/bundle_report"
|
|
7
|
+
require "next_rails/bundle_report/cli"
|
|
7
8
|
require "next_rails/bundle_report/ruby_version_compatibility"
|
|
8
9
|
require "next_rails/bundle_report/rails_version_compatibility"
|
|
9
10
|
require "deprecation_tracker"
|
data/next_rails.gemspec
CHANGED
|
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
spec.add_development_dependency "simplecov", "~> 0.17.1"
|
|
30
30
|
spec.add_development_dependency "timecop", "~> 0.9.1"
|
|
31
31
|
spec.add_development_dependency "byebug"
|
|
32
|
-
spec.add_development_dependency "rexml", "3.
|
|
33
|
-
spec.add_development_dependency "webmock", "3.
|
|
32
|
+
spec.add_development_dependency "rexml", "3.2.5" # limited on purpose, new versions don't work with old rubies
|
|
33
|
+
spec.add_development_dependency "webmock", "3.16.2"
|
|
34
|
+
spec.add_development_dependency "base64"
|
|
34
35
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: next_rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ernesto Tagwerker
|
|
8
8
|
- Luis Sagastume
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: exe
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2026-03-19 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: rainbow
|
|
@@ -121,28 +120,42 @@ dependencies:
|
|
|
121
120
|
requirements:
|
|
122
121
|
- - '='
|
|
123
122
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: 3.
|
|
123
|
+
version: 3.2.5
|
|
125
124
|
type: :development
|
|
126
125
|
prerelease: false
|
|
127
126
|
version_requirements: !ruby/object:Gem::Requirement
|
|
128
127
|
requirements:
|
|
129
128
|
- - '='
|
|
130
129
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 3.
|
|
130
|
+
version: 3.2.5
|
|
132
131
|
- !ruby/object:Gem::Dependency
|
|
133
132
|
name: webmock
|
|
134
133
|
requirement: !ruby/object:Gem::Requirement
|
|
135
134
|
requirements:
|
|
136
135
|
- - '='
|
|
137
136
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: 3.
|
|
137
|
+
version: 3.16.2
|
|
139
138
|
type: :development
|
|
140
139
|
prerelease: false
|
|
141
140
|
version_requirements: !ruby/object:Gem::Requirement
|
|
142
141
|
requirements:
|
|
143
142
|
- - '='
|
|
144
143
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: 3.
|
|
144
|
+
version: 3.16.2
|
|
145
|
+
- !ruby/object:Gem::Dependency
|
|
146
|
+
name: base64
|
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - ">="
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: '0'
|
|
152
|
+
type: :development
|
|
153
|
+
prerelease: false
|
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
155
|
+
requirements:
|
|
156
|
+
- - ">="
|
|
157
|
+
- !ruby/object:Gem::Version
|
|
158
|
+
version: '0'
|
|
146
159
|
description: A set of handy tools to upgrade your Rails application and keep it up
|
|
147
160
|
to date
|
|
148
161
|
email:
|
|
@@ -183,6 +196,7 @@ files:
|
|
|
183
196
|
- lib/deprecation_tracker.rb
|
|
184
197
|
- lib/next_rails.rb
|
|
185
198
|
- lib/next_rails/bundle_report.rb
|
|
199
|
+
- lib/next_rails/bundle_report/cli.rb
|
|
186
200
|
- lib/next_rails/bundle_report/rails_version_compatibility.rb
|
|
187
201
|
- lib/next_rails/bundle_report/ruby_version_compatibility.rb
|
|
188
202
|
- lib/next_rails/gem_info.rb
|
|
@@ -194,7 +208,6 @@ homepage: https://github.com/fastruby/next_rails
|
|
|
194
208
|
licenses:
|
|
195
209
|
- MIT
|
|
196
210
|
metadata: {}
|
|
197
|
-
post_install_message:
|
|
198
211
|
rdoc_options: []
|
|
199
212
|
require_paths:
|
|
200
213
|
- lib
|
|
@@ -209,8 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
209
222
|
- !ruby/object:Gem::Version
|
|
210
223
|
version: '0'
|
|
211
224
|
requirements: []
|
|
212
|
-
rubygems_version: 3.
|
|
213
|
-
signing_key:
|
|
225
|
+
rubygems_version: 3.6.2
|
|
214
226
|
specification_version: 4
|
|
215
227
|
summary: A toolkit to upgrade your next Rails application
|
|
216
228
|
test_files: []
|