Class: Nauvisian::CLI::Commands::Mod::Info

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

Instance Method Summary collapse

Instance Method Details

#call(mod:) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/nauvisian/cli/commands/mod/info.rb', line 15

def call(mod:, **)
  api = Nauvisian::API.new
  mod = Nauvisian::Mod[name: mod]
  detail = api.detail(mod)

  puts <<~DETAIL
    Name: #{detail.name}
    Category: #{detail.category}
    Downloads: #{detail.downloads_count}
    URL: #{detail.url}
    Title: #{detail.title}
    Summary: #{detail.summary}
    Owner: #{detail.owner}
    Created at: #{detail.created_at}
    Description: #{detail.description}
  DETAIL
rescue => e
  message(e)
  exit 1
end