Class: Rake::Gem::Maintenance::RubyVersionChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/rake/gem/maintenance/ruby_version_checker.rb

Overview

Fetches the latest stable Ruby version and maintained minors from endoflife.date.

Constant Summary collapse

API_URL =
"https://endoflife.date/api/ruby.json"

Instance Method Summary collapse

Instance Method Details

#latest_stableObject



13
14
15
# File 'lib/rake/gem/maintenance/ruby_version_checker.rb', line 13

def latest_stable
  cycles.max_by { |c| ::Gem::Version.new(c[:latest]) }&.fetch(:latest)
end

#maintained_minorsObject



17
18
19
# File 'lib/rake/gem/maintenance/ruby_version_checker.rb', line 17

def maintained_minors
  cycles.map { |c| c[:cycle] }.sort_by { |v| ::Gem::Version.new(v) }
end