Module: StillActive::RubyHelper
Constant Summary collapse
- ENDOFLIFE_URI =
URI("https://endoflife.date/")
Instance Method Summary collapse
- #ruby_freshness ⇒ Object
-
#supported_ruby_range ⇒ Object
The runtime facts a per-gem language ceiling is measured against, sourced from the shared endoflife.date support-window builder.
Instance Method Details
#ruby_freshness ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/helpers/ruby_helper.rb', line 15 def ruby_freshness current = current_ruby_version return if current.nil? cycles = fetch_cycles return if cycles.nil? current_cycle = find_cycle(cycles, current) latest_cycle = cycles.first return if latest_cycle.nil? latest_version = latest_cycle["latest"] latest_release_date = EndoflifeHelper.parse_date(latest_cycle["releaseDate"]) current_release_date = EndoflifeHelper.parse_date(current_cycle&.dig("releaseDate")) eol_value = current_cycle&.dig("eol") { version: current, release_date: current_release_date, eol_date: EndoflifeHelper.parse_eol(eol_value), eol: EndoflifeHelper.eol_reached?(eol_value), latest_version: latest_version, latest_release_date: latest_release_date, libyear: LibyearHelper.gem_libyear( version_used_release_date: current_release_date, latest_version_release_date: latest_release_date, ), } end |
#supported_ruby_range ⇒ Object
The runtime facts a per-gem language ceiling is measured against, sourced from the shared endoflife.date support-window builder. Ruby only picks the feed; the ecosystem-neutral logic (support floor, latest stable, grace window, cycle normalization) lives in EndoflifeHelper.
50 51 52 |
# File 'lib/helpers/ruby_helper.rb', line 50 def supported_ruby_range EndoflifeHelper.support_window(feed_path: "/api/ruby.json") end |