38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/readability_importer/command.rb', line 38
def import
importer = Importer.new(options[:email_address], {
:verbose => options[:verbose],
:from => options[:from],
:max_concurrency => options[:concurrency],
:retry => options[:retry],
:on_importing => proc do |urls|
puts "Importing #{urls.size} url(s)..."
end,
:on_imported => proc do |urls|
puts urls.map{|u| "Imported #{u}"}
end,
:on_failed => proc do |urls|
puts urls.map{|u| "Failed #{u}"}
end
})
Loader.loaders.each do |(name, klass)|
if options[name]
loader = klass.new(options[name])
urls = loader.load
puts "Start importing #{urls.size} url(s)."
importer.import(urls)
end
end
end
|