lib/capistrano/ghostinspector.rb in capistrano-ghostinspector-0.1.2 vs lib/capistrano/ghostinspector.rb in capistrano-ghostinspector-0.2.0.rc
- old
+ new
@@ -13,12 +13,16 @@
namespace :ghostinspector do
task :run, :only => { :primary => true } do
set :giconfig, YAML::load(File.read("gi_config.yaml"))
+ # Ghost Inspector API key
set :gi_api_key, giconfig["APIKEY"]
+ # Google Analytics Tracking Property
+ set :ga_property, giconfig["ga_property"]
+
# Get tests and suites from command line
set :gitest, fetch(:gitest, nil)
set :gisuite, fetch(:gisuite, nil)
# Check if GI is enabled for this deployment (Default: true)
@@ -30,16 +34,16 @@
if (gi_enabled == true)
# run each test
Capistrano::Ghostinspector.getTests(gitest, giconfig["tests"]).each do |test|
puts "* * * Running Ghost Inspector Test * * *"
- set :passing, Capistrano::Ghostinspector.executeApi("tests", test, gi_api_key, domain, rollback)
+ set :passing, Capistrano::Ghostinspector::Api.executeApi("tests", test, gi_api_key, domain, rollback, ga_property, current_revision[0,7])
end
# run each suite
Capistrano::Ghostinspector.getTests(gisuite, giconfig["suites"]).each do |suite|
puts "* * * Running Ghost Inspector Suite * * *"
- set :passing, Capistrano::Ghostinspector.executeApi("suites", suite, gi_api_key, domain, rollback)
+ set :passing, Capistrano::Ghostinspector::Api.executeApi("suites", suite, gi_api_key, domain, rollback, ga_property, current_revision[0,7])
end
# If any test fails and the stage allows rollbacks then
# rollback to previous version.
if (passing == false && rollback == true)
\ No newline at end of file