From 31aad8d7a290690cb4bcf696bac5657c48fadc2a Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 28 Feb 2012 17:18:35 -0500 Subject: [PATCH] tweaks --- bin/hollandaise | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bin/hollandaise b/bin/hollandaise index 19b76d8..bfa9910 100755 --- a/bin/hollandaise +++ b/bin/hollandaise @@ -7,7 +7,7 @@ require 'builder' module Hollandaise class << self - attr_accessor :url + attr_accessor :url, :browsers def configure yield self @@ -52,19 +52,24 @@ module Hollandaise end begin - load 'hollandaise.rb' + load File.join(Dir.pwd, 'hollandaise.rb') rescue LoadError => e end class Hollandaise::CLI < Thor desc "sauce URL BROWSER BROWSER...", "Take screenshots of a URL on Sauce Labs" method_options :delay => 0 - def sauce(url, *browsers) - if Hollandaise.url - browsers.unshift(url) + def sauce(*browsers) + if browsers.first && browsers.first[%r{^http}] + url = browsers.shift + else url = Hollandaise.url end + if Hollandaise.browsers && browsers.empty? + browsers = Hollandaise.browsers + end + threads = [] FileUtils.rm_rf(dir) if File.directory?(dir) @@ -141,7 +146,7 @@ class Hollandaise::CLI < Thor File.open('index.html', 'wb') { |fh| fh.print html.to_s } end - default_task :snapshot + default_task :sauce no_tasks do def dir