itunes_store_transporter 0.1.1 → 0.1.2beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4108c78a24a87a971a948d57ce6c38562f83ed17
4
+ data.tar.gz: 15792381aef3440f4f08bba1856e9ce3cb13b70a
5
+ SHA512:
6
+ metadata.gz: 20f44051c7fc697f58a42fbe26caddcb4db41ecd0e3799b9474d5f433ce3fa87e747ff14bdef78406dff395036949a415cb98fef1b6a12090dd91af47840e203
7
+ data.tar.gz: 9b0d9bab5f02325c3e7669e7a2dcdb75ef76eceb9ac0a64c5d2c42989e96ad49ed0bc02f23249011e574fd9aa1c79dead73452512ff269d7b35aa6cfe3a0b506
data/README.rdoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = iTunes::Store::Transporter
2
2
 
3
3
  {<img src="https://secure.travis-ci.org/sshaw/itunes_store_transporter.png"/>}[http://travis-ci.org/sshaw/itunes_store_transporter]
4
- {<img src="https://codeclimate.com/badge.png"/>}[https://codeclimate.com/github/sshaw/itunes_store_transporter]
4
+ {<img src="https://codeclimate.com/github/sshaw/itunes_store_transporter.png" />}[https://codeclimate.com/github/sshaw/itunes_store_transporter]
5
5
 
6
6
  Upload and manage your assets in the iTunes Store using the iTunes Store's Transporter (+iTMSTransporter+).
7
7
 
@@ -29,7 +29,7 @@ Upload and manage your assets in the iTunes Store using the iTunes Store's Trans
29
29
 
30
30
  === Description
31
31
 
32
- iTunes::Store::Transporter is a wrapper around Apple's +iTMSTransporter+ program. It currently
32
+ <code>iTunes::Store::Transporter</code> is a wrapper around Apple's +iTMSTransporter+ program. It currently
33
33
  supports the following operations:
34
34
 
35
35
  * Upload packages
@@ -44,9 +44,15 @@ that it can send email notifications and allows one to set global/per-command de
44
44
 
45
45
  === Requirements
46
46
 
47
- * Optout v0.0.2 (<code>gem install optout</code>)
47
+ * Optout (<code>gem install optout</code>)
48
48
  * iTunes Store Transporter (http://www.apple.com/itunes/sellcontent)
49
49
 
50
+ === Locating iTMSTransporter
51
+
52
+ If the +iTMSTransporter+ cannot be found in {one your platform's known locations}[https://github.com/sshaw/itunes_store_transporter/tree/master/lib/itunes/store/transporter/shell.rb#L28-L40] you must specify it when creating an instance of <code>iTunes::Store::Transporter</code> via {the <code>:path</code> option}[http://ruby-doc.org/gems/docs/i/itunes_store_transporter-0.1.1/ITunes/Store/Transporter/ITMSTransporter.html#method-c-new-label-Options].
53
+
54
+ If you're using the bundled +itms+ command you must use its +--path+ option or specify the path in the itms config file. See the +itms+ section for more info.
55
+
50
56
  === Running on Windows
51
57
 
52
58
  On Windows +iTMSTransporter+ is called via the +iTMSTransporter.CMD+ batch file. This file does not handle the
@@ -73,6 +79,11 @@ This can be fixed by modifying +iTMSTransporter.CMD+ (note that the following do
73
79
  * +COMMAND+ - The command (<code>iTunes::Store::Transporter</code> method) to run
74
80
  * +OPTIONS+ - These are quivalent to the given +COMMAND+'s options except they must be given in long option format. For example <code>:apple_id => "X123"</code> would be <code>--apple-id=X123</code>. Boolean options can be negated with the <code>--no-</code> prefix.
75
81
 
82
+ ==== Username, Password, Short Name
83
+
84
+ Most all commands require your username and password, some require a shortname. These can be specified on the command line
85
+ via the +--username+, +--password+, and +--shortname+ options, or via an +itms+ config file. See the config file section below.
86
+
76
87
  ==== Lookup command
77
88
 
78
89
  The lookup command differs slightly from the gem by allowing you to download low-quality copies of the assets associated with the looked up metadata.
@@ -144,7 +155,7 @@ As you can see, command options are turned into template variables.
144
155
 
145
156
  === More Info
146
157
 
147
- * Docs: http://ruby-doc.org/gems/docs/i/itunes_store_transporter-0.1.0/README_rdoc.html
158
+ * Docs: http://ruby-doc.org/gems/docs/i/itunes_store_transporter-0.1.1/README_rdoc.html
148
159
  * Bugs: http://github.com/sshaw/itunes_store_transporter/issues
149
160
  * Source Code: http://github.com/sshaw/itunes_store_transporter
150
161
  * Web Based GUI: http://github.com/sshaw/itunes_store_transporter_web
@@ -13,8 +13,8 @@ module ITunes
13
13
  attr :errors
14
14
  attr :warnings
15
15
 
16
- ERROR_LINE = />\s+ERROR:\s+(.+)/
17
- WARNING_LINE = />\s+WARN:\s+(.+)/
16
+ ERROR_LINE = /<main>\s+ERROR:\s+(.+)/
17
+ WARNING_LINE = /<main>\s+WARN:\s+(.+)/
18
18
 
19
19
  # Generic messages we want to ignore.
20
20
  SKIP_ERRORS = [ /\boperation was not successful/i,
@@ -11,6 +11,8 @@ module ITunes
11
11
  EXE_NAME = "iTMSTransporter"
12
12
  WINDOWS_EXE = "#{EXE_NAME}.CMD"
13
13
  DEFAULT_UNIX_PATH = "/usr/local/itms/bin/#{EXE_NAME}"
14
+ DEFAULT_OSX_PATHS = ["/Developer/Applications/Utilities/Application Loader.app/Contents/MacOS/itms/bin/#{EXE_NAME}",
15
+ "/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/MacOS/itms/bin/#{EXE_NAME}"]
14
16
 
15
17
  class << self
16
18
  def windows?
@@ -18,44 +20,51 @@ module ITunes
18
20
  # can crow when it receives a Windows path.
19
21
  ChildProcess.windows? || ChildProcess.os == :cygwin
20
22
  end
21
-
23
+
24
+ def osx?
25
+ ChildProcess.os == :macosx
26
+ end
27
+
22
28
  def default_path
23
- if windows?
24
- # The Transporter installer prefers x86
25
- # But... I think ruby normalizes this to just PROGRAMFILES
26
- root = ENV["PROGRAMFILES(x86)"] || ENV["PROGRAMFILES"] # Need C:\ in case?
27
- File.join(root, "itms", WINDOWS_EXE)
28
- else
29
- DEFAULT_UNIX_PATH
29
+ case
30
+ when windows?
31
+ # The Transporter installer prefers x86
32
+ # But... I think ruby normalizes this to just PROGRAMFILES
33
+ root = ENV["PROGRAMFILES(x86)"] || ENV["PROGRAMFILES"] # Need C:\ in case?
34
+ File.join(root, "itms", WINDOWS_EXE)
35
+ when osx?
36
+ DEFAULT_OSX_PATHS.find { |path| File.exist?(path) } || DEFAULT_UNIX_PATH
37
+ else
38
+ DEFAULT_UNIX_PATH
30
39
  end
31
40
  end
32
41
  end
33
-
42
+
34
43
  def initialize(path = nil)
35
44
  @path = path || self.class.default_path
36
45
  end
37
-
46
+
38
47
  def exec(argv, &block)
39
48
  raise ArgumentError, "block required" unless block_given?
40
49
 
41
- begin
50
+ begin
42
51
  process = ChildProcess.build(path, *argv)
43
-
52
+
44
53
  stdout = IO.pipe
45
54
  stderr = IO.pipe
46
-
55
+
47
56
  stdout[1].sync = true
48
57
  process.io.stdout = stdout[1]
49
58
 
50
59
  stderr[1].sync = true
51
60
  process.io.stderr = stderr[1]
52
-
61
+
53
62
  process.start
54
63
 
55
64
  stdout[1].close
56
65
  stderr[1].close
57
66
 
58
- poll(stdout[0], stderr[0], &block)
67
+ poll(stdout[0], stderr[0], &block)
59
68
  rescue ChildProcess::Error, SystemCallError => e
60
69
  raise TransporterError, e.message
61
70
  ensure
@@ -65,27 +74,27 @@ module ITunes
65
74
 
66
75
  process.exit_code
67
76
  end
68
-
77
+
69
78
  private
70
79
  def poll(stdout, stderr)
71
80
  read = [ stdout, stderr ]
72
-
81
+
73
82
  loop do
74
83
  # TODO: Not working on jruby
75
84
  if ready = select(read, nil, nil, 1)
76
85
  ready.each do |set|
77
86
  next unless set.any?
78
-
87
+
79
88
  set.each do |io|
80
89
  if io.eof?
81
90
  read.delete(io)
82
91
  next
83
92
  end
84
-
93
+
85
94
  name = io == stdout ? :stdout : :stderr
86
95
  yield(io.gets, name)
87
96
  end
88
-
97
+
89
98
  end
90
99
  end
91
100
  break unless read.any?
@@ -1,7 +1,7 @@
1
1
  module ITunes
2
2
  module Store
3
3
  module Transporter
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2beta"
5
5
  end
6
6
  end
7
7
  end
@@ -2,7 +2,7 @@ no_error_number: |
2
2
  [2000-01-01 00:00:00] <main> INFO: Transporter is doing something fun
3
3
  [2000-01-01 00:00:00] <main> INFO: Transporter is still doing some fun stuff
4
4
  [2000-01-01 00:00:00] <main> ERROR: "An error occurred while doing fun stuff" at Location1 (Class)
5
- [2000-01-01 00:00:00] <Some Class> ERROR: "An exception has occurred: network timeout" at Location2 (Class)
5
+ [2000-01-01 00:00:00] <main> ERROR: "An exception has occurred: network timeout" at Location2 (Class)
6
6
  [2000-01-01 00:00:00] <main> DBG-X: About to exit
7
7
 
8
8
  Package Summary:
@@ -26,7 +26,7 @@ with_error_number: |
26
26
  ERROR ITMS-4000 "This is error 4000"
27
27
  ERROR ITMS-5000 "This is error 5000"
28
28
 
29
- single_warning: |
29
+ single_warning: |
30
30
  [2000-01-01 00:00:00] <main> INFO: Transporter is doing something fun
31
31
  [2000-01-01 00:00:00] <main> WARN: WARNING ITMS-4010: "You've been warned!" at Location1 (Class)
32
32
  [2000-01-01 00:00:00] <main> INFO: I'm outta here
@@ -43,3 +43,16 @@ duplicate_errors: |
43
43
  [2000-01-01 00:00:00] <main> INFO: Transporter is doing something fun
44
44
  [2000-01-01 00:00:00] <main> ERROR: ERROR ITMS-7000: "Error 3" at Location3 (ClassX)
45
45
  [2000-01-01 00:00:00] <main> INFO: I'm outta here
46
+
47
+ error_from_main_and_class: |
48
+ [2000-01-01 00:00:00] <main> INFO: Transporter is doing something fun
49
+ [2000-01-01 00:00:00] <main> INFO: Transporter is still doing some fun stuff
50
+ [2000-01-01 00:00:00] <in.some.Class> ERROR: "An exception has occurred in.some.Class: network timeout"
51
+ [2000-01-01 00:00:00] <main> INFO: Transporter is still doing some fun stuff
52
+ [2000-01-01 00:00:00] <main> ERROR: Another error has occurred
53
+ [2000-01-01 00:00:00] <main> DBG-X: About to exit
54
+
55
+ Package Summary:
56
+
57
+ 1 package was uploaded successfully:
58
+ /home/sshaw/123123123.itmsp
@@ -1,68 +1,78 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe ITunes::Store::Transporter::OutputParser do
4
- describe "parsing errors" do
4
+ describe "parsing errors" do
5
5
  # TODO: test various error message/code formats handled by the parser
6
6
 
7
- context "without an error code" do
7
+ context "without an error code" do
8
8
  before(:all) { @parser = described_class.new(fixture("errors_and_warnings.no_error_number")) }
9
9
 
10
10
  subject { @parser }
11
11
  its(:warnings) { should be_empty }
12
12
  its(:errors) { should have(2).items }
13
13
 
14
- describe "the first error" do
14
+ describe "the first error" do
15
15
  subject { @parser.errors.first }
16
16
  its(:code) { should be_nil }
17
17
  its(:message) { should == "An error occurred while doing fun stuff" }
18
18
  end
19
19
 
20
- describe "the second error" do
20
+ describe "the second error" do
21
21
  subject { @parser.errors.last }
22
22
  its(:code) { should be_nil }
23
23
  its(:message) { should == "An exception has occurred: network timeout" }
24
24
  end
25
25
  end
26
26
 
27
- context "with an error code" do
27
+ context "with errors from main and from a class" do
28
+ before(:all) { @parser = described_class.new(fixture("errors_and_warnings.error_from_main_and_class")) }
29
+ subject { @parser }
30
+
31
+ it "only parses the error from main" do
32
+ expect(@parser.errors.size).to eq 1
33
+ expect(@parser.errors.first.message).to eq "Another error has occurred"
34
+ end
35
+ end
36
+
37
+ context "with an error code" do
28
38
  before(:all) { @parser = described_class.new(fixture("errors_and_warnings.with_error_number")) }
29
-
39
+
30
40
  subject { @parser }
31
41
  its(:warnings) { should be_empty }
32
42
  its(:errors) { should have(2).items }
33
-
34
43
 
35
- describe "the first error" do
44
+
45
+ describe "the first error" do
36
46
  subject { @parser.errors.first }
37
47
  its(:code) { should == 4000 }
38
48
  its(:message) { should == "This is error 4000" }
39
49
  end
40
50
 
41
- describe "the second error" do
51
+ describe "the second error" do
42
52
  subject { @parser.errors.last }
43
53
  its(:code) { should == 5000 }
44
54
  its(:message) { should == "This is error 5000" }
45
55
  end
46
56
  end
47
57
 
48
- context "with duplicate messages" do
58
+ context "with duplicate messages" do
49
59
  before(:all) { @parser = described_class.new(fixture("errors_and_warnings.duplicate_errors")) }
50
-
51
- it "does not include duplicates" do
60
+
61
+ it "does not include duplicates" do
52
62
  errors = @parser.errors.map { |e| e.message }
53
63
  errors.should == ["Error 1", "Error 2", "Error 3"]
54
64
  end
55
65
  end
56
66
  end
57
67
 
58
- describe "parsing warnings" do
68
+ describe "parsing warnings" do
59
69
  before(:all) { @parser = described_class.new(fixture("errors_and_warnings.single_warning")) }
60
70
 
61
71
  subject { @parser }
62
72
  its(:errors) { should be_empty }
63
73
  its(:warnings) { should have(1).item }
64
74
 
65
- describe "the warning" do
75
+ describe "the warning" do
66
76
  subject { @parser.warnings.first }
67
77
  its(:code) { should == 4010 }
68
78
  its(:message) { should == "You've been warned!" }
data/spec/shell_spec.rb CHANGED
@@ -45,14 +45,31 @@ describe ITunes::Store::Transporter::Shell do
45
45
  before(:all) { ENV["PROGRAMFILES"] = "C:\\" }
46
46
 
47
47
  it "selects the Windows executable" do
48
- described_class.stub(:windows? => true)
48
+ described_class.stub(:windows? => true, :osx? => false)
49
49
  described_class.new.path.should match /#{described_class::WINDOWS_EXE}\Z/
50
50
  end
51
51
  end
52
52
 
53
- context "when on anything but Windows" do
53
+ context "when on OS X" do
54
+ before { described_class.stub(:windows? => false, :osx? => true) }
55
+
56
+ it "selects the right executable" do
57
+ exe = described_class::DEFAULT_OSX_PATHS.first
58
+ File.stub(:exist? => true)
59
+ described_class.new.path.should == exe
60
+ end
61
+
62
+ context "and no OS X specific executable is found" do
63
+ it "defaults to the *nix executable" do
64
+ File.stub(:exist? => false)
65
+ described_class.new.path.should match /#{described_class::DEFAULT_UNIX_PATH}\Z/
66
+ end
67
+ end
68
+ end
69
+
70
+ context "when not on Windows or OS X" do
54
71
  it "selects the right executable" do
55
- described_class.stub(:windows? => false)
72
+ described_class.stub(:windows? => false, :osx? => false)
56
73
  described_class.new.path.should match /#{described_class::EXE_NAME}\Z/
57
74
  end
58
75
  end
metadata CHANGED
@@ -1,64 +1,78 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itunes_store_transporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ version: 0.1.2beta
6
5
  platform: ruby
7
6
  authors:
8
7
  - Skye Shaw
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-14 00:00:00.000000000 Z
11
+ date: 2015-02-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: childprocess
16
- requirement: &70194171326300 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.3.2
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70194171326300
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.3.2
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: optout
27
- requirement: &70194171325780 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ~>
31
+ - - "~>"
31
32
  - !ruby/object:Gem::Version
32
33
  version: 0.0.2
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *70194171325780
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.0.2
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rake
38
- requirement: &70194171325120 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ~>
45
+ - - "~>"
42
46
  - !ruby/object:Gem::Version
43
47
  version: 0.9.2
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *70194171325120
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.9.2
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: rspec
49
- requirement: &70194171324440 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ~>
59
+ - - "~>"
53
60
  - !ruby/object:Gem::Version
54
61
  version: '2.9'
55
- - - <
62
+ - - "<"
56
63
  - !ruby/object:Gem::Version
57
64
  version: '3'
58
65
  type: :development
59
66
  prerelease: false
60
- version_requirements: *70194171324440
61
- description: ! " iTunes::Store::Transporter is a wrapper around Apple's iTMSTransporter
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '2.9'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '3'
75
+ description: " iTunes::Store::Transporter is a wrapper around Apple's iTMSTransporter
62
76
  program. It allows you to upload packages to the \n Apple Store, validate them,
63
77
  retrieve status information, lookup metadata, and more!\n"
64
78
  email: skye.shaw@gmail.com
@@ -69,6 +83,11 @@ extra_rdoc_files:
69
83
  - README.rdoc
70
84
  - Changes
71
85
  files:
86
+ - Changes
87
+ - README.rdoc
88
+ - bin/itms
89
+ - lib/itunes/store/transporter.rb
90
+ - lib/itunes/store/transporter/command.rb
72
91
  - lib/itunes/store/transporter/command/lookup.rb
73
92
  - lib/itunes/store/transporter/command/option.rb
74
93
  - lib/itunes/store/transporter/command/providers.rb
@@ -77,13 +96,11 @@ files:
77
96
  - lib/itunes/store/transporter/command/upload.rb
78
97
  - lib/itunes/store/transporter/command/verify.rb
79
98
  - lib/itunes/store/transporter/command/version.rb
80
- - lib/itunes/store/transporter/command.rb
81
99
  - lib/itunes/store/transporter/errors.rb
82
100
  - lib/itunes/store/transporter/itms_transporter.rb
83
101
  - lib/itunes/store/transporter/output_parser.rb
84
102
  - lib/itunes/store/transporter/shell.rb
85
103
  - lib/itunes/store/transporter/version.rb
86
- - lib/itunes/store/transporter.rb
87
104
  - spec/command_spec.rb
88
105
  - spec/errors_spec.rb
89
106
  - spec/fixtures/errors_and_warnings.yml
@@ -95,14 +112,12 @@ files:
95
112
  - spec/shell_spec.rb
96
113
  - spec/spec_helper.rb
97
114
  - spec/transporter_spec.rb
98
- - README.rdoc
99
- - Changes
100
- - bin/itms
101
115
  homepage: http://github.com/sshaw/itunes_store_transporter
102
116
  licenses:
103
117
  - MIT
104
- post_install_message: ! "\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n
105
- \ !! ATTENTION WINDOWS USERS !!\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n
118
+ metadata: {}
119
+ post_install_message: "\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n !!
120
+ \ ATTENTION WINDOWS USERS !!\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n
106
121
  \ \n You must make a small change to the iTMSTransporter.CMD batch file, otherwise
107
122
  \n this library will not function correctly. \n \n For details see: http://github.com/sshaw/itunes_store_transporter#running-on-windows
108
123
  \ \n\n"
@@ -110,22 +125,20 @@ rdoc_options: []
110
125
  require_paths:
111
126
  - lib
112
127
  required_ruby_version: !ruby/object:Gem::Requirement
113
- none: false
114
128
  requirements:
115
- - - ! '>='
129
+ - - ">="
116
130
  - !ruby/object:Gem::Version
117
131
  version: '0'
118
132
  required_rubygems_version: !ruby/object:Gem::Requirement
119
- none: false
120
133
  requirements:
121
- - - ! '>='
134
+ - - ">"
122
135
  - !ruby/object:Gem::Version
123
- version: '0'
136
+ version: 1.3.1
124
137
  requirements: []
125
138
  rubyforge_project:
126
- rubygems_version: 1.8.10
139
+ rubygems_version: 2.2.2
127
140
  signing_key:
128
- specification_version: 3
141
+ specification_version: 4
129
142
  summary: Upload and manage your assets in the iTunes Store using the iTunes Store's
130
143
  Transporter (iTMSTransporter).
131
144
  test_files:
@@ -140,4 +153,3 @@ test_files:
140
153
  - spec/shell_spec.rb
141
154
  - spec/spec_helper.rb
142
155
  - spec/transporter_spec.rb
143
- has_rdoc: