next_rails 1.2.1 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +21 -35
- data/.github/ISSUE_TEMPLATE/feature_request.md +10 -27
- data/.github/workflows/main.yml +1 -1
- data/CHANGELOG.md +15 -1
- data/README.md +11 -2
- data/exe/bundle_report +6 -1
- data/lib/deprecation_tracker.rb +6 -2
- data/lib/next_rails/bundle_report.rb +54 -15
- data/lib/next_rails/gem_info.rb +3 -1
- data/lib/next_rails/version.rb +3 -1
- data/pull_request_template.md +11 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57c4fac0e45a33071dcb6df1938840ba6854ab1ccc4dd7782e365568e91f17c5
|
4
|
+
data.tar.gz: 10e5be9d8d4bbfa9dfc7b2dd04905d1c47a76f600be53a8a7f61d25ca3628589
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3377c0643a78dda0406d386adfbc4c749f507a2d000d13f84b6ee13cd9e3bab79cbebea75efb56e6e94c936a2794e77eda0aca4e684dd025ec1fa4c91c4a2c33
|
7
|
+
data.tar.gz: 355383fd6dc9ec1f726ec2c2bf43b4bf9b0b289dd2ee2d7e321e87deff18d86f8f9eb6469e694d40797a676a1e3935ce1712b208e153f6857b447be26807138e
|
@@ -6,46 +6,32 @@ labels: bug
|
|
6
6
|
assignees: ""
|
7
7
|
---
|
8
8
|
|
9
|
-
|
9
|
+
<!--- Before creating a bug report, please, answer the following questions -->
|
10
|
+
<!--- Did you check the documentation for answers? -->
|
11
|
+
<!--- Did you make sure that this bug has not already been reported? -->
|
10
12
|
|
11
|
-
|
13
|
+
## Expected Behavior
|
14
|
+
<!--- Tell us what should happen -->
|
15
|
+
<!--- For example: When I [do X], it should [produce Y] -->
|
12
16
|
|
13
|
-
|
14
|
-
|
15
|
-
|
17
|
+
## Actual Behavior
|
18
|
+
<!--- Tell us what happens instead -->
|
19
|
+
<!--- For example: When I [did X], it [produced Y] -->
|
16
20
|
|
17
|
-
|
21
|
+
## Possible Fix
|
22
|
+
<!--- Optionally suggest a fix or work around -->
|
18
23
|
|
19
|
-
|
24
|
+
## To Reproduce
|
25
|
+
<!--- Optionally provide a link to a live example -->
|
20
26
|
|
21
|
-
|
27
|
+
<!--- Otherwise, please provide a set of reproduction steps -->
|
28
|
+
1.
|
29
|
+
2.
|
30
|
+
3.
|
31
|
+
4.
|
22
32
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Please include a detailed description of the actual behavior of the application.
|
28
|
-
|
29
|
-
**Steps to reproduce:**
|
30
|
-
|
31
|
-
How do I achieve this behavior? Use the following format to provide a step-by-step guide:
|
32
|
-
|
33
|
-
1. Step 1: ...
|
34
|
-
2. Step 2: ...
|
35
|
-
|
36
|
-
**Context and environment:**
|
37
|
-
|
38
|
-
Provide any relevant information about your setup (Customize the list accordingly based on what info is relevant to this project)
|
39
|
-
|
40
|
-
1. Version of the software the issue is being opened for.
|
41
|
-
2. Operating System
|
42
|
-
3. Operating System version
|
43
|
-
4. Ruby version
|
44
|
-
|
45
|
-
_Delete any information that is not relevant._
|
46
|
-
|
47
|
-
**Logs**
|
48
|
-
|
49
|
-
Include relevant log snippets or files here.
|
33
|
+
## Additional Information
|
34
|
+
<!--- Include any relevant details about your environment (branch, browser, OS) -->
|
35
|
+
<!--- and the bug (screenshots, logs, etc) -->
|
50
36
|
|
51
37
|
**I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md)**
|
@@ -6,35 +6,18 @@ labels: enhancement
|
|
6
6
|
assignees: ""
|
7
7
|
---
|
8
8
|
|
9
|
-
|
9
|
+
<!--- Before creating a feature request, please, answer the following questions -->
|
10
|
+
<!--- Did you check the documentation for this feature? -->
|
11
|
+
<!--- Did you make sure that this feature has not already been requested? -->
|
10
12
|
|
11
|
-
|
13
|
+
## Description
|
14
|
+
<!--- Provide a description of the change or addition you are proposing -->
|
12
15
|
|
13
|
-
|
14
|
-
|
16
|
+
## Possible Implementation
|
17
|
+
<!--- Optionally suggest an idea to implement or a workaround to fix the issue -->
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
**Describe the feature:**
|
21
|
-
|
22
|
-
Please include a detailed description of the feature you are requesting and any detail on it’s expected behavior.
|
23
|
-
|
24
|
-
> **As a \<role name\>** > **I do \<something\>** > **And then I do \<another action\>** > **And I see \<some result\>**
|
25
|
-
|
26
|
-
**Problem:**
|
27
|
-
|
28
|
-
Please include a detailed description of the problem this feature would solve.
|
29
|
-
|
30
|
-
> **As a \<role name\>** > **I want to \<do something\>** > **So that I can achieve a \<goal\>**
|
31
|
-
|
32
|
-
**Mockups:**
|
33
|
-
|
34
|
-
Include any mockup idea related to the requested feature if it applies.
|
35
|
-
|
36
|
-
**Resources:**
|
37
|
-
|
38
|
-
If you have resources related to the implementation or research for this feature, add them here.
|
19
|
+
## Resources:
|
20
|
+
<!--- If you have resources related to the implementation or research for this feature, add them here. -->
|
21
|
+
<!--- If possible, include any mockup ideas related to the requested feature. -->
|
39
22
|
|
40
23
|
**I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md)**
|
data/.github/workflows/main.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,16 @@
|
|
1
|
-
# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.
|
1
|
+
# main [(unreleased)](https://github.com/fastruby/next_rails/compare/v1.2.3...main)
|
2
|
+
* Your changes/patches go here.
|
3
|
+
|
4
|
+
# v1.2.3 / 2023-04-12 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.2...v1.2.3)
|
5
|
+
|
6
|
+
- [Fix ERB deprecation warning in Ruby 3.1]
|
7
|
+
|
8
|
+
- [Remove Rails gems from compatibility check]
|
9
|
+
|
10
|
+
# v1.2.2 / 2023-03-03 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.1...v1.2.2)
|
11
|
+
* [BUGFIX: Fixed `KernelWarnTracker#warn signature to match `Kernel#warn` for ruby 2.5+](https://github.com/fastruby/next_rails/pull/82)
|
12
|
+
* [CHORE: Added updated templates for bug fixes, feature requests and pull requests](https://github.com/fastruby/next_rails/pull/64) as per [this RFC](https://github.com/fastruby/RFCs/blob/main/2021-10-13-github-templates.md)
|
13
|
+
* [FEATURE: Turn BundleReport into a module](https://github.com/fastruby/next_rails/pull/63)
|
2
14
|
|
3
15
|
# v1.2.1 / 2022-09-26 [(commits)](https://github.com/fastruby/next_rails/compare/v1.2.0...v1.2.1)
|
4
16
|
|
@@ -8,6 +20,8 @@
|
|
8
20
|
|
9
21
|
- [BUGFIX: bundle_report outdated was giving an exception due to missing method latest_version](https://github.com/fastruby/next_rails/pull/62)
|
10
22
|
|
23
|
+
- [FEATURE: `bundle_report outdated` outputs in JSON format when passed optional argument](https://github.com/fastruby/next_rails/pull/61)
|
24
|
+
|
11
25
|
# v1.2.0 / 2022-08-12 [(commits)](https://github.com/fastruby/next_rails/compare/v1.1.0...v1.2.0)
|
12
26
|
|
13
27
|
- [FEATURE: Support Ruby versions as old as Ruby 2.0](https://github.com/fastruby/next_rails/pull/54)
|
data/README.md
CHANGED
@@ -29,10 +29,17 @@ Learn about your Gemfile and see what needs updating.
|
|
29
29
|
```bash
|
30
30
|
# Show all out-of-date gems
|
31
31
|
bundle_report outdated
|
32
|
+
|
32
33
|
# Show five oldest, out-of-date gems
|
33
34
|
bundle_report outdated | head -n 5
|
35
|
+
|
36
|
+
# Show all out-of-date gems in machine readable JSON format
|
37
|
+
bundle_report outdated --json
|
38
|
+
|
34
39
|
# Show gems that don't work with Rails 5.2.0
|
35
40
|
bundle_report compatibility --rails-version=5.2.0
|
41
|
+
|
42
|
+
# Show the usual help message
|
36
43
|
bundle_report --help
|
37
44
|
# Find minimum compatible ruby version with Rails 7.0.0
|
38
45
|
bundle_report ruby_check --rails-version=7.0.0
|
@@ -91,7 +98,7 @@ deprecations run
|
|
91
98
|
deprecations --help # For more options and examples
|
92
99
|
```
|
93
100
|
|
94
|
-
Right now, the path to the shitlist is hardcoded so make sure you store yours at `spec/support/
|
101
|
+
Right now, the path to the shitlist is hardcoded so make sure you store yours at `spec/support/deprecation_warning.shitlist.json`.
|
95
102
|
|
96
103
|
#### `next_rails` command
|
97
104
|
|
@@ -115,7 +122,9 @@ next rails s # Start server using Gemfile.next
|
|
115
122
|
|
116
123
|
## Installation
|
117
124
|
|
118
|
-
Add this line to your application's Gemfile
|
125
|
+
Add this line to your application's Gemfile
|
126
|
+
|
127
|
+
> NOTE: If you add this gem to a group, make sure it is the test env group
|
119
128
|
|
120
129
|
```ruby
|
121
130
|
gem 'next_rails'
|
data/exe/bundle_report
CHANGED
@@ -17,6 +17,7 @@ at_exit do
|
|
17
17
|
Examples:
|
18
18
|
#{$0} compatibility --rails-version 5.0
|
19
19
|
#{$0} outdated
|
20
|
+
#{$0} outdated --json
|
20
21
|
|
21
22
|
ruby_check To find a compatible ruby version for the target rails version
|
22
23
|
|
@@ -36,6 +37,10 @@ at_exit do
|
|
36
37
|
options[:include_rails_gems] = true
|
37
38
|
end
|
38
39
|
|
40
|
+
opts.on("--json", "Output JSON in outdated report (defaults to false)") do
|
41
|
+
options[:format] = 'json'
|
42
|
+
end
|
43
|
+
|
39
44
|
opts.on_tail("-h", "--help", "Show this message") do
|
40
45
|
puts opts
|
41
46
|
exit
|
@@ -54,7 +59,7 @@ at_exit do
|
|
54
59
|
|
55
60
|
case report_type
|
56
61
|
when "ruby_check" then NextRails::BundleReport.compatible_ruby_version(rails_version: options.fetch(:rails_version))
|
57
|
-
when "outdated" then NextRails::BundleReport.outdated
|
62
|
+
when "outdated" then NextRails::BundleReport.outdated(options.fetch(:format, nil))
|
58
63
|
else
|
59
64
|
NextRails::BundleReport.compatibility(rails_version: options.fetch(:rails_version, "5.0"), include_rails_gems: options.fetch(:include_rails_gems, false))
|
60
65
|
end
|
data/lib/deprecation_tracker.rb
CHANGED
@@ -18,12 +18,16 @@ class DeprecationTracker
|
|
18
18
|
@callbacks ||= []
|
19
19
|
end
|
20
20
|
|
21
|
-
def warn(*messages)
|
21
|
+
def warn(*messages, uplevel: nil)
|
22
22
|
KernelWarnTracker.callbacks.each do |callback|
|
23
23
|
messages.each { |message| callback.(message) }
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0")
|
27
|
+
super *messages
|
28
|
+
else
|
29
|
+
super
|
30
|
+
end
|
27
31
|
end
|
28
32
|
end
|
29
33
|
|
@@ -5,8 +5,10 @@ require "json"
|
|
5
5
|
require "net/http"
|
6
6
|
|
7
7
|
module NextRails
|
8
|
-
|
9
|
-
|
8
|
+
module BundleReport
|
9
|
+
extend self
|
10
|
+
|
11
|
+
def compatibility(rails_version: nil, include_rails_gems: nil)
|
10
12
|
incompatible_gems = NextRails::GemInfo.all.reject do |gem|
|
11
13
|
gem.compatible_with_rails?(rails_version: rails_version) || (!include_rails_gems && gem.from_rails?)
|
12
14
|
end.sort_by { |gem| gem.name }
|
@@ -47,16 +49,16 @@ module NextRails
|
|
47
49
|
<%= incompatible_gems.length.to_s.red %> gems incompatible with Rails <%= rails_version %>
|
48
50
|
ERB
|
49
51
|
|
50
|
-
puts ERB.new(template,
|
52
|
+
puts ERB.new(template, trim_mode: "-").result(binding)
|
51
53
|
end
|
52
54
|
|
53
|
-
def
|
55
|
+
def gem_header(_gem)
|
54
56
|
header = "#{_gem.name} #{_gem.version}".bold
|
55
57
|
header << " (loaded from git)".magenta if _gem.sourced_from_git?
|
56
58
|
header
|
57
59
|
end
|
58
60
|
|
59
|
-
def
|
61
|
+
def compatible_ruby_version(rails_version)
|
60
62
|
# find all the versions of rails gem
|
61
63
|
uri = URI('https://rubygems.org/api/v1/versions/rails.json')
|
62
64
|
res = Net::HTTP.get_response(uri)
|
@@ -95,25 +97,62 @@ module NextRails
|
|
95
97
|
end
|
96
98
|
end
|
97
99
|
|
98
|
-
def
|
100
|
+
def outdated(format = nil)
|
99
101
|
gems = NextRails::GemInfo.all
|
100
102
|
out_of_date_gems = gems.reject(&:up_to_date?).sort_by(&:created_at)
|
101
|
-
percentage_out_of_date = ((out_of_date_gems.count / gems.count.to_f) * 100).round
|
102
103
|
sourced_from_git = gems.select(&:sourced_from_git?)
|
103
104
|
|
104
|
-
|
105
|
-
|
105
|
+
if format == 'json'
|
106
|
+
output_to_json(out_of_date_gems, gems.count, sourced_from_git.count)
|
107
|
+
else
|
108
|
+
output_to_stdout(out_of_date_gems, gems.count, sourced_from_git.count)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def output_to_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
|
113
|
+
obj = build_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
|
114
|
+
puts JSON.pretty_generate(obj)
|
115
|
+
end
|
116
|
+
|
117
|
+
def build_json(out_of_date_gems, total_gem_count, sourced_from_git_count)
|
118
|
+
output = Hash.new { [] }
|
119
|
+
out_of_date_gems.each do |gem|
|
120
|
+
output[:outdated_gems] += [
|
121
|
+
{
|
122
|
+
name: gem.name,
|
123
|
+
installed_version: gem.version,
|
124
|
+
installed_age: gem.age,
|
125
|
+
latest_version: gem.latest_version.version,
|
126
|
+
latest_age: gem.latest_version.age
|
127
|
+
}
|
128
|
+
]
|
129
|
+
end
|
130
|
+
|
131
|
+
output.merge(
|
132
|
+
{
|
133
|
+
sourced_from_git_count: sourced_from_git_count,
|
134
|
+
total_gem_count: total_gem_count
|
135
|
+
}
|
136
|
+
)
|
137
|
+
end
|
138
|
+
|
139
|
+
def output_to_stdout(out_of_date_gems, total_gem_count, sourced_from_git_count)
|
140
|
+
out_of_date_gems.each do |gem|
|
141
|
+
header = "#{gem.name} #{gem.version}"
|
106
142
|
|
107
143
|
puts <<-MESSAGE
|
108
|
-
#{header.bold.white}: released #{
|
144
|
+
#{header.bold.white}: released #{gem.age} (latest version, #{gem.latest_version.version}, released #{gem.latest_version.age})
|
109
145
|
MESSAGE
|
110
146
|
end
|
111
147
|
|
112
|
-
|
113
|
-
|
114
|
-
#{
|
115
|
-
#{
|
148
|
+
percentage_out_of_date = ((out_of_date_gems.count / total_gem_count.to_f) * 100).round
|
149
|
+
footer = <<-MESSAGE
|
150
|
+
#{sourced_from_git_count.to_s.yellow} gems are sourced from git
|
151
|
+
#{out_of_date_gems.count.to_s.red} of the #{total_gem_count} gems are out-of-date (#{percentage_out_of_date}%)
|
116
152
|
MESSAGE
|
153
|
+
|
154
|
+
puts ''
|
155
|
+
puts footer
|
117
156
|
end
|
118
157
|
end
|
119
|
-
end
|
158
|
+
end
|
data/lib/next_rails/gem_info.rb
CHANGED
@@ -39,6 +39,8 @@ module NextRails
|
|
39
39
|
"activejob",
|
40
40
|
"activestorage",
|
41
41
|
"activesupport",
|
42
|
+
"actionmailbox",
|
43
|
+
"actiontext",
|
42
44
|
"railties",
|
43
45
|
].freeze
|
44
46
|
|
@@ -79,7 +81,7 @@ module NextRails
|
|
79
81
|
def state(rails_version)
|
80
82
|
if compatible_with_rails?(rails_version: rails_version)
|
81
83
|
:compatible
|
82
|
-
elsif latest_compatible_version.version == "NOT FOUND"
|
84
|
+
elsif latest_compatible_version && latest_compatible_version.version == "NOT FOUND"
|
83
85
|
:no_new_version
|
84
86
|
elsif latest_compatible_version
|
85
87
|
:found_compatible
|
data/lib/next_rails/version.rb
CHANGED
data/pull_request_template.md
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
-
|
1
|
+
## Description
|
2
|
+
<!--- Describe your changes in detail -->
|
2
3
|
|
3
|
-
|
4
|
+
## Motivation and Context
|
5
|
+
<!--- Why is this change required? What problem does it solve? -->
|
6
|
+
<!--- If it fixes an open issue, please link to the issue here. -->
|
4
7
|
|
5
|
-
|
8
|
+
## How Has This Been Tested?
|
9
|
+
<!--- Include any relevant details about your testing environment and the steps you followed -->
|
10
|
+
<!--- For example: I am using [Safari|Firefox|Chrome] then I visit [the users path] -->
|
6
11
|
|
7
|
-
|
12
|
+
## Screenshots:
|
13
|
+
<!-- Add screenshots (applicable to any UI changes) -->
|
8
14
|
|
9
|
-
I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md)
|
15
|
+
**I will abide by the [code of conduct](https://github.com/fastruby/next_rails/blob/main/CODE_OF_CONDUCT.md)**
|
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.2.
|
4
|
+
version: 1.2.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: 2023-04-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: '0'
|
196
196
|
requirements: []
|
197
|
-
rubygems_version: 3.
|
197
|
+
rubygems_version: 3.0.9
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: A toolkit to upgrade your next Rails application
|