Class: ArduinoBuildNotifier::CruiseControlBuild

Inherits:
Object
  • Object
show all
Defined in:
lib/arduino_build_notifier/cruise_control_build.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, project, auth = {}) ⇒ CruiseControlBuild

Returns a new instance of CruiseControlBuild.



8
9
10
11
12
# File 'lib/arduino_build_notifier/cruise_control_build.rb', line 8

def initialize(url, project, auth = {})
  @url     = "#{url}/XmlStatusReport.aspx"
  @project = project
  @auth    = auth
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/arduino_build_notifier/cruise_control_build.rb', line 6

def status
  @status
end

Instance Method Details

#request_statusObject



14
15
16
17
18
19
20
21
22
# File 'lib/arduino_build_notifier/cruise_control_build.rb', line 14

def request_status
  begin
    response = HTTParty.get @url, basic_auth: @auth
    response = parse(response)
    set_status(response)
  rescue
    @status = :error
  end
end