next_rails 1.4.0 → 1.4.1

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: 7c82f6a12b6cd481313202fce9894ca2690c222d4397a14398f74c4dd0e6d31f
4
- data.tar.gz: 546438cf1893b369c1f4c0d05f507a99c96a3dbd939b78b8e3bacbed560f2150
3
+ metadata.gz: 7531328eccac69326b09b911f6fadb8f69b8d9713e6364af67c756059ed3ea18
4
+ data.tar.gz: 2bdaab8c916972e76b2623ff37519a2363da4537f4f0a4a4ce47b81343c227cf
5
5
  SHA512:
6
- metadata.gz: a1330ca26c90f32978737bbf780156458bc8254377addbfdb860c63b1ff697f06a554e640d457bc7c7d1433a3baa7f2cd0115d4860bf451b85d468f8d0501eec
7
- data.tar.gz: a5b5da58d00c288258931320c395cbccf1341f4eed15f56b680693f2ef3919d96ec97542a9bc2c3c11e5cf82ee5371f44d64162e9630901a4c702ded146e1415
6
+ metadata.gz: e65d7cb5da7f4eee2b56210db1a64a2a989a089b84f8ff7024385865710ef78c95aa3eeb16d4f1c194c67a0cf47f51b2970aeeccd6c3fde876c44e000c0d867a
7
+ data.tar.gz: 6926ab189b14413dcda593151c3a5586c71dc1ac7880fea0a024a16eb536bb03e46dafb72f568e1c04bb29c155b20423ce1b39fa749cd2ee01409974c3939332
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  * Your changes/patches go here.
4
4
 
5
+ # v1.4.1 / 2024-10-22 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.0...v1.4.1)
6
+
7
+ - [BUGFIX: Fix performance regression due to rainbow refinement](https://github.com/fastruby/next_rails/pull/131)
8
+
5
9
  # v1.4.0 / 2024-09-24 [(commits)](https://github.com/fastruby/next_rails/compare/v1.3.0...v1.4.0)
6
10
 
7
11
  - [CHORE: Use next_rails namespace on spec tests.](https://github.com/fastruby/next_rails/pull/117)
data/exe/bundle_report CHANGED
@@ -55,7 +55,7 @@ at_exit do
55
55
  begin
56
56
  option_parser.parse!
57
57
  rescue OptionParser::ParseError => e
58
- STDERR.puts e.message.red
58
+ STDERR.puts Rainbow(e.message).red
59
59
  puts option_parser
60
60
  exit 1
61
61
  end
data/exe/deprecations CHANGED
@@ -1,11 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "json"
3
- require "rainbow/refinement"
3
+ require "rainbow"
4
4
  require "optparse"
5
5
  require "set"
6
6
 
7
- using Rainbow
8
-
9
7
  def run_tests(deprecation_warnings, opts = {})
10
8
  tracker_mode = opts[:tracker_mode]
11
9
  next_mode = opts[:next_mode]
@@ -30,11 +28,11 @@ def print_info(deprecation_warnings, opts = {})
30
28
  end
31
29
  end.sort_by {|message, data| data[:occurrences] }.reverse.to_h
32
30
 
33
- puts "Ten most common deprecation warnings:".underline
31
+ puts Rainbow("Ten most common deprecation warnings:").underline
34
32
  frequency_by_message.take(10).each do |message, data|
35
- puts "Occurrences: #{data.fetch(:occurrences)}".bold
33
+ puts Rainbow("Occurrences: #{data.fetch(:occurrences)}").bold
36
34
  puts "Test files: #{data.fetch(:test_files).to_a.join(" ")}" if verbose
37
- puts message.red
35
+ puts Rainbow(message).red
38
36
  puts "----------"
39
37
  end
40
38
  end
@@ -106,10 +104,10 @@ case options.fetch(:mode, "info")
106
104
  when "run" then run_tests(deprecation_warnings, next_mode: options[:next], tracker_mode: options[:tracker_mode])
107
105
  when "info" then print_info(deprecation_warnings, verbose: options[:verbose])
108
106
  when nil
109
- STDERR.puts "Must pass a mode: run or info".red
107
+ STDERR.puts Rainbow("Must pass a mode: run or info").red
110
108
  puts option_parser
111
109
  exit 1
112
110
  else
113
- STDERR.puts "Unknown mode: #{options[:mode]}".red
111
+ STDERR.puts Rainbow("Unknown mode: #{options[:mode]}").red
114
112
  exit 1
115
113
  end
@@ -1,8 +1,6 @@
1
- require "rainbow/refinement"
1
+ require "rainbow"
2
2
  require "json"
3
3
 
4
- using Rainbow
5
-
6
4
  # A shitlist for deprecation warnings during test runs. It has two modes: "save" and "compare"
7
5
  #
8
6
  # DEPRECATION_TRACKER=save
@@ -152,7 +150,7 @@ class DeprecationTracker
152
150
  end
153
151
 
154
152
  if changed_buckets.length > 0
155
- message = <<-MESSAGE.red
153
+ message = <<-MESSAGE
156
154
  ⚠️ Deprecation warnings have changed!
157
155
 
158
156
  Code called by the following spec files is now generating different deprecation warnings:
@@ -170,7 +168,7 @@ class DeprecationTracker
170
168
  See \e[4;37mdev-docs/testing/deprecation_tracker.md\e[0;31m for more information.
171
169
  MESSAGE
172
170
 
173
- raise UnexpectedDeprecations, message
171
+ raise UnexpectedDeprecations, Rainbow(message).red
174
172
  end
175
173
  end
176
174
 
@@ -1,8 +1,6 @@
1
- require "rainbow/refinement"
1
+ require "rainbow"
2
2
 
3
3
  class NextRails::BundleReport::RubyVersionCompatibility
4
- using Rainbow
5
-
6
4
  MINIMAL_VERSION = 1.0
7
5
  attr_reader :gems, :options
8
6
 
@@ -20,11 +18,11 @@ class NextRails::BundleReport::RubyVersionCompatibility
20
18
  private
21
19
 
22
20
  def message
23
- output = "=> Incompatible gems with Ruby #{ruby_version}:".white.bold
21
+ output = Rainbow("=> Incompatible gems with Ruby #{ruby_version}:").white.bold
24
22
  incompatible.each do |gem|
25
- output += "\n#{gem.name} - required Ruby version: #{gem.gem_specification.required_ruby_version}".magenta
23
+ output += Rainbow("\n#{gem.name} - required Ruby version: #{gem.gem_specification.required_ruby_version}").magenta
26
24
  end
27
- output += "\n\n#{incompatible.length} incompatible #{incompatible.one? ? 'gem' : 'gems' } with Ruby #{ruby_version}".red
25
+ output += Rainbow("\n\n#{incompatible.length} incompatible #{incompatible.one? ? 'gem' : 'gems' } with Ruby #{ruby_version}").red
28
26
  output
29
27
  end
30
28
 
@@ -37,7 +35,7 @@ class NextRails::BundleReport::RubyVersionCompatibility
37
35
  end
38
36
 
39
37
  def invalid_message
40
- "=> Invalid Ruby version: #{options[:ruby_version]}.".red.bold
38
+ Rainbow("=> Invalid Ruby version: #{options[:ruby_version]}.").red.bold
41
39
  end
42
40
 
43
41
  def valid?
@@ -1,11 +1,9 @@
1
- require "rainbow/refinement"
1
+ require "rainbow"
2
2
  require "cgi"
3
3
  require "erb"
4
4
  require "json"
5
5
  require "net/http"
6
6
 
7
- using Rainbow
8
-
9
7
  module NextRails
10
8
  module BundleReport
11
9
  extend self
@@ -27,8 +25,8 @@ module NextRails
27
25
  def erb_output(incompatible_gems_by_state, incompatible_gems, rails_version)
28
26
  template = <<-ERB
29
27
  <% if incompatible_gems_by_state[:found_compatible] -%>
30
- <%= "=> Incompatible with Rails #{rails_version} (with new versions that are compatible):".white.bold %>
31
- <%= "These gems will need to be upgraded before upgrading to Rails #{rails_version}.".italic %>
28
+ <%= Rainbow("=> Incompatible with Rails #{rails_version} (with new versions that are compatible):").white.bold %>
29
+ <%= Rainbow("These gems will need to be upgraded before upgrading to Rails #{rails_version}.").italic %>
32
30
 
33
31
  <% incompatible_gems_by_state[:found_compatible].each do |gem| -%>
34
32
  <%= gem_header(gem) %> - upgrade to <%= gem.latest_compatible_version.version %>
@@ -36,8 +34,8 @@ module NextRails
36
34
 
37
35
  <% end -%>
38
36
  <% if incompatible_gems_by_state[:incompatible] -%>
39
- <%= "=> Incompatible with Rails #{rails_version} (with no new compatible versions):".white.bold %>
40
- <%= "These gems will need to be removed or replaced before upgrading to Rails #{rails_version}.".italic %>
37
+ <%= Rainbow("=> Incompatible with Rails #{rails_version} (with no new compatible versions):").white.bold %>
38
+ <%= Rainbow("These gems will need to be removed or replaced before upgrading to Rails #{rails_version}.").italic %>
41
39
 
42
40
  <% incompatible_gems_by_state[:incompatible].each do |gem| -%>
43
41
  <%= gem_header(gem) %> - new version, <%= gem.latest_version.version %>, is not compatible with Rails #{rails_version}
@@ -45,16 +43,16 @@ module NextRails
45
43
 
46
44
  <% end -%>
47
45
  <% if incompatible_gems_by_state[:no_new_version] -%>
48
- <%= "=> Incompatible with Rails #{rails_version} (with no new versions):".white.bold %>
49
- <%= "These gems will need to be upgraded by us or removed before upgrading to Rails #{rails_version}.".italic %>
50
- <%= "This list is likely to contain internal gems, like Cuddlefish.".italic %>
46
+ <%= Rainbow("=> Incompatible with Rails #{rails_version} (with no new versions):").white.bold %>
47
+ <%= Rainbow("These gems will need to be upgraded by us or removed before upgrading to Rails #{rails_version}.").italic %>
48
+ <%= Rainbow("This list is likely to contain internal gems, like Cuddlefish.").italic %>
51
49
 
52
50
  <% incompatible_gems_by_state[:no_new_version].each do |gem| -%>
53
51
  <%= gem_header(gem) %> - new version not found
54
52
  <% end -%>
55
53
 
56
54
  <% end -%>
57
- <%= incompatible_gems.length.to_s.red %> gems incompatible with Rails <%= rails_version %>
55
+ <%= Rainbow(incompatible_gems.length.to_s).red %> gems incompatible with Rails <%= rails_version %>
58
56
  ERB
59
57
 
60
58
  erb_version = ERB.version
@@ -70,8 +68,8 @@ module NextRails
70
68
  end
71
69
 
72
70
  def gem_header(_gem)
73
- header = "#{_gem.name} #{_gem.version}".bold
74
- header << " (loaded from git)".magenta if _gem.sourced_from_git?
71
+ header = Rainbow("#{_gem.name} #{_gem.version}").bold
72
+ header << Rainbow(" (loaded from git)").magenta if _gem.sourced_from_git?
75
73
  header
76
74
  end
77
75
 
@@ -158,14 +156,14 @@ module NextRails
158
156
  header = "#{gem.name} #{gem.version}"
159
157
 
160
158
  puts <<-MESSAGE
161
- #{header.bold.white}: released #{gem.age} (latest version, #{gem.latest_version.version}, released #{gem.latest_version.age})
159
+ #{Rainbow(header.bold.white)}: released #{gem.age} (latest version, #{gem.latest_version.version}, released #{gem.latest_version.age})
162
160
  MESSAGE
163
161
  end
164
162
 
165
163
  percentage_out_of_date = ((out_of_date_gems.count / total_gem_count.to_f) * 100).round
166
164
  footer = <<-MESSAGE
167
- #{sourced_from_git_count.to_s.yellow} gems are sourced from git
168
- #{out_of_date_gems.count.to_s.red} of the #{total_gem_count} gems are out-of-date (#{percentage_out_of_date}%)
165
+ #{Rainbow(sourced_from_git_count.to_s).yellow} gems are sourced from git
166
+ #{Rainbow(out_of_date_gems.count.to_s).red} of the #{total_gem_count} gems are out-of-date (#{percentage_out_of_date}%)
169
167
  MESSAGE
170
168
 
171
169
  puts ''
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NextRails
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.1"
5
5
  end
data/next_rails.gemspec CHANGED
@@ -29,6 +29,6 @@ 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.1.7.3" # limited on purpose, new versions don't work with old rubies
32
+ spec.add_development_dependency "rexml", "3.3.8" # limited on purpose, new versions don't work with old rubies
33
33
  spec.add_development_dependency "webmock", "3.16.2" # limited on purpose, new versions don't work with old rubies
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: next_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernesto Tagwerker
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-09-25 00:00:00.000000000 Z
12
+ date: 2024-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow
@@ -121,14 +121,14 @@ dependencies:
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 3.1.7.3
124
+ version: 3.3.8
125
125
  type: :development
126
126
  prerelease: false
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 3.1.7.3
131
+ version: 3.3.8
132
132
  - !ruby/object:Gem::Dependency
133
133
  name: webmock
134
134
  requirement: !ruby/object:Gem::Requirement
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  requirements: []
210
- rubygems_version: 3.5.9
210
+ rubygems_version: 3.5.11
211
211
  signing_key:
212
212
  specification_version: 4
213
213
  summary: A toolkit to upgrade your next Rails application