Class: Shenzhen::Plugins::ITunesConnect::Client
- Inherits:
-
Object
- Object
- Shenzhen::Plugins::ITunesConnect::Client
- Defined in:
- lib/shenzhen/plugins/itunesconnect.rb
Instance Attribute Summary collapse
-
#ipa ⇒ Object
readonly
Returns the value of attribute ipa.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#sdk ⇒ Object
readonly
Returns the value of attribute sdk.
Instance Method Summary collapse
-
#initialize(ipa, apple_id, sdk, account, password, params = []) ⇒ Client
constructor
A new instance of Client.
- #upload_build! ⇒ Object
Constructor Details
#initialize(ipa, apple_id, sdk, account, password, params = []) ⇒ Client
Returns a new instance of Client.
13 14 15 16 17 18 19 20 21 |
# File 'lib/shenzhen/plugins/itunesconnect.rb', line 13 def initialize(ipa, apple_id, sdk, account, password, params = []) @ipa = ipa @apple_id = apple_id @sdk = sdk @account = account @password = password @params = params @filename = File.basename(@ipa).tr(" ", "_") end |
Instance Attribute Details
#ipa ⇒ Object (readonly)
Returns the value of attribute ipa.
11 12 13 |
# File 'lib/shenzhen/plugins/itunesconnect.rb', line 11 def ipa @ipa end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
11 12 13 |
# File 'lib/shenzhen/plugins/itunesconnect.rb', line 11 def params @params end |
#sdk ⇒ Object (readonly)
Returns the value of attribute sdk.
11 12 13 |
# File 'lib/shenzhen/plugins/itunesconnect.rb', line 11 def sdk @sdk end |
Instance Method Details
#upload_build! ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/shenzhen/plugins/itunesconnect.rb', line 23 def upload_build! size = File.size(@ipa) checksum = Digest::MD5.file(@ipa) begin FileUtils.mkdir_p("Package.itmsp") FileUtils.copy_entry(@ipa, "Package.itmsp/#{@filename}") File.write("Package.itmsp/metadata.xml", (@apple_id, checksum, size)) raise if /(error)|(fail)/i === transport rescue say_error "An error occurred when trying to upload the build to iTunesConnect.\nRun with --verbose for more info." and abort ensure FileUtils.rm_rf("Package.itmsp", :secure => true) end end |