next_rails 1.4.6 → 1.4.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebc27419f01357f8e9d26fd7b7c5022ebd7993cc83c055f97d8ae1941de7c0e3
4
- data.tar.gz: 06d4d044f30b054aa99ad746e389c44753248d99d7d829d11687e6fd344b45e5
3
+ metadata.gz: a42615449e644ccc18019f0c5da2c27c431e50e72135079ede29c62f20093ac7
4
+ data.tar.gz: c53318978467ad551d8119b8b4c22c7fd2c5a44f4cb05bd20b76f05776d1a3bc
5
5
  SHA512:
6
- metadata.gz: 33ad7eb2b31696266e009755d91689787761b74ebf719728a1ff8070ba49afe1b1fee97cb97f0539b30572fd31a3175d548dbcbb67245a70fc706e2dd76082fe
7
- data.tar.gz: c1f025b9b067b4949fbea7611d6560d2ffd2edf70988be503022ea83704f5ddf88e8bff2907099efecc734665b72f088c47295842bfc6a80642cea3d876a3fed
6
+ metadata.gz: 230c867f71ec914f278a9b6686c9ddb51993ba40c22d65808de70fc0774f4812e33608787ed12420ea93cb84303e9060bdeb5742445991e36245ae70098d7f15
7
+ data.tar.gz: caca9821af66ec20f947bcdd4b01b4b229092c8020ddf651141179c3ce1c8f74ccfb9ad78edb7eb837b2cae0f66dfab4e18e537e0094d51267b25907b035d96f
@@ -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@v2
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/CHANGELOG.md CHANGED
@@ -1,9 +1,19 @@
1
- # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.6...main)
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.8 / 2026-03-23 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.7...v1.4.8)
8
+
9
+ - [BUGFIX: Do not require "byebug" in any of the library code](https://github.com/fastruby/next_rails/pull/171)
10
+
11
+ # v1.4.7 / 2026-03-19 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.6...v1.4.7)
12
+
13
+ - [CHORE: Create an entry point for the BundleReport command](https://github.com/fastruby/next_rails/pull/154)
14
+ - [CHORE: Bring back support of Ruby 2.3, 2.4 and 2.5](https://github.com/fastruby/next_rails/pull/155)
15
+ - [BUGFIX: deprecation_tracker breaking with unknown keywords](https://github.com/fastruby/next_rails/pull/158)
16
+
7
17
  # v1.4.6 / 2025-04-15 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.5...v1.4.6)
8
18
 
9
19
  - [BUFIX: Fix compatibilities performance bug](https://github.com/fastruby/next_rails/pull/150)
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
@@ -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
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0")
27
- super(*messages)
28
- elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0")
29
- super(*messages, uplevel: nil)
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
- super
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,117 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "optparse"
4
+ require "next_rails"
5
+ require "next_rails/bundle_report"
6
+
7
+ class NextRails::BundleReport::CLI
8
+ def initialize(argv)
9
+ validate_arguments(argv)
10
+ @argv = argv
11
+ end
12
+
13
+ def validate_arguments(argv)
14
+ return unless argv.any?
15
+
16
+ valid_report_types = %w[outdated compatibility ruby_check]
17
+ report_type = argv.first
18
+
19
+ unless valid_report_types.include?(report_type)
20
+ raise ArgumentError, "Invalid report type '#{report_type}'. Valid types are: #{valid_report_types.join(', ')}."
21
+ end
22
+
23
+ argv.each do |arg|
24
+ if arg.start_with?("--rails-version") && !/--rails-version=+\d+(\.\d+)*$/.match(arg)
25
+ raise ArgumentError, "Invalid Rails version format. Example: --rails-version=5.0.7"
26
+ end
27
+
28
+ if arg.start_with?("--ruby-version") && !/--ruby-version=+\d+(\.\d+)*$/.match(arg)
29
+ raise ArgumentError, "Invalid Ruby version format. Example: --ruby-version=3.3"
30
+ end
31
+ end
32
+ end
33
+
34
+ def run
35
+ options = parse_options
36
+ execute_report(@argv.first, options)
37
+ end
38
+
39
+ private
40
+
41
+ def parse_options
42
+ options = {}
43
+ option_parser = OptionParser.new do |opts|
44
+ opts.banner = <<-EOS
45
+ Usage: #{$0} [report-type] [options]
46
+
47
+ report-type There are three report types available: `outdated`, `compatibility` and `ruby_check`.
48
+
49
+ Examples:
50
+ #{$0} compatibility --rails-version 5.0
51
+ #{$0} compatibility --ruby-version 3.3
52
+ #{$0} outdated
53
+ #{$0} outdated --json
54
+
55
+ ruby_check To find a compatible ruby version for the target rails version
56
+
57
+ Examples:
58
+ #{$0} ruby_check --rails-version 7.0.0
59
+
60
+ EOS
61
+
62
+ opts.separator ""
63
+ opts.separator "Options:"
64
+
65
+ opts.on("--rails-version [STRING]",
66
+ "Rails version to check compatibility against (defaults to 5.0)") do |rails_version|
67
+ options[:rails_version] = rails_version
68
+ end
69
+
70
+ opts.on("--ruby-version [STRING]",
71
+ "Ruby version to check compatibility against (defaults to 2.3)") do |ruby_version|
72
+ options[:ruby_version] = ruby_version
73
+ end
74
+
75
+ opts.on("--include-rails-gems", "Include Rails gems in compatibility report (defaults to false)") do
76
+ options[:include_rails_gems] = true
77
+ end
78
+
79
+ opts.on("--json", "Output JSON in outdated report (defaults to false)") do
80
+ options[:format] = "json"
81
+ end
82
+
83
+ opts.on_tail("-h", "--help", "Show this message") do
84
+ puts opts
85
+ exit
86
+ end
87
+ end
88
+
89
+ begin
90
+ option_parser.parse!(@argv)
91
+ rescue OptionParser::ParseError => e
92
+ warn Rainbow(e.message).red
93
+ puts option_parser
94
+ exit 1
95
+ end
96
+
97
+ options
98
+ end
99
+
100
+ def execute_report(report_type, options)
101
+ case report_type
102
+ when "ruby_check"
103
+ NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
104
+ when "outdated"
105
+ NextRails::BundleReport.outdated(options.fetch(:format, nil))
106
+ else
107
+ if options[:ruby_version]
108
+ NextRails::BundleReport.ruby_compatibility(ruby_version: options.fetch(:ruby_version, "2.3"))
109
+ else
110
+ NextRails::BundleReport.rails_compatibility(
111
+ rails_version: options.fetch(:rails_version, "5.0"),
112
+ include_rails_gems: options.fetch(:include_rails_gems, false)
113
+ )
114
+ end
115
+ end
116
+ end
117
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NextRails
4
- VERSION = "1.4.6"
4
+ VERSION = "1.4.8"
5
5
  end
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.3.8" # limited on purpose, new versions don't work with old rubies
33
- spec.add_development_dependency "webmock", "3.20.0"
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.6
4
+ version: 1.4.8
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: 2025-04-15 00:00:00.000000000 Z
11
+ date: 1980-01-02 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.3.8
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.3.8
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.20.0
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.20.0
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.5.22
213
- signing_key:
225
+ rubygems_version: 3.6.9
214
226
  specification_version: 4
215
227
  summary: A toolkit to upgrade your next Rails application
216
228
  test_files: []