Class: ITunes::Store::Transporter::ITMSTransporter

Inherits:
Object
  • Object
show all
Defined in:
lib/itunes/store/transporter/itms_transporter.rb

Overview

Upload and manage your assets in the iTunes Store using the iTunes Store's Transporter (+iTMSTransporter+).

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ ITMSTransporter

Arguments

[options (Hash)] Transporter options

Options

Options given here will be used as defaults for all subsequent method calls. Thus you can set method specific options here but, if you call a method that does not accept one of these options, an OptionError will be raised.

See specific methods for a list of options.

[:username (String)] Your username [:password (String)] Your password [:shortname (String)] Your shortname (encoding house user). Optional, not every iTunes account has one [:itc_provider (String)] Your iTunes Connect user. Optional, not every iTunes account has one [:path (String)] The path to the iTMSTransporter. Optional. [:print_stdout (Boolean)] Print +iTMSTransporter+'s stdout to your stdout. Defaults to false. [:print_stderr (Boolean)] Print +iTMSTransporter+'s stderr to your stderr. Defaults to false.



28
29
30
31
32
33
34
35
# File 'lib/itunes/store/transporter/itms_transporter.rb', line 28

def initialize(options = nil)
  @defaults = create_options(options)
  @config = {
    :path         => @defaults.delete(:path),
    :print_stdout => @defaults.delete(:print_stdout),
    :print_stderr => @defaults.delete(:print_stderr),
  }
end

Instance Method Details

#commandObject

:method: version :call-seq:

version

Return the underlying iTMSTransporter version.

Returns

[String] The version number



196
197
198
199
200
201
202
# File 'lib/itunes/store/transporter/itms_transporter.rb', line 196

%w|upload verify|.each do |command|
  define_method(command) do |package, *options|
    cmd_options = create_options(options.first)
    cmd_options[:package] = package
    run_command(command, cmd_options)
  end
end

#status(options) ⇒ Object



208
209
210
211
212
# File 'lib/itunes/store/transporter/itms_transporter.rb', line 208

def status(options)
  options = create_options(options)
  command = options.delete(:all) ? Command::StatusAll : Command::Status
  command.new(@config, @defaults).run(options)
end