12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/gigbot/commands/update.rb', line 12
def run(options={})
FileUtils.mkdir_p Gigbot::DATA_PATH
Gigbot::Source.each do |source|
begin
source.import
puts [
"✓".colorize(color: :green),
"(#{source.imported.length})".ljust(7, ' ').colorize(color: :yellow),
source.title,
].join(' ')
rescue StandardError => e
if options[:verbose]
puts e
puts e.backtrace
end
puts [
"X".colorize(color: :red),
"".ljust(7, ' '),
source.title,
].join(' ')
end
end
end
|