Skip to content

Releases: MatheusRich/end_of_life

v0.3.0

10 Feb 19:46
Compare
Choose a tag to compare

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

v0.2.0

26 Jan 01:59
Compare
Choose a tag to compare

Added

  • Allow searching a specific repository.
$ end_of_life --repo=MatheusRich/ez_attributes
  • Allow specifying the user used on the repository search.
$ end_of_life --user=matz # searches on matz's repositories

Fixed

  • Load end_of_life JSON database from dynamic path #10.

    When installed on a fresh Ruby installation without the source code cloned,
    the JSON file couldn't be found because it was looking at the cwd of the
    running process instead of the Gem's lib directory path.

Changed

  • Exit with -1 if EOL repos are present.

  • Upgrade octokit to v4.22, which fixes a Faraday warning, so we can remove the dependency on the warning gem.

v0.1.0

17 Jan 15:32
Compare
Choose a tag to compare

end_of_life 0.1.0

This is the very first release!

The only command supported is end_of_life (or eol, if the platform supports symlinks), which lists repos (limited to 100)
using EOL Ruby. No other tool/lang or option is supported.

$ GITHUB_TOKEN=something end_of_life # if your platform supports symlinks, you can use the `eol` command instead
[✔] Fetching repositories...
[✔] Searching for EOL Ruby in repositories...

Found 2 repositories using EOL Ruby (<= 2.5.9):
┌───┬──────────────────────────────────────────────┬──────────────┐
│   │ Repository                                   │ Ruby version │
├───┼──────────────────────────────────────────────┼──────────────┤
│ 1 │ https://github.com/MatheusRich/my_rails_app  │ 2.5.8        │
│ 2 │ https://github.com/MatheusRich/some_repo     │ 2.5.0        │
└───┴──────────────────────────────────────────────┴──────────────┘