Class: Bard::CLI::CI::Remote
- Inherits:
-
Struct
- Object
- Struct
- Bard::CLI::CI::Remote
- Defined in:
- lib/bard/ci.rb
Instance Attribute Summary collapse
-
#last_response ⇒ Object
Returns the value of attribute last_response.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
-
#sha ⇒ Object
Returns the value of attribute sha.
Instance Method Summary collapse
Instance Attribute Details
#last_response ⇒ Object
Returns the value of attribute last_response.
49 50 51 |
# File 'lib/bard/ci.rb', line 49 def last_response @last_response end |
#project_name ⇒ Object
Returns the value of attribute project_name
24 25 26 |
# File 'lib/bard/ci.rb', line 24 def project_name @project_name end |
#sha ⇒ Object
Returns the value of attribute sha
24 25 26 |
# File 'lib/bard/ci.rb', line 24 def sha @sha end |
Instance Method Details
#console ⇒ Object
44 45 46 47 |
# File 'lib/bard/ci.rb', line 44 def console raw = `curl -s #{ci_host}/lastBuild/console` raw[%r{<pre.*?>(.+)</pre>}m, 1] end |
#exists? ⇒ Boolean
40 41 42 |
# File 'lib/bard/ci.rb', line 40 def exists? `curl -s -I #{ci_host}/` =~ /\b200 OK\b/ end |
#run ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/bard/ci.rb', line 25 def run last_time_elapsed = get_last_time_elapsed start sleep(2) until started? start_time = Time.new.to_i while building? elapsed_time = Time.new.to_i - start_time yield elapsed_time, last_time_elapsed sleep(2) end success? end |