end_of_life 0.4.0 → 0.4.1
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/CHANGELOG.md +10 -1
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/end_of_life/cli.rb +2 -1
- data/lib/end_of_life/options.rb +3 -3
- data/lib/end_of_life/ruby_version/parser.rb +12 -4
- data/lib/end_of_life/ruby_version.rb +4 -0
- data/lib/end_of_life/version.rb +1 -1
- metadata +1 -2
- data/.standard.yml +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8e0689d1cdf6da1fa737f8d699a060a8544184dfb345d6af4093e6e5e000c13
|
4
|
+
data.tar.gz: 608169452246f72b9351b07ae4f243d4ce74c3416c451a5fdf600b97dbc3f529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57c0401637ca7d60d59d27ab35f4bee948f09bf188df6189a41be14ceb906c50ee77059a550076122f14a3b118c9e6fdd2f10dd520d19b562670c8fe229cf5df
|
7
|
+
data.tar.gz: 8cf1db7f6007559d3066696e1f3820fdaae1b055654456d47d48d67b6828530315992aae95ac9ea2ecf3927b3a39b80f84df7a762d24cc6c4f073bc2956d648e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.4.1] - 2025-05-23
|
4
|
+
|
5
|
+
- [BUGFIX] Handle empty/invalid version files
|
6
|
+
- if a file like `.ruby-version` was empty, we would parse it it's version as
|
7
|
+
`0` which would take precedence over any other file when comparing versions.
|
8
|
+
- We now ignore those files and any file which version parses to `0`.
|
9
|
+
|
3
10
|
## [0.4.0] - 2025-05-23
|
4
11
|
|
5
12
|
- Skip archived repos (by default)
|
@@ -154,7 +161,9 @@ $ end_of_life --user=matz # searches on matz's repositories
|
|
154
161
|
|
155
162
|
- Initial release
|
156
163
|
|
157
|
-
[unreleased]: https://github.com/MatheusRich/end_of_life/compare/v0.
|
164
|
+
[unreleased]: https://github.com/MatheusRich/end_of_life/compare/v0.4.1...HEAD
|
165
|
+
[0.4.1]: https://github.com/MatheusRich/end_of_life/releases/tag/v0.4.1
|
166
|
+
[0.4.0]: https://github.com/MatheusRich/end_of_life/releases/tag/v0.4.0
|
158
167
|
[0.3.0]: https://github.com/MatheusRich/end_of_life/releases/tag/v0.3.0
|
159
168
|
[0.2.0]: https://github.com/MatheusRich/end_of_life/releases/tag/v0.2.0
|
160
169
|
[0.1.0]: https://github.com/MatheusRich/end_of_life/releases/tag/v0.1.0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -41,9 +41,9 @@ There are some options to help you filter down the results:
|
|
41
41
|
```
|
42
42
|
Usage: end_of_life [options]
|
43
43
|
--exclude=NAME,NAME2 Exclude repositories containing a certain word in its name. You can specify up to five words.
|
44
|
-
--public-only Searches only public
|
45
|
-
--private-only Searches only private
|
46
|
-
--repo, --repository=USER/REPO Searches a specific
|
44
|
+
--public-only Searches only public repositories
|
45
|
+
--private-only Searches only private repositories
|
46
|
+
--repo, --repository=USER/REPO Searches a specific repository
|
47
47
|
--org, --organization=ORG,ORG2 Searches within specific organizations
|
48
48
|
-u, --user=NAME Sets the user used on the repository search
|
49
49
|
--max-eol-days-away NUMBER Sets the maximum number of days away a version can be from EOL. It defaults to 0.
|
data/lib/end_of_life/cli.rb
CHANGED
@@ -62,7 +62,8 @@ module EndOfLife
|
|
62
62
|
return
|
63
63
|
end
|
64
64
|
|
65
|
-
|
65
|
+
word = (repositories.size == 1) ? "repository" : "repositories"
|
66
|
+
puts "Found #{repositories.size} #{word} using EOL Ruby (<= #{RubyVersion.latest_eol(at: max_eol_date)}):"
|
66
67
|
puts end_of_life_table(repositories)
|
67
68
|
exit(-1)
|
68
69
|
end
|
data/lib/end_of_life/options.rb
CHANGED
@@ -14,15 +14,15 @@ module EndOfLife
|
|
14
14
|
options[:excludes] = excludes.first(5)
|
15
15
|
end
|
16
16
|
|
17
|
-
opts.on("--public-only", "Searches only public
|
17
|
+
opts.on("--public-only", "Searches only public repositories") do
|
18
18
|
options[:visibility] = :public
|
19
19
|
end
|
20
20
|
|
21
|
-
opts.on("--private-only", "Searches only private
|
21
|
+
opts.on("--private-only", "Searches only private repositories") do
|
22
22
|
options[:visibility] = :private
|
23
23
|
end
|
24
24
|
|
25
|
-
opts.on("--repo=USER/REPO", "--repository=USER/REPO", "Searches a specific
|
25
|
+
opts.on("--repo=USER/REPO", "--repository=USER/REPO", "Searches a specific repository") do |repository|
|
26
26
|
options[:repository] = repository
|
27
27
|
end
|
28
28
|
|
@@ -7,7 +7,9 @@ module EndOfLife
|
|
7
7
|
extend self
|
8
8
|
|
9
9
|
def parse_file(file_name:, content:)
|
10
|
-
if
|
10
|
+
return if content.strip.empty?
|
11
|
+
|
12
|
+
version = if file_name == ".ruby-version"
|
11
13
|
parse_ruby_version_file(content)
|
12
14
|
elsif file_name == "Gemfile.lock"
|
13
15
|
parse_gemfile_lock_file(content)
|
@@ -18,6 +20,14 @@ module EndOfLife
|
|
18
20
|
else
|
19
21
|
raise ArgumentError, "Unsupported file #{file_name}"
|
20
22
|
end
|
23
|
+
|
24
|
+
# Gem::Version is pretty forgiving and will accept empty strings
|
25
|
+
# as valid versions. This is a catch-all to ensure we don't return
|
26
|
+
# a version 0, which always takes precedence over any other version
|
27
|
+
# when comparing.
|
28
|
+
return if version&.zero?
|
29
|
+
|
30
|
+
version
|
21
31
|
end
|
22
32
|
|
23
33
|
private
|
@@ -38,11 +48,9 @@ module EndOfLife
|
|
38
48
|
end
|
39
49
|
|
40
50
|
def parse_gemfile_file(file_content)
|
41
|
-
return if file_content.empty?
|
42
|
-
|
43
51
|
with_temp_gemfile(file_content) do |temp_gemfile|
|
44
52
|
gemfile_version = temp_gemfile.ruby_version&.gem_version
|
45
|
-
return
|
53
|
+
return if gemfile_version.nil?
|
46
54
|
|
47
55
|
RubyVersion.new(gemfile_version)
|
48
56
|
end
|
@@ -6,6 +6,8 @@ module EndOfLife
|
|
6
6
|
class RubyVersion
|
7
7
|
include Comparable
|
8
8
|
|
9
|
+
ZERO = Gem::Version.new("0")
|
10
|
+
|
9
11
|
class << self
|
10
12
|
include Dry::Monads[:try]
|
11
13
|
|
@@ -58,6 +60,8 @@ module EndOfLife
|
|
58
60
|
@version <=> other.version
|
59
61
|
end
|
60
62
|
|
63
|
+
def zero? = @version == ZERO
|
64
|
+
|
61
65
|
def to_s
|
62
66
|
@version.to_s
|
63
67
|
end
|
data/lib/end_of_life/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: end_of_life
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matheus Richard
|
@@ -104,7 +104,6 @@ extensions: []
|
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
106
|
- ".rspec"
|
107
|
-
- ".standard.yml"
|
108
107
|
- ".tool-versions"
|
109
108
|
- CHANGELOG.md
|
110
109
|
- Gemfile
|
data/.standard.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby_version: 2.7.1
|