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 +4 -4
- data/.github/workflows/main.yml +1 -1
- data/CHANGELOG.md +12 -1
- data/exe/next.sh +1 -0
- data/exe/next_rails +7 -0
- data/lib/next_rails/bundle_report.rb +1 -1
- data/lib/next_rails/init.rb +82 -0
- data/lib/next_rails/version.rb +1 -1
- data/lib/next_rails.rb +1 -0
- data/next_rails.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e64671ecb9db7b44630185f7d4beaab0d0e400042a94c0680f596c3949574ce3
|
4
|
+
data.tar.gz: 650f5f5c9ac646f7048df93d4b88bfc6a2e66a5b83b7c67e02d39ea60200e8eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4defd08efc6167e924e628e4324713318c26270e9621e957bd580e34250e8c80befb7f9e463db3a66d058b77793501e78131269f6da98f5b29ff49122d994118
|
7
|
+
data.tar.gz: 41ef23669ff6f94d4ca504e7c10e330a6701d6f094ef946ff10e5def762e06f5638d3dab181c433ca2e36b422fa307b1779b1214de59521b4c144b4cb032d430
|
data/.github/workflows/main.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,18 @@
|
|
1
|
-
# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.4.
|
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
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
|
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
|
data/lib/next_rails/version.rb
CHANGED
data/lib/next_rails.rb
CHANGED
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.
|
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.
|
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:
|
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.
|
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.
|
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
|