diff --git a/Changes b/Changes index 99329a0..c7d6bc2 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,16 @@ +v0.1.2 2015-03-07 +-------------------- +Changes: +* Only parse errors from the main iTMSTransporter thread + +Enhancements: +* Look for the iTMSTransporter at known locations on OS X +* Add the :streams (-numStreams) option to upload + v0.1.1 2013-08-14 -------------------- -Changes: -* Added post_install_message letting Windows users know they need to modify iTMSTransporter.CMD +Changes: +* Added post_install_message letting Windows users know they need to modify iTMSTransporter.CMD * Transporter is now a module, new() returns an instance of ITMSTransporter Bug fixes: @@ -22,7 +31,7 @@ Enhancements: * `itms` added --no-config option * `itms` allow boolean options to be set to false via --no-XXXX, e.g., --no-print-stderr -Bug Fixes: +Bug Fixes: * `itms status` passed the wrong arguments to the underlying method * `itms` failed when the config file was empty * Verify command :verify_assets => true would disable asset verification diff --git a/lib/itunes/store/transporter/output_parser.rb b/lib/itunes/store/transporter/output_parser.rb index 0a6616b..23b8a2c 100644 --- a/lib/itunes/store/transporter/output_parser.rb +++ b/lib/itunes/store/transporter/output_parser.rb @@ -13,8 +13,8 @@ class OutputParser attr :errors attr :warnings - ERROR_LINE = />\s+ERROR:\s+(.+)/ - WARNING_LINE = />\s+WARN:\s+(.+)/ + ERROR_LINE = /
\s+ERROR:\s+(.+)/ + WARNING_LINE = /
\s+WARN:\s+(.+)/ # Generic messages we want to ignore. SKIP_ERRORS = [ /\boperation was not successful/i, diff --git a/lib/itunes/store/transporter/version.rb b/lib/itunes/store/transporter/version.rb index da747a6..f37515b 100644 --- a/lib/itunes/store/transporter/version.rb +++ b/lib/itunes/store/transporter/version.rb @@ -1,7 +1,7 @@ module ITunes module Store module Transporter - VERSION = "0.1.1" + VERSION = "0.1.2" end end end diff --git a/spec/fixtures/errors_and_warnings.yml b/spec/fixtures/errors_and_warnings.yml index 68405e0..b907213 100644 --- a/spec/fixtures/errors_and_warnings.yml +++ b/spec/fixtures/errors_and_warnings.yml @@ -2,7 +2,7 @@ no_error_number: | [2000-01-01 00:00:00]
INFO: Transporter is doing something fun [2000-01-01 00:00:00]
INFO: Transporter is still doing some fun stuff [2000-01-01 00:00:00]
ERROR: "An error occurred while doing fun stuff" at Location1 (Class) - [2000-01-01 00:00:00] ERROR: "An exception has occurred: network timeout" at Location2 (Class) + [2000-01-01 00:00:00]
ERROR: "An exception has occurred: network timeout" at Location2 (Class) [2000-01-01 00:00:00]
DBG-X: About to exit Package Summary: @@ -26,7 +26,7 @@ with_error_number: | ERROR ITMS-4000 "This is error 4000" ERROR ITMS-5000 "This is error 5000" -single_warning: | +single_warning: | [2000-01-01 00:00:00]
INFO: Transporter is doing something fun [2000-01-01 00:00:00]
WARN: WARNING ITMS-4010: "You've been warned!" at Location1 (Class) [2000-01-01 00:00:00]
INFO: I'm outta here @@ -43,3 +43,16 @@ duplicate_errors: | [2000-01-01 00:00:00]
INFO: Transporter is doing something fun [2000-01-01 00:00:00]
ERROR: ERROR ITMS-7000: "Error 3" at Location3 (ClassX) [2000-01-01 00:00:00]
INFO: I'm outta here + +error_from_main_and_class: | + [2000-01-01 00:00:00]
INFO: Transporter is doing something fun + [2000-01-01 00:00:00]
INFO: Transporter is still doing some fun stuff + [2000-01-01 00:00:00] ERROR: "An exception has occurred in.some.Class: network timeout" + [2000-01-01 00:00:00]
INFO: Transporter is still doing some fun stuff + [2000-01-01 00:00:00]
ERROR: Another error has occurred + [2000-01-01 00:00:00]
DBG-X: About to exit + + Package Summary: + + 1 package was uploaded successfully: + /home/sshaw/123123123.itmsp diff --git a/spec/output_parser_spec.rb b/spec/output_parser_spec.rb index 9a727bf..eab8d30 100644 --- a/spec/output_parser_spec.rb +++ b/spec/output_parser_spec.rb @@ -1,68 +1,78 @@ require "spec_helper" describe ITunes::Store::Transporter::OutputParser do - describe "parsing errors" do + describe "parsing errors" do # TODO: test various error message/code formats handled by the parser - context "without an error code" do + context "without an error code" do before(:all) { @parser = described_class.new(fixture("errors_and_warnings.no_error_number")) } subject { @parser } its(:warnings) { should be_empty } its(:errors) { should have(2).items } - describe "the first error" do + describe "the first error" do subject { @parser.errors.first } its(:code) { should be_nil } its(:message) { should == "An error occurred while doing fun stuff" } end - describe "the second error" do + describe "the second error" do subject { @parser.errors.last } its(:code) { should be_nil } its(:message) { should == "An exception has occurred: network timeout" } end end - context "with an error code" do + context "with errors from main and from a class" do + before(:all) { @parser = described_class.new(fixture("errors_and_warnings.error_from_main_and_class")) } + subject { @parser } + + it "only parses the error from main" do + expect(@parser.errors.size).to eq 1 + expect(@parser.errors.first.message).to eq "Another error has occurred" + end + end + + context "with an error code" do before(:all) { @parser = described_class.new(fixture("errors_and_warnings.with_error_number")) } - + subject { @parser } its(:warnings) { should be_empty } its(:errors) { should have(2).items } - - describe "the first error" do + + describe "the first error" do subject { @parser.errors.first } its(:code) { should == 4000 } its(:message) { should == "This is error 4000" } end - describe "the second error" do + describe "the second error" do subject { @parser.errors.last } its(:code) { should == 5000 } its(:message) { should == "This is error 5000" } end end - context "with duplicate messages" do + context "with duplicate messages" do before(:all) { @parser = described_class.new(fixture("errors_and_warnings.duplicate_errors")) } - - it "does not include duplicates" do + + it "does not include duplicates" do errors = @parser.errors.map { |e| e.message } errors.should == ["Error 1", "Error 2", "Error 3"] end end end - describe "parsing warnings" do + describe "parsing warnings" do before(:all) { @parser = described_class.new(fixture("errors_and_warnings.single_warning")) } subject { @parser } its(:errors) { should be_empty } its(:warnings) { should have(1).item } - describe "the warning" do + describe "the warning" do subject { @parser.warnings.first } its(:code) { should == 4010 } its(:message) { should == "You've been warned!" }