motion-appstore 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4d05d6c94b6d72e493b7dcf789bf2160814bed6
4
- data.tar.gz: 67dc0aba29da4ebc8a75fa48c9791ed16c5e9684
3
+ metadata.gz: a5e8fa8fae79cdf440bd5f631b3555a07d2fda19
4
+ data.tar.gz: 5d17244b468e299eecd20598bccfccaedf99abe9
5
5
  SHA512:
6
- metadata.gz: 1985ceb887f1a7f6f7f9405ec6ec3ad64ed1cba74d0bf7de84d5fa47997ac4b430dce04a2793e294ff092f7d371d07168706280e142e4f7292c7b04424b80d72
7
- data.tar.gz: 082d0c482d5de733f7d923ae14047139ef40160d1d28b7c74764ca77c93fa516ab4385d0ae4d5aa8af9082d6873f8e2bed934c27eebb6a17da8770475b9875fb
6
+ metadata.gz: 883b4d76f9bf53144a03cd3d5239587735957c5458e1037d035d41dfb1de505c91bb861c6e6837bc27361dec42de2094ccc2b7e51636f4bf11787c4bdfbaaa6c
7
+ data.tar.gz: 657950284264f0a53dfb829cde115717bde4ce70077de7322c2a74aa2980cbbe3f9844a425de65df22d5ab2e14dd324d41da377483fadc14d15a469f3e71efff
data/README.md CHANGED
@@ -30,13 +30,11 @@ This command validates your app whether it is possible to upload to iTunes Conne
30
30
 
31
31
  Example)
32
32
 
33
- If app configuration has some error:
33
+ If app configuration has some errors:
34
34
  ```
35
35
  $ motion validate watson1978@gmail.com
36
36
  Validate: ./build/iPhoneOS-8.1-Release/HelloActions.ipa
37
- 2015-01-04 06:03:53.172 altool[9688:97684] *** Error: (
38
- "Error Domain=ITunesConnectionOperationErrorDomain Code=1091 \"Redundant Binary Upload. There already exists a binary upload with build '1.0' for version '1.7'\" UserInfo=0x7f81205293d0 {NSLocalizedRecoverySuggestion=Redundant Binary Upload. There already exists a binary upload with build '1.0' for version '1.7', NSLocalizedDescription=Redundant Binary Upload. There already exists a binary upload with build '1.0' for version '1.7', NSLocalizedFailureReason=iTunes Store operation failed.}"
39
- )
37
+ Redundant Binary Upload. There already exists a binary upload with build '1.0' for version '1.10'
40
38
  ```
41
39
 
42
40
  The app is good to submit to iTunes Connect:
@@ -44,7 +42,7 @@ The app is good to submit to iTunes Connect:
44
42
  ```
45
43
  $ motion validate watson1978@gmail.com
46
44
  Validate: ./build/iPhoneOS-8.1-Release/HelloActions.ipa
47
- 2015-01-04 06:11:56.252 altool[10072:101867] No errors validating archive at ./build/iPhoneOS-8.1-Release/HelloActions.ipa
45
+ No errors validating archive at ./build/iPhoneOS-8.1-Release/HelloActions.ipa
48
46
  ```
49
47
 
50
48
  ### upload
@@ -56,5 +54,5 @@ Example)
56
54
  ```
57
55
  $ motion upload watson1978@gmail.com
58
56
  Upload: ./build/iPhoneOS-8.1-Release/HelloActions.ipa
59
- 2015-01-04 14:36:28.662 altool[25221:247213] No errors uploading ./build/iPhoneOS-8.1-Release/HelloActions.ipa
57
+ No errors uploading ./build/iPhoneOS-8.1-Release/HelloActions.ipa
60
58
  ```
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  require_relative 'utils'
2
3
 
3
4
  module Motion; class Command
@@ -21,8 +22,8 @@ module Motion; class Command
21
22
  archive = archive_path()
22
23
  puts bold("Upload: ") + archive
23
24
 
24
- system "\"#{ALTOOL}\" --upload-app -f #{archive} -u #{@adc_id} -p #{password}"
25
- exit $?.exitstatus
25
+ exitcode = altool("--upload-app -f #{archive} -u #{@adc_id} -p #{password}")
26
+ exit(exitcode)
26
27
  end
27
28
 
28
29
  end
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  require_relative 'utils'
2
3
 
3
4
  module Motion; class Command
@@ -21,8 +22,8 @@ module Motion; class Command
21
22
  archive = archive_path()
22
23
  puts bold("Validate: ") + archive
23
24
 
24
- system "\"#{ALTOOL}\" -v -f #{archive} -u #{@adc_id} -p #{password}"
25
- exit $?.exitstatus
25
+ exitcode = altool("-v -f #{archive} -u #{@adc_id} -p #{password}")
26
+ exit(exitcode)
26
27
  end
27
28
 
28
29
  end
data/command/utils.rb CHANGED
@@ -1,6 +1,15 @@
1
+ # -*- coding: utf-8 -*-
1
2
  module Utils
2
3
  ALTOOL = "/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool"
3
4
 
5
+ def altool(arg)
6
+ message = `\"#{ALTOOL}\" #{arg} 2>&1`
7
+ messages = parse_nslog_message(message)
8
+ print_messages(messages, $?.exitstatus == 0)
9
+
10
+ $?.exitstatus
11
+ end
12
+
4
13
  def archive_path
5
14
  unless File.exist?('Rakefile')
6
15
  help! "Run on Root Directoy of RubyMotion Project"
@@ -15,10 +24,6 @@ module Utils
15
24
  archive
16
25
  end
17
26
 
18
- def bold(msg)
19
- ansi_output? ? "\e[1;32m" + msg + "\e[0m" : msg
20
- end
21
-
22
27
  def password
23
28
  # retrive password from keychain which might be created by Xcode
24
29
  `security find-internet-password -g -a #{@adc_id} -s idmsa.apple.com -r htps 2>&1`.each_line { |line|
@@ -42,4 +47,38 @@ module Utils
42
47
  end
43
48
  end
44
49
 
50
+ def parse_nslog_message(message)
51
+ messages = []
52
+ message.split("\n").each do |msg|
53
+ msg.strip!
54
+ if m = msg.match(/(No errors.+)/)
55
+ # success
56
+ messages << m[1]
57
+ elsif m = msg.match(/^"Error Domain=[^"]+"(.+)\\" UserInfo=.+/)
58
+ # error
59
+ messages << m[1]
60
+ end
61
+ end
62
+ messages
63
+ end
64
+
65
+ def print_messages(messages, is_success)
66
+ mark = is_success ? green("✓ ") : red("✗ ")
67
+ messages.each do |msg|
68
+ puts mark + msg
69
+ end
70
+ end
71
+
72
+ def bold(msg)
73
+ ansi_output? ? "\e[1;34m" + msg + "\e[0m" : msg
74
+ end
75
+
76
+ def red(msg)
77
+ ansi_output? ? "\e[1;31m" + msg + "\e[0m" : msg
78
+ end
79
+
80
+ def green(msg)
81
+ ansi_output? ? "\e[1;32m" + msg + "\e[0m" : msg
82
+ end
83
+
45
84
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-appstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watson