Class: Pod::Command::Trunk::Info

Inherits:
Pod::Command::Trunk show all
Defined in:
lib/pod/command/trunk/info.rb

Constant Summary

Constants inherited from Pod::Command::Trunk

BASE_URL, SCHEME_AND_HOST

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Info

Returns a new instance of Info.



12
13
14
15
# File 'lib/pod/command/trunk/info.rb', line 12

def initialize(argv)
  @name = argv.shift_argument
  super
end

Instance Method Details

#runObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/pod/command/trunk/info.rb', line 22

def run
  response = json(request_path(:get, "pods/#{@name}", auth_headers))
  versions = response['versions'] || []
  owners = response['owners'] || []

  UI.title(@name) do
    UI.labeled 'Versions', versions.map { |v| "#{v['name']} (#{v['created_at']})" }
    UI.labeled 'Owners', owners.map { |o| "#{o['name']} <#{o['email']}>" }
  end
end

#validate!Object



17
18
19
20
# File 'lib/pod/command/trunk/info.rb', line 17

def validate!
  super
  help! 'Please specify a pod name.' unless @name
end