next_rails 1.4.1 → 1.4.3

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: 7531328eccac69326b09b911f6fadb8f69b8d9713e6364af67c756059ed3ea18
4
- data.tar.gz: 2bdaab8c916972e76b2623ff37519a2363da4537f4f0a4a4ce47b81343c227cf
3
+ metadata.gz: e64671ecb9db7b44630185f7d4beaab0d0e400042a94c0680f596c3949574ce3
4
+ data.tar.gz: 650f5f5c9ac646f7048df93d4b88bfc6a2e66a5b83b7c67e02d39ea60200e8eb
5
5
  SHA512:
6
- metadata.gz: e65d7cb5da7f4eee2b56210db1a64a2a989a089b84f8ff7024385865710ef78c95aa3eeb16d4f1c194c67a0cf47f51b2970aeeccd6c3fde876c44e000c0d867a
7
- data.tar.gz: 6926ab189b14413dcda593151c3a5586c71dc1ac7880fea0a024a16eb536bb03e46dafb72f568e1c04bb29c155b20423ce1b39fa749cd2ee01409974c3939332
6
+ metadata.gz: 4defd08efc6167e924e628e4324713318c26270e9621e957bd580e34250e8c80befb7f9e463db3a66d058b77793501e78131269f6da98f5b29ff49122d994118
7
+ data.tar.gz: 41ef23669ff6f94d4ca504e7c10e330a6701d6f094ef946ff10e5def762e06f5638d3dab181c433ca2e36b422fa307b1779b1214de59521b4c144b4cb032d430
@@ -13,7 +13,7 @@ jobs:
13
13
  runs-on: ubuntu-latest
14
14
  strategy:
15
15
  matrix:
16
- ruby-version: ["3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
16
+ ruby-version: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
17
17
 
18
18
  steps:
19
19
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,7 +1,18 @@
1
- # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.0...main)
1
+ # main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.3...main)
2
+
3
+ - [BUGFIX: example](https://github.com/fastruby/next_rails/pull/<number>)
2
4
 
3
5
  * Your changes/patches go here.
4
6
 
7
+ # v1.4.3 / 2025-02-20 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.2...v1.4.3)
8
+
9
+ - [Add next_rails --init](https://github.com/fastruby/next_rails/pull/139)
10
+ - [Add Ruby 3.4 support](https://github.com/fastruby/next_rails/pull/133)
11
+
12
+ # v1.4.2 / 2024-10-25 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.1...v1.4.2)
13
+
14
+ - [BUGFIX: Rainbow patch: the methods (bold & white) are not on String](https://github.com/fastruby/next_rails/pull/132)
15
+
5
16
  # v1.4.1 / 2024-10-22 [(commits)](https://github.com/fastruby/next_rails/compare/v1.4.0...v1.4.1)
6
17
 
7
18
  - [BUGFIX: Fix performance regression due to rainbow refinement](https://github.com/fastruby/next_rails/pull/131)
data/exe/next.sh CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/bin/bash
2
2
  if [[ "${@}" == "--init" ]]; then
3
+ echo "The next --init command is deprecated. Please use the next_rails --init command instead."
3
4
  # Add next? top of Gemfile
4
5
  cat <<-STRING > Gemfile.tmp
5
6
  def next?
data/exe/next_rails CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "optparse"
3
3
  require "next_rails/version"
4
+ require "next_rails"
4
5
 
5
6
  options = {}
6
7
  option_parser = OptionParser.new do |opts|
@@ -11,6 +12,10 @@ option_parser = OptionParser.new do |opts|
11
12
  bin/next_rails --version info # Show the version of the gem installed
12
13
  MESSAGE
13
14
 
15
+ opts.on("--init", "Setup the dual-boot configuration") do
16
+ options[:init] = true
17
+ end
18
+
14
19
  opts.on("--version", "show version of the gem") do
15
20
  options[:version] = true
16
21
  end
@@ -23,6 +28,8 @@ end
23
28
 
24
29
  option_parser.parse!
25
30
 
31
+ puts NextRails::Init.call if options.fetch(:init, false)
32
+
26
33
  if options.fetch(:version, false)
27
34
  puts NextRails::VERSION
28
35
  exit 2
@@ -156,7 +156,7 @@ module NextRails
156
156
  header = "#{gem.name} #{gem.version}"
157
157
 
158
158
  puts <<-MESSAGE
159
- #{Rainbow(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})
160
160
  MESSAGE
161
161
  end
162
162
 
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+
5
+ module NextRails
6
+ # This class is responsible for installing the dual-boot files for your.
7
+ class Init
8
+ def self.call
9
+ new.call
10
+ end
11
+
12
+ def call
13
+ return gemfiles_message unless gemfiles?
14
+ return next_gemfiles_message if next_gemfiles?
15
+
16
+ add_next_conditional
17
+ create_sym_link
18
+ copy_gemfile_lock
19
+ message
20
+ end
21
+
22
+ private
23
+
24
+ def gemfiles?
25
+ %w[Gemfile Gemfile.lock].any? { |file| File.exist?(file) }
26
+ end
27
+
28
+ def gemfiles_message
29
+ 'You must have a Gemfile and Gemfile.lock to run the next_rails --init command.'
30
+ end
31
+
32
+ def next_gemfiles?
33
+ %w[Gemfile.next Gemfile.next.lock].any? { |file| File.exist?(file) }
34
+ end
35
+
36
+ def next_gemfiles_message
37
+ 'The next_rails --init command has already been run.'
38
+ end
39
+
40
+ def add_next_conditional
41
+ File.open('Gemfile.tmp', 'w') do |file|
42
+ file.write <<-STRING
43
+ def next?
44
+ File.basename(__FILE__) == "Gemfile.next"
45
+ end
46
+ STRING
47
+ end
48
+
49
+ File.open('Gemfile', 'r') do |original|
50
+ File.open('Gemfile.tmp', 'a') do |temp|
51
+ temp.write(original.read)
52
+ end
53
+ end
54
+
55
+ File.rename('Gemfile.tmp', 'Gemfile')
56
+ end
57
+
58
+ def create_sym_link
59
+ File.symlink('Gemfile', 'Gemfile.next')
60
+ end
61
+
62
+ def copy_gemfile_lock
63
+ FileUtils.cp('Gemfile.lock', 'Gemfile.next.lock')
64
+ end
65
+
66
+ def message
67
+ <<-MESSAGE
68
+ Created Gemfile.next (a symlink to your Gemfile). Your Gemfile has been modified to support dual-booting!
69
+
70
+ There's just one more step: modify your Gemfile to use a newer version of Rails using the \`next?\` helper method.
71
+
72
+ For example, here's how to go from 5.2.8.1 to 6.0.6.1:
73
+
74
+ if next?
75
+ gem "rails", "6.0.6.1"
76
+ else
77
+ gem "rails", "5.2.8.1"
78
+ end
79
+ MESSAGE
80
+ end
81
+ end
82
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NextRails
4
- VERSION = "1.4.1"
4
+ VERSION = "1.4.3"
5
5
  end
data/lib/next_rails.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "next_rails/gem_info"
4
4
  require "next_rails/version"
5
+ require "next_rails/init"
5
6
  require "next_rails/bundle_report"
6
7
  require "next_rails/bundle_report/ruby_version_compatibility"
7
8
  require "deprecation_tracker"
data/next_rails.gemspec CHANGED
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "timecop", "~> 0.9.1"
31
31
  spec.add_development_dependency "byebug"
32
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.16.2" # limited on purpose, new versions don't work with old rubies
33
+ spec.add_development_dependency "webmock", "3.20.0"
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.1
4
+ version: 1.4.3
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-10-23 00:00:00.000000000 Z
12
+ date: 2025-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow
@@ -135,14 +135,14 @@ dependencies:
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 3.16.2
138
+ version: 3.20.0
139
139
  type: :development
140
140
  prerelease: false
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 3.16.2
145
+ version: 3.20.0
146
146
  description: A set of handy tools to upgrade your Rails application and keep it up
147
147
  to date
148
148
  email:
@@ -185,6 +185,7 @@ files:
185
185
  - lib/next_rails/bundle_report.rb
186
186
  - lib/next_rails/bundle_report/ruby_version_compatibility.rb
187
187
  - lib/next_rails/gem_info.rb
188
+ - lib/next_rails/init.rb
188
189
  - lib/next_rails/version.rb
189
190
  - next_rails.gemspec
190
191
  - pull_request_template.md