Method: Supermarket::SupermarketCLI#info

Defined in:
lib/bundles/inspec-supermarket/cli.rb

#info(profile) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/bundles/inspec-supermarket/cli.rb', line 50

def info(profile)
  # check that the profile is available
  supermarket_profiles = Supermarket::API.profiles
  found = supermarket_profiles.select { |p|
    profile == "#{p['tool_owner']}/#{p['slug']}"
  }

  if found.empty?
    puts "#{mark_text(profile)} is not available on Supermarket"
    return
  end

  # load details for the specific profile
  info = Supermarket::API.info(profile)
  puts "#{mark_text('name: ')}  #{info['slug']}"
  puts "#{mark_text('owner:')}  #{info['owner']}"
  puts "#{mark_text('url:  ')}  #{info['source_url']}"
  puts
  puts "#{mark_text('description:  ')} #{info['description']}"
end