Class: Nauvisian::CLI::Commands::Mod::Latest

Inherits:
Dry::CLI::Command
  • Object
show all
Includes:
MessageHelper
Defined in:
lib/nauvisian/cli/commands/mod/latest.rb

Instance Method Summary collapse

Instance Method Details

#call(mod:) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/nauvisian/cli/commands/mod/latest.rb', line 15

def call(mod:, **)
  api = Nauvisian::API.new
  mod = Nauvisian::Mod[name: mod]
  releases = api.releases(mod)
  latest = releases.max_by(&:released_at)

  puts latest.version
rescue => e
  message(e)
  exit 1
end