Class: ITunes::Store::Transporter::OutputParser

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

Constant Summary collapse

ERROR_LINE =
/<main>\s+ERROR:\s+(.+)/
WARNING_LINE =
/<main>\s+WARN:\s+(.+)/
SKIP_ERRORS =

Generic messages we want to ignore.

[ /\boperation was not successful/i,
/\bunable to verify the package/i,
/\bwill NOT be verified/,
/^an error has occurred/i,
/^an error occurred while/i,
/^unknown operation/i,
/\bunable to authenticate the package/i ]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ OutputParser

Arguments

output (Array)

iTMSTransporter output



33
34
35
36
37
# File 'lib/itunes/store/transporter/output_parser.rb', line 33

def initialize(output)
  @errors = []
  @warnings = []
  parse_output(output) if Array === output
end

Instance Attribute Details

#errorsObject (readonly)

This class extracts error and warning messages output by iTMSTransporter. For each message is creates an instance of ITunes::Store::Transporter::TransporterMessage



13
14
15
# File 'lib/itunes/store/transporter/output_parser.rb', line 13

def errors
  @errors
end

#warningsObject (readonly)

Returns the value of attribute warnings.



14
15
16
# File 'lib/itunes/store/transporter/output_parser.rb', line 14

def warnings
  @warnings
end