Class: Capybara::Bamboo::Client::Plan

Inherits:
Object
  • Object
show all
Includes:
DSL
Defined in:
lib/capybara-bamboo-client/plan.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Plan

Returns a new instance of Plan.



9
10
11
12
13
14
# File 'lib/capybara-bamboo-client/plan.rb', line 9

def initialize(opts)
  opts.keys.each do |attr_key|
    self.class.send(:attr_accessor, attr_key)
    instance_variable_set("@#{attr_key}", opts[attr_key])
  end
end

Instance Method Details

#disableObject



16
17
18
# File 'lib/capybara-bamboo-client/plan.rb', line 16

def disable
  visit "/build/admin/suspendBuild.action?returnUrl=%2Fchain%2Fadmin%2Fconfig%2FdefaultStages.action%3FbuildKey%3D#{key}&buildKey=#{key}"
end

#enableObject



20
21
22
# File 'lib/capybara-bamboo-client/plan.rb', line 20

def enable
  visit "/build/admin/resumeBuild.action?returnUrl=%2Fchain%2Fadmin%2Fconfig%2FdefaultStages.action%3FbuildKey%3D#{key}&buildKey=#{key}"
end

#startObject



24
25
26
# File 'lib/capybara-bamboo-client/plan.rb', line 24

def start
  visit "/build/admin/triggerManualBuild.action?buildKey=#{key}"
end

#stopObject



28
29
30
# File 'lib/capybara-bamboo-client/plan.rb', line 28

def stop
  visit "/build/admin/ajax/stopPlan.action?planKey=#{key}"
end