next_rails 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c7f594ed23846772d59319982c2e1b866b2ba2aeea221e9f276b876d1bfa6a5
4
- data.tar.gz: 9f197cf8c84806932c34b5efe31467dab0b58d53408252ce7db193e6547486b2
3
+ metadata.gz: 7c82f6a12b6cd481313202fce9894ca2690c222d4397a14398f74c4dd0e6d31f
4
+ data.tar.gz: 546438cf1893b369c1f4c0d05f507a99c96a3dbd939b78b8e3bacbed560f2150
5
5
  SHA512:
6
- metadata.gz: 9608a14f3d6ec0dd9b939d52b6b94c3670d4ad8a9a4d4ffc70b2b4f459b5545fa762da0a74f0782efd58ec25f293671cc5039e90f2425e7e7d8570e68f4ad7ba
7
- data.tar.gz: 5f3de5c08c617fd74c78d517480cd04747cbf2ac22a6e4348005dae32ba387596f5a74b4ac2b31a6489fedd3d267213432ec94a000ad5cd0162c99b22e4d90c0
6
+ metadata.gz: a1330ca26c90f32978737bbf780156458bc8254377addbfdb860c63b1ff697f06a554e640d457bc7c7d1433a3baa7f2cd0115d4860bf451b85d468f8d0501eec
7
+ data.tar.gz: a5b5da58d00c288258931320c395cbccf1341f4eed15f56b680693f2ef3919d96ec97542a9bc2c3c11e5cf82ee5371f44d64162e9630901a4c702ded146e1415
@@ -1,4 +1,4 @@
1
- name: Run rake task
1
+ name: Continuous Integration
2
2
 
3
3
  on:
4
4
  push:
@@ -13,23 +13,7 @@ jobs:
13
13
  runs-on: ubuntu-latest
14
14
  strategy:
15
15
  matrix:
16
- ruby-version: [3.2, 3.1, 3.0, 2.7, 2.6, 2.5, 2.4, 2.3]
17
-
18
- steps:
19
- - uses: actions/checkout@v2
20
- - name: Set up Ruby ${{ matrix.ruby-version }}
21
- uses: ruby/setup-ruby@v1
22
- with:
23
- ruby-version: ${{ matrix.ruby-version }}
24
- bundler-cache: true
25
- - name: Run rake task
26
- run: bundle exec rake
27
-
28
- test_older:
29
- runs-on: ubuntu-20.04
30
- strategy:
31
- matrix:
32
- ruby-version: [2.2, 2.1, 2.0.0]
16
+ ruby-version: ["3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
33
17
 
34
18
  steps:
35
19
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
- # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.3.0...main)
1
+ # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.0...main)
2
2
 
3
3
  * Your changes/patches go here.
4
4
 
5
+ # v1.4.0 / 2024-09-24 [(commits)](https://github.com/fastruby/next_rails/compare/v1.3.0...v1.4.0)
6
+
7
+ - [CHORE: Use next_rails namespace on spec tests.](https://github.com/fastruby/next_rails/pull/117)
8
+ - [CHORE: Remove 2.0.0, 2.1, 2.2 Ruby support](https://github.com/fastruby/next_rails/pull/126)
9
+ - [CHORE: Update compatibility for Ruby versions to use Rainbow](https://github.com/fastruby/next_rails/pull/125)
10
+ - [FEATURE: Support compatibility for Ruby versions](https://github.com/fastruby/next_rails/pull/116)
11
+ - [CHORE: Remove GPL licensed dependency Colorize and replace it with Rainbow]
12
+
5
13
  # v1.3.0 / 2023-06-16 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.4...v1.3.0)
6
14
 
7
15
  - [FEATURE: Add NextRails.next? for application usage (e.g. Rails shims)](https://github.com/fastruby/next_rails/pull/97)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Next Rails
2
2
 
3
+ [![Continuous Integration](https://github.com/fastruby/next_rails/actions/workflows/main.yml/badge.svg)](https://github.com/fastruby/next_rails/actions/workflows/main.yml)
4
+
3
5
  This is a toolkit to upgrade your next Rails application. It will help you
4
6
  set up dual booting, track deprecation warnings, and get a report on outdated
5
7
  dependencies for any Rails application.
@@ -39,10 +41,14 @@ bundle_report outdated --json
39
41
  # Show gems that don't work with Rails 5.2.0
40
42
  bundle_report compatibility --rails-version=5.2.0
41
43
 
42
- # Show the usual help message
43
- bundle_report --help
44
+ # Show gems that don't work with Ruby 3.0
45
+ bundle_report compatibility --ruby-version=3.0
46
+
44
47
  # Find minimum compatible ruby version with Rails 7.0.0
45
48
  bundle_report ruby_check --rails-version=7.0.0
49
+
50
+ # Show the usual help message
51
+ bundle_report --help
46
52
  ```
47
53
 
48
54
  ### Application usage
data/exe/bundle_report CHANGED
@@ -16,6 +16,7 @@ at_exit do
16
16
 
17
17
  Examples:
18
18
  #{$0} compatibility --rails-version 5.0
19
+ #{$0} compatibility --ruby-version 3.3
19
20
  #{$0} outdated
20
21
  #{$0} outdated --json
21
22
 
@@ -33,6 +34,10 @@ at_exit do
33
34
  options[:rails_version] = rails_version
34
35
  end
35
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
+
36
41
  opts.on("--include-rails-gems", "Include Rails gems in compatibility report (defaults to false)") do
37
42
  options[:include_rails_gems] = true
38
43
  end
@@ -61,7 +66,11 @@ at_exit do
61
66
  when "ruby_check" then NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
62
67
  when "outdated" then NextRails::BundleReport.outdated(options.fetch(:format, nil))
63
68
  else
64
- NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
69
+ if options[:ruby_version]
70
+ NextRails::BundleReport.compatibility(ruby_version: options.fetch(:ruby_version, "2.3"))
71
+ else
72
+ NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
73
+ end
65
74
  end
66
75
  end
67
76
 
data/exe/deprecations CHANGED
@@ -1,9 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "json"
3
- require "colorize"
3
+ require "rainbow/refinement"
4
4
  require "optparse"
5
5
  require "set"
6
6
 
7
+ using Rainbow
8
+
7
9
  def run_tests(deprecation_warnings, opts = {})
8
10
  tracker_mode = opts[:tracker_mode]
9
11
  next_mode = opts[:next_mode]
@@ -1,6 +1,8 @@
1
- require "colorize"
1
+ require "rainbow/refinement"
2
2
  require "json"
3
3
 
4
+ using Rainbow
5
+
4
6
  # A shitlist for deprecation warnings during test runs. It has two modes: "save" and "compare"
5
7
  #
6
8
  # DEPRECATION_TRACKER=save
@@ -0,0 +1,46 @@
1
+ require "rainbow/refinement"
2
+
3
+ class NextRails::BundleReport::RubyVersionCompatibility
4
+ using Rainbow
5
+
6
+ MINIMAL_VERSION = 1.0
7
+ attr_reader :gems, :options
8
+
9
+ def initialize(gems: NextRails::GemInfo.all, options: {})
10
+ @gems = gems
11
+ @options = options
12
+ end
13
+
14
+ def generate
15
+ return invalid_message unless valid?
16
+
17
+ message
18
+ end
19
+
20
+ private
21
+
22
+ def message
23
+ output = "=> Incompatible gems with Ruby #{ruby_version}:".white.bold
24
+ incompatible.each do |gem|
25
+ output += "\n#{gem.name} - required Ruby version: #{gem.gem_specification.required_ruby_version}".magenta
26
+ end
27
+ output += "\n\n#{incompatible.length} incompatible #{incompatible.one? ? 'gem' : 'gems' } with Ruby #{ruby_version}".red
28
+ output
29
+ end
30
+
31
+ def incompatible
32
+ gems.reject { |gem| gem.compatible_with_ruby?(ruby_version) }
33
+ end
34
+
35
+ def ruby_version
36
+ options[:ruby_version].to_f
37
+ end
38
+
39
+ def invalid_message
40
+ "=> Invalid Ruby version: #{options[:ruby_version]}.".red.bold
41
+ end
42
+
43
+ def valid?
44
+ ruby_version > MINIMAL_VERSION
45
+ end
46
+ end
@@ -1,14 +1,18 @@
1
- require "colorize"
1
+ require "rainbow/refinement"
2
2
  require "cgi"
3
3
  require "erb"
4
4
  require "json"
5
5
  require "net/http"
6
6
 
7
+ using Rainbow
8
+
7
9
  module NextRails
8
10
  module BundleReport
9
11
  extend self
10
12
 
11
- def compatibility(rails_version: nil, include_rails_gems: nil)
13
+ def compatibility(rails_version: nil, ruby_version: nil, include_rails_gems: nil)
14
+ return puts RubyVersionCompatibility.new(options: { ruby_version: ruby_version }).generate if ruby_version
15
+
12
16
  incompatible_gems = NextRails::GemInfo.all.reject do |gem|
13
17
  gem.compatible_with_rails?(rails_version: rails_version) || (!include_rails_gems && gem.from_rails?)
14
18
  end.sort_by { |gem| gem.name }
@@ -168,4 +172,4 @@ module NextRails
168
172
  puts footer
169
173
  end
170
174
  end
171
- end
175
+ end
@@ -147,5 +147,9 @@ module NextRails
147
147
  rails_dependency.requirement.satisfied_by?(Gem::Version.new(rails_version))
148
148
  end
149
149
  end
150
+
151
+ def compatible_with_ruby?(ruby_version)
152
+ gem_specification.required_ruby_version.satisfied_by?(Gem::Version.new(ruby_version))
153
+ end
150
154
  end
151
155
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NextRails
4
- VERSION = "1.3.0"
4
+ VERSION = "1.4.0"
5
5
  end
data/lib/next_rails.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require "next_rails/gem_info"
4
4
  require "next_rails/version"
5
5
  require "next_rails/bundle_report"
6
+ require "next_rails/bundle_report/ruby_version_compatibility"
6
7
  require "deprecation_tracker"
7
8
 
8
9
  module NextRails
data/next_rails.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.add_dependency "colorize", ">= 0.8.1"
25
+ spec.add_dependency "rainbow", ">= 3"
26
26
  spec.add_development_dependency "bundler", ">= 1.16", "< 3.0"
27
27
  spec.add_development_dependency "rake"
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,30 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: next_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernesto Tagwerker
8
8
  - Luis Sagastume
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-06-16 00:00:00.000000000 Z
12
+ date: 2024-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: colorize
15
+ name: rainbow
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 0.8.1
20
+ version: '3'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 0.8.1
27
+ version: '3'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -164,9 +164,7 @@ files:
164
164
  - ".github/workflows/main.yml"
165
165
  - ".gitignore"
166
166
  - ".rspec"
167
- - ".travis.yml"
168
167
  - CHANGELOG.md
169
- - CODEOWNERS
170
168
  - CODE_OF_CONDUCT.md
171
169
  - CONTRIBUTING.md
172
170
  - Gemfile
@@ -185,6 +183,7 @@ files:
185
183
  - lib/deprecation_tracker.rb
186
184
  - lib/next_rails.rb
187
185
  - lib/next_rails/bundle_report.rb
186
+ - lib/next_rails/bundle_report/ruby_version_compatibility.rb
188
187
  - lib/next_rails/gem_info.rb
189
188
  - lib/next_rails/version.rb
190
189
  - next_rails.gemspec
@@ -193,7 +192,7 @@ homepage: https://github.com/fastruby/next_rails
193
192
  licenses:
194
193
  - MIT
195
194
  metadata: {}
196
- post_install_message:
195
+ post_install_message:
197
196
  rdoc_options: []
198
197
  require_paths:
199
198
  - lib
@@ -208,8 +207,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
207
  - !ruby/object:Gem::Version
209
208
  version: '0'
210
209
  requirements: []
211
- rubygems_version: 3.0.3.1
212
- signing_key:
210
+ rubygems_version: 3.5.9
211
+ signing_key:
213
212
  specification_version: 4
214
213
  summary: A toolkit to upgrade your next Rails application
215
214
  test_files: []
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.3
5
- - 2.4.10
6
- - 2.5.8
7
- - 2.6.6
8
- - 2.7.2
9
- - 3.0.2
10
- before_install: gem install bundler -v 1.16.1
data/CODEOWNERS DELETED
@@ -1,4 +0,0 @@
1
- # These code owners will be the default owners to everything in the repository.
2
- # Unless a posterior rule has precedence, they will be automatically requested
3
- # for review when a pull request is opened.
4
- * @fastruby/black-bunny-brigade