Module: ItunesConnect::Commands

Defined in:
lib/itunes_connect/commands.rb,
lib/itunes_connect/commands/help.rb,
lib/itunes_connect/commands/import.rb,
lib/itunes_connect/commands/report.rb,
lib/itunes_connect/commands/download.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Download, Help, Import, Report

Class Method Summary collapse

Class Method Details

.allObject



15
16
17
# File 'lib/itunes_connect/commands.rb', line 15

def all
  [Download, Import, Report, Help]
end

.default_clipObject



34
35
36
37
38
39
# File 'lib/itunes_connect/commands.rb', line 34

def default_clip
  cli = Clip::Parser.new
  cli.flag('v', 'verbose', :desc => 'Make output more verbose')
  cli.flag('g', 'debug', :desc => 'Enable debug output/features (dev only)')
  cli
end

.for_name(name, clip) ⇒ Object



9
10
11
12
13
# File 'lib/itunes_connect/commands.rb', line 9

def for_name(name, clip)
  self.const_get(name.capitalize.to_sym).new(clip)
rescue NameError => e
  nil
end

.usage(msg) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/itunes_connect/commands.rb', line 19

def usage(msg)
  $stderr.puts msg if msg
  $stderr.puts "USAGE: itunes_connect [command] [options]"
  ItunesConnect::Commands.all.each do |cmd_cls|
    cli = Clip do |c|
      c.banner = "'#{cmd_cls.to_s.split('::').last.downcase}' command options:"

      cmd_cls.new(c)
    end
    puts(cli.help)
    puts
  end
  exit 1
end