libyear-rb 0.2.0 → 0.4.0

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: 199716d9e9d674a6b897277931b9cecaa3a762807da3341ff13bdd3b865d1587
4
- data.tar.gz: e430a6dbb744e921f27a3218e1c31eaa5de9726beece1a07e7dfdc6890013d27
3
+ metadata.gz: 5fd3a3cb807112b4410055962b40fffaa8bd60400e3cd8a85cf258117d530288
4
+ data.tar.gz: da35a4dc601ec425a319127cf2c17e5ddc7089c09b60986610ed20b747b29b02
5
5
  SHA512:
6
- metadata.gz: 43697c73f71080fceeec2b4c433f326b693c17e47a9b2496e714ae9e58b1ee74f7a0efbeec7dbd70ea329ed09646e81b248df0ba01dc7d1372ebd7845f0aab33
7
- data.tar.gz: 1c7be9d76720da7a6992f7b0d028d0e6d7285209c80d657a8fba2611a831a7e1203265bff85cfa8d0e8aa6c399fc6f9aa487415fc39c555575391a67cccfed5c
6
+ metadata.gz: 024fe24ce2741e01b0980bdbe7b12f37acf0c7bbb2721e6439578e66330d15ecaabe5265c849e98d05db9906c5bf268ffa59cd45ccddb0f1bf1b954c9369ae08
7
+ data.tar.gz: 32404a74060ab2b2bcee283fcd8870a187744597840a55a6d01e98965c2d2dccf46517544ddd63d3b3dbff79b38f9b86bfa3d7e88fe69ba291bb81ed89e16ebc
@@ -5,19 +5,41 @@ on:
5
5
  pull_request:
6
6
  jobs:
7
7
  testing:
8
- name: Testing
8
+ name: Testing (${{ matrix.gemfile }})
9
9
  runs-on: ubuntu-24.04-arm
10
+ strategy:
11
+ matrix:
12
+ gemfile:
13
+ - gems1
14
+ - gems2
15
+ - gems3
16
+ env:
17
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
10
18
  steps:
11
- - uses: actions/checkout@v6
19
+ - uses: actions/checkout@v7
12
20
  - uses: ruby/setup-ruby@v1
13
21
  with:
14
22
  bundler-cache: true
15
23
  - run: bundle exec rake test
24
+ did_all_tests_pass:
25
+ name: Testing
26
+ needs: testing
27
+ if: always()
28
+ runs-on: ubuntu-24.04-arm
29
+ steps:
30
+ - run: |
31
+ if ${{ needs.testing.result == 'success' }}
32
+ then
33
+ echo "All tests pass"
34
+ else
35
+ echo "Some tests failed"
36
+ false
37
+ fi
16
38
  linting:
17
39
  name: Linting
18
40
  runs-on: ubuntu-24.04-arm
19
41
  steps:
20
- - uses: actions/checkout@v6
42
+ - uses: actions/checkout@v7
21
43
  - uses: ruby/setup-ruby@v1
22
44
  with:
23
45
  bundler-cache: true
@@ -16,7 +16,7 @@ jobs:
16
16
  contents: write
17
17
 
18
18
  steps:
19
- - uses: actions/checkout@v6
19
+ - uses: actions/checkout@v7
20
20
  - uses: ruby/setup-ruby@v1
21
21
  with:
22
22
  bundler-cache: true
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.4.0] - 2026-11-06
6
+
7
+ ### Fixed
8
+
9
+ - Fixed compatibility between the `gems` gem v2 and v3, which caused the cache to be unreadable, and libyear exiting without result or output.
10
+
11
+ ## [0.3.0] - 2026-09-02
12
+
13
+ ### Fixed
14
+
15
+ - Prereleases are now excluded from the version distance and freshness gap when the installed version is stable, so a beta published above the latest stable release no longer inflates the report.
16
+
5
17
  ## [0.2.0] - 2026-08-19
6
18
 
7
19
  ### Added
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "irb"
6
+ gem "minitest"
7
+ gem "minitest-rg"
8
+ gem "rake"
9
+ gem "rubocop-minitest"
10
+ gem "rubocop-rake"
11
+ gem "standard"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ gemspec path: ".."
4
+
5
+ eval_gemfile "common.rb"
6
+
7
+ gem "gems", "1.3.0"
@@ -0,0 +1,111 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ libyear-rb (0.4.0)
5
+ gems (>= 1.3)
6
+ logger
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.3)
12
+ drb (2.2.3)
13
+ erb (6.0.7)
14
+ gems (1.3.0)
15
+ io-console (0.9.5)
16
+ irb (1.18.0)
17
+ pp (>= 0.6.0)
18
+ prism (>= 1.3.0)
19
+ rdoc (>= 4.0.0)
20
+ reline (>= 0.4.2)
21
+ json (3.1.0)
22
+ language_server-protocol (3.17.0.6)
23
+ lint_roller (1.1.0)
24
+ logger (1.7.0)
25
+ minitest (6.0.6)
26
+ drb (~> 2.0)
27
+ prism (~> 1.5)
28
+ minitest-rg (5.4.0)
29
+ minitest (>= 5.0, < 7)
30
+ parallel (1.28.0)
31
+ parser (3.3.13.0)
32
+ ast (~> 2.4.1)
33
+ racc
34
+ pp (0.6.4)
35
+ prettyprint
36
+ prettyprint (0.2.1)
37
+ prism (1.9.0)
38
+ racc (1.8.1)
39
+ rainbow (3.1.1)
40
+ rake (13.4.2)
41
+ rbs (4.1.3)
42
+ logger
43
+ prism (>= 1.6.0)
44
+ tsort
45
+ rdoc (8.1.0)
46
+ erb
47
+ prism (>= 1.6.0)
48
+ rbs (>= 4.0.0)
49
+ tsort
50
+ regexp_parser (2.13.1)
51
+ reline (0.7.0)
52
+ io-console (~> 0.5)
53
+ rubocop (1.91.0)
54
+ json (>= 2.3)
55
+ language_server-protocol (~> 3.17.0.2)
56
+ lint_roller (~> 1.1.0)
57
+ parallel (>= 1.10)
58
+ parser (>= 3.3.0.2)
59
+ rainbow (>= 2.2.2, < 4.0)
60
+ regexp_parser (>= 2.9.3, < 3.0)
61
+ rubocop-ast (>= 1.49.0, < 2.0)
62
+ ruby-progressbar (~> 1.7)
63
+ unicode-display_width (>= 2.4.0, < 4.0)
64
+ rubocop-ast (1.50.0)
65
+ parser (>= 3.3.7.2)
66
+ prism (~> 1.7)
67
+ rubocop-minitest (0.41.0)
68
+ lint_roller (~> 1.1)
69
+ rubocop (>= 1.89.0, < 2.0)
70
+ rubocop-ast (>= 1.38.0, < 2.0)
71
+ rubocop-performance (1.26.1)
72
+ lint_roller (~> 1.1)
73
+ rubocop (>= 1.75.0, < 2.0)
74
+ rubocop-ast (>= 1.47.1, < 2.0)
75
+ rubocop-rake (0.7.1)
76
+ lint_roller (~> 1.1)
77
+ rubocop (>= 1.72.1)
78
+ ruby-progressbar (1.13.0)
79
+ standard (1.57.0)
80
+ language_server-protocol (~> 3.17.0.2)
81
+ lint_roller (~> 1.0)
82
+ rubocop (~> 1.91.0)
83
+ standard-custom (~> 1.0.0)
84
+ standard-performance (~> 1.8)
85
+ standard-custom (1.0.2)
86
+ lint_roller (~> 1.0)
87
+ rubocop (~> 1.50)
88
+ standard-performance (1.9.0)
89
+ lint_roller (~> 1.1)
90
+ rubocop-performance (~> 1.26.0)
91
+ tsort (0.2.0)
92
+ unicode-display_width (3.3.0)
93
+ unicode-emoji (~> 4.3)
94
+ unicode-emoji (4.3.0)
95
+
96
+ PLATFORMS
97
+ ruby
98
+
99
+ DEPENDENCIES
100
+ gems (= 1.3.0)
101
+ irb
102
+ libyear-rb!
103
+ minitest
104
+ minitest-rg
105
+ rake
106
+ rubocop-minitest
107
+ rubocop-rake
108
+ standard
109
+
110
+ BUNDLED WITH
111
+ 4.0.24
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ gemspec path: ".."
4
+
5
+ eval_gemfile "common.rb"
6
+
7
+ gem "gems", "~> 2.0.0"
@@ -0,0 +1,111 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ libyear-rb (0.4.0)
5
+ gems (>= 1.3)
6
+ logger
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.3)
12
+ drb (2.2.3)
13
+ erb (6.0.7)
14
+ gems (2.0.0)
15
+ io-console (0.9.5)
16
+ irb (1.18.0)
17
+ pp (>= 0.6.0)
18
+ prism (>= 1.3.0)
19
+ rdoc (>= 4.0.0)
20
+ reline (>= 0.4.2)
21
+ json (3.1.0)
22
+ language_server-protocol (3.17.0.6)
23
+ lint_roller (1.1.0)
24
+ logger (1.7.0)
25
+ minitest (6.0.6)
26
+ drb (~> 2.0)
27
+ prism (~> 1.5)
28
+ minitest-rg (5.4.0)
29
+ minitest (>= 5.0, < 7)
30
+ parallel (1.28.0)
31
+ parser (3.3.13.0)
32
+ ast (~> 2.4.1)
33
+ racc
34
+ pp (0.6.4)
35
+ prettyprint
36
+ prettyprint (0.2.1)
37
+ prism (1.9.0)
38
+ racc (1.8.1)
39
+ rainbow (3.1.1)
40
+ rake (13.4.2)
41
+ rbs (4.1.3)
42
+ logger
43
+ prism (>= 1.6.0)
44
+ tsort
45
+ rdoc (8.1.0)
46
+ erb
47
+ prism (>= 1.6.0)
48
+ rbs (>= 4.0.0)
49
+ tsort
50
+ regexp_parser (2.13.1)
51
+ reline (0.7.0)
52
+ io-console (~> 0.5)
53
+ rubocop (1.91.0)
54
+ json (>= 2.3)
55
+ language_server-protocol (~> 3.17.0.2)
56
+ lint_roller (~> 1.1.0)
57
+ parallel (>= 1.10)
58
+ parser (>= 3.3.0.2)
59
+ rainbow (>= 2.2.2, < 4.0)
60
+ regexp_parser (>= 2.9.3, < 3.0)
61
+ rubocop-ast (>= 1.49.0, < 2.0)
62
+ ruby-progressbar (~> 1.7)
63
+ unicode-display_width (>= 2.4.0, < 4.0)
64
+ rubocop-ast (1.50.0)
65
+ parser (>= 3.3.7.2)
66
+ prism (~> 1.7)
67
+ rubocop-minitest (0.41.0)
68
+ lint_roller (~> 1.1)
69
+ rubocop (>= 1.89.0, < 2.0)
70
+ rubocop-ast (>= 1.38.0, < 2.0)
71
+ rubocop-performance (1.26.1)
72
+ lint_roller (~> 1.1)
73
+ rubocop (>= 1.75.0, < 2.0)
74
+ rubocop-ast (>= 1.47.1, < 2.0)
75
+ rubocop-rake (0.7.1)
76
+ lint_roller (~> 1.1)
77
+ rubocop (>= 1.72.1)
78
+ ruby-progressbar (1.13.0)
79
+ standard (1.57.0)
80
+ language_server-protocol (~> 3.17.0.2)
81
+ lint_roller (~> 1.0)
82
+ rubocop (~> 1.91.0)
83
+ standard-custom (~> 1.0.0)
84
+ standard-performance (~> 1.8)
85
+ standard-custom (1.0.2)
86
+ lint_roller (~> 1.0)
87
+ rubocop (~> 1.50)
88
+ standard-performance (1.9.0)
89
+ lint_roller (~> 1.1)
90
+ rubocop-performance (~> 1.26.0)
91
+ tsort (0.2.0)
92
+ unicode-display_width (3.3.0)
93
+ unicode-emoji (~> 4.3)
94
+ unicode-emoji (4.3.0)
95
+
96
+ PLATFORMS
97
+ ruby
98
+
99
+ DEPENDENCIES
100
+ gems (~> 2.0.0)
101
+ irb
102
+ libyear-rb!
103
+ minitest
104
+ minitest-rg
105
+ rake
106
+ rubocop-minitest
107
+ rubocop-rake
108
+ standard
109
+
110
+ BUNDLED WITH
111
+ 4.0.24
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ gemspec path: ".."
4
+
5
+ eval_gemfile "common.rb"
6
+
7
+ gem "gems", "~> 3.0.0"
@@ -0,0 +1,111 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ libyear-rb (0.4.0)
5
+ gems (>= 1.3)
6
+ logger
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.3)
12
+ drb (2.2.3)
13
+ erb (6.0.7)
14
+ gems (3.0.0)
15
+ io-console (0.9.5)
16
+ irb (1.18.0)
17
+ pp (>= 0.6.0)
18
+ prism (>= 1.3.0)
19
+ rdoc (>= 4.0.0)
20
+ reline (>= 0.4.2)
21
+ json (3.1.0)
22
+ language_server-protocol (3.17.0.6)
23
+ lint_roller (1.1.0)
24
+ logger (1.7.0)
25
+ minitest (6.0.6)
26
+ drb (~> 2.0)
27
+ prism (~> 1.5)
28
+ minitest-rg (5.4.0)
29
+ minitest (>= 5.0, < 7)
30
+ parallel (2.3.0)
31
+ parser (3.3.13.0)
32
+ ast (~> 2.4.1)
33
+ racc
34
+ pp (0.6.4)
35
+ prettyprint
36
+ prettyprint (0.2.1)
37
+ prism (1.9.0)
38
+ racc (1.8.1)
39
+ rainbow (3.1.1)
40
+ rake (13.4.2)
41
+ rbs (4.2.0)
42
+ logger
43
+ prism (>= 1.6.0)
44
+ tsort
45
+ rdoc (8.1.0)
46
+ erb
47
+ prism (>= 1.6.0)
48
+ rbs (>= 4.0.0)
49
+ tsort
50
+ regexp_parser (2.13.1)
51
+ reline (0.7.0)
52
+ io-console (~> 0.5)
53
+ rubocop (1.91.0)
54
+ json (>= 2.3)
55
+ language_server-protocol (~> 3.17.0.2)
56
+ lint_roller (~> 1.1.0)
57
+ parallel (>= 1.10)
58
+ parser (>= 3.3.0.2)
59
+ rainbow (>= 2.2.2, < 4.0)
60
+ regexp_parser (>= 2.9.3, < 3.0)
61
+ rubocop-ast (>= 1.49.0, < 2.0)
62
+ ruby-progressbar (~> 1.7)
63
+ unicode-display_width (>= 2.4.0, < 4.0)
64
+ rubocop-ast (1.50.0)
65
+ parser (>= 3.3.7.2)
66
+ prism (~> 1.7)
67
+ rubocop-minitest (0.41.0)
68
+ lint_roller (~> 1.1)
69
+ rubocop (>= 1.89.0, < 2.0)
70
+ rubocop-ast (>= 1.38.0, < 2.0)
71
+ rubocop-performance (1.26.1)
72
+ lint_roller (~> 1.1)
73
+ rubocop (>= 1.75.0, < 2.0)
74
+ rubocop-ast (>= 1.47.1, < 2.0)
75
+ rubocop-rake (0.7.1)
76
+ lint_roller (~> 1.1)
77
+ rubocop (>= 1.72.1)
78
+ ruby-progressbar (1.13.0)
79
+ standard (1.57.0)
80
+ language_server-protocol (~> 3.17.0.2)
81
+ lint_roller (~> 1.0)
82
+ rubocop (~> 1.91.0)
83
+ standard-custom (~> 1.0.0)
84
+ standard-performance (~> 1.8)
85
+ standard-custom (1.0.2)
86
+ lint_roller (~> 1.0)
87
+ rubocop (~> 1.50)
88
+ standard-performance (1.9.0)
89
+ lint_roller (~> 1.1)
90
+ rubocop-performance (~> 1.26.0)
91
+ tsort (0.2.0)
92
+ unicode-display_width (3.3.0)
93
+ unicode-emoji (~> 4.3)
94
+ unicode-emoji (4.3.0)
95
+
96
+ PLATFORMS
97
+ ruby
98
+
99
+ DEPENDENCIES
100
+ gems (~> 3.0.0)
101
+ irb
102
+ libyear-rb!
103
+ minitest
104
+ minitest-rg
105
+ rake
106
+ rubocop-minitest
107
+ rubocop-rake
108
+ standard
109
+
110
+ BUNDLED WITH
111
+ 4.0.24
@@ -76,7 +76,7 @@ module LibyearRb
76
76
 
77
77
  opts.separator ""
78
78
  opts.separator "Environment variables:"
79
- opts.separator " SKIP_CACHE=1 Disable reading to and writing from the libyear-rb cache"
79
+ opts.separator " SKIP_CACHE=1 Disable writing to and reading from the libyear-rb cache"
80
80
  end.parse!(@argv)
81
81
  end
82
82
 
@@ -10,19 +10,25 @@ module LibyearRb
10
10
  return
11
11
  end
12
12
 
13
- latest_version_info = if current_version_info.prerelease?
14
- versions_metadata.first
13
+ # When the installed version is a prerelease, compare against every
14
+ # release (including prereleases). Otherwise, ignore prereleases so a
15
+ # beta published above the latest stable release does not inflate the
16
+ # version count or freshness gap.
17
+ comparable_versions = if current_version_info.prerelease?
18
+ versions_metadata
15
19
  else
16
- versions_metadata.find { |version| !version.prerelease? }
20
+ versions_metadata.reject(&:prerelease?)
17
21
  end
18
22
 
23
+ latest_version_info = comparable_versions.first
24
+
19
25
  latest_version = latest_version_info.number
20
26
  current_version = current_version_info.number
21
27
 
22
28
  latest_release_date = latest_version_info.created_at
23
29
  current_release_date = current_version_info.created_at
24
30
 
25
- version_distance = versions_metadata.index { |version| version.number == current_version }
31
+ version_distance = comparable_versions.index { |version| version.number == current_version }
26
32
  libyear_in_days = [(latest_release_date - current_release_date).to_i, 0].max
27
33
 
28
34
  Result.new(
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "json"
4
- require "pathname"
5
4
 
6
5
  module LibyearRb
7
6
  class FileCache
@@ -32,7 +32,7 @@ module LibyearRb
32
32
  def fetch_raw(gem_name)
33
33
  LibyearRb.cache.fetch(@remote_host, gem_name) do
34
34
  @rate_limiter.call
35
- Array(@client.versions(gem_name))
35
+ Array(@client.versions(gem_name)).map(&:to_h)
36
36
  rescue Gems::GemError, Gems::NotFound
37
37
  []
38
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LibyearRb
4
- VERSION = "0.2.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libyear-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Countz
@@ -59,6 +59,13 @@ files:
59
59
  - README.md
60
60
  - Rakefile
61
61
  - exe/libyear-rb
62
+ - gemfiles/common.rb
63
+ - gemfiles/gems1.gemfile
64
+ - gemfiles/gems1.gemfile.lock
65
+ - gemfiles/gems2.gemfile
66
+ - gemfiles/gems2.gemfile.lock
67
+ - gemfiles/gems3.gemfile
68
+ - gemfiles/gems3.gemfile.lock
62
69
  - lib/libyear_rb.rb
63
70
  - lib/libyear_rb/cli.rb
64
71
  - lib/libyear_rb/dependency_analyzer.rb
@@ -95,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
102
  - !ruby/object:Gem::Version
96
103
  version: '0'
97
104
  requirements: []
98
- rubygems_version: 4.0.16
105
+ rubygems_version: 4.0.20
99
106
  specification_version: 4
100
107
  summary: A simple measure of dependency freshness
101
108
  test_files: []