lib/yamg/cli.rb in yamg-0.0.7 vs lib/yamg/cli.rb in yamg-0.0.8
- old
+ new
@@ -9,12 +9,10 @@
puts
return YAMG.init if argv.join =~ /init/
YAMG.load_config # (argv)
@works = YAMG.config['compile']
- compile
- screenshot
end
def setup_for(opts)
case opts
when Hash then opts
@@ -56,24 +54,28 @@
# puts 'Custom job!'
end
end
def compile(scope = nil)
- time = Time.now
works.select! { |w| w =~ scope } if scope
works.each { |out, opts| compile_work(out, opts) }
works.select! { |w| w =~ scope } if scope
puts Rainbow("Working on #{works.keys.join(', ')}").yellow
+ end
+ def screenshot
YAMG.config['screenshots'].each do |ss|
Thread.new { Screenshot.new(ss).work('./media') }
end
+ end
+
+ def work!
+ time = Time.now
+ compile
+ screenshot
puts Rainbow(Thread.list.size.to_s + ' jobs').black
Thread.list.reject { |t| t == Thread.current }.each(&:join)
puts Rainbow('-' * 59).black
puts Rainbow("Done compile #{Time.now - time}").red
- end
-
- def screenshot
end
end
end