Skip to content

v0.3.0

Latest
Compare
Choose a tag to compare
@MatheusRich MatheusRich released this 10 Feb 19:46
· 15 commits to main since this release

Added

  • Allow excluding repositories from search. Due to a limitation on GitHub's API,
    it's only possible to exclude up to five words.
$ end_of_life --exclude=repo1,repo2
  • Allow specifying the repo visibility on search:
$ end_of_life --public-only
# or
$ end_of_life --private-only
  • Allow searching repositories inside organizations
$ end_of_life --org org1

# It's also possible to search on multiple organizations
$ end_of_life --org org1,org2
  • Fetch EOL Ruby versions from endoflife.date API. This ensures we always use up-to-date data but keep the embedded JSON as a fallback.

  • Allow users to specify the maximum number of days away a version can be from EOL. It defaults to 0.

$ end_of_life --max-eol-days-away 90
  • Add search methods to RubyVersion

It's possible to query all EOL versions, or the latest one at any given time.

EndOfLife::RubyVersion.eol_versions_at(Date.today)
# =>
# [#<EndOfLife::RubyVersion:0x00007f9b1300d858
#   @eol_date=#<Date: 2021-03-31 ((2459305j,0s,0n),+0s,2299161j)>,
#   @version=Gem::Version.new("2.5.9")>,
#  #<EndOfLife::RubyVersion:0x00007f9b1300cea8
#   @eol_date=#<Date: 2020-03-31 ((2458940j,0s,0n),+0s,2299161j)>,
#   @version=Gem::Version.new("2.4.10")>,
#  #<EndOfLife::RubyVersion:0x00007f9b1300cb10
#   @eol_date=#<Date: 2019-03-31 ((2458574j,0s,0n),+0s,2299161j)>,
#   @version=Gem::Version.new("2.3.8")>,
#  #<EndOfLife::RubyVersion:0x00007f9b1300c5e8
#   @eol_date=#<Date: 2018-03-31 ((2458209j,0s,0n),+0s,2299161j)>,
#   @version=Gem::Version.new("2.2.10")>,
#  #<EndOfLife::RubyVersion:0x00007f9b1300c020
#   @eol_date=#<Date: 2017-03-31 ((2457844j,0s,0n),+0s,2299161j)>,
#   @version=Gem::Version.new("2.1.10")>,
#  #<EndOfLife::RubyVersion:0x00007f9b112efbb8
#   @eol_date=#<Date: 2016-02-24 ((2457443j,0s,0n),+0s,2299161j)>,
#   @version=Gem::Version.new("2.0.0.pre.p648")>,
#  #<EndOfLife::RubyVersion:0x00007f9b112ef028
#   @eol_date=#<Date: 2015-02-23 ((2457077j,0s,0n),+0s,2299161j)>,
#   @version=Gem::Version.new("1.9.3.pre.p551")>]

EndOfLife::RubyVersion.latest_eol # returns today's latest EOL version
# =>
# #<EndOfLife::RubyVersion:0x00007f9b1300d858
#  @eol_date=#<Date: 2021-03-31 ((2459305j,0s,0n),+0s,2299161j)>,
#  @version=Gem::Version.new("2.5.9")>

# returns the latest EOL version at a given date
EndOfLife::RubyVersion.latest_eol(at: Date.parse("2024-03-31"))
# =>
# #<EndOfLife::RubyVersion:0x00007f9b1300e7d0
#  @eol_date=#<Date: 2024-03-31 ((2460401j,0s,0n),+0s,2299161j)>,
#  @version=Gem::Version.new("3.0.3")>

EndOfLife::RubyVersion.new("3.0.0").eol?
# => false

EndOfLife::RubyVersion.new("3.0.0").eol?(at: Date.parse("2024-03-31"))
# => true
  • Using the methods above, we can check whether a Repository is using EOL Ruby versions.
# repo with Ruby 3.0 (which is not EOL today)
repo.eol_ruby?
# => false

repo.eol_ruby?(at: Date.parse("2024.04.04"))
# => true

Changed

  • EndOfLife::RubyVersion::EOL constant was removed in favor of EndOfLife::RubyVersion.latest_eol method.

New Contributors

Full Changelog: v0.2.0...v0.3.0