-
Notifications
You must be signed in to change notification settings - Fork 14
/
Rakefile
48 lines (39 loc) · 1.11 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "rdoc/task"
require "sdoc"
require "pp"
require "itunes/store/transporter/output_parser"
require "itunes/store/transporter/xml/status"
RSpec::Core::RakeTask.new(:spec)
task :default => "spec"
RDoc::Task.new do |rdoc|
rdoc.generator = "sdoc"
rdoc.rdoc_files.include("README.rdoc", "lib/**/*.rb")
end
namespace :parse do
desc "parse iTMSTransporter output given via stdin"
task :output do
print_results = lambda do |name, results|
print "#{name}:"
if results.none?
puts " none"
else
print "\n"
results.each_with_index do |message, i|
printf "%2d. %s\n", i + 1, message.to_s
end
end
puts "-" * 30
end
parser = ITunes::Store::Transporter::OutputParser.new(STDIN.readlines)
print_results.call("Errors", parser.errors)
print_results.call("Warnings", parser.warnings)
end
namespace :xml do
desc "parse iTMSTransporter status or statusAll XML, given via stdin"
task :status do
pp ITunes::Store::Transporter::XML::Status.new.parse(STDIN)
end
end
end