Class: CiHelper::IssueMonitor
- Inherits:
-
Object
- Object
- CiHelper::IssueMonitor
- Includes:
- RspecResultParser
- Defined in:
- lib/ci_helper/issue_monitor.rb
Defined Under Namespace
Classes: Result
Instance Attribute Summary collapse
-
#ci_procedure ⇒ Object
readonly
Returns the value of attribute ci_procedure.
-
#issue_status ⇒ Object
Returns the value of attribute issue_status.
Instance Method Summary collapse
- #content ⇒ Object
- #failures_each ⇒ Object
- #finish_test? ⇒ Boolean
- #goto_monitor_page ⇒ Object
-
#initialize(account, password) ⇒ IssueMonitor
constructor
A new instance of IssueMonitor.
- #matching_strategy ⇒ Object
- #matching_strategy=(pattern) ⇒ Object
- #success? ⇒ Boolean
Methods included from RspecResultParser
Constructor Details
#initialize(account, password) ⇒ IssueMonitor
Returns a new instance of IssueMonitor.
12 13 14 |
# File 'lib/ci_helper/issue_monitor.rb', line 12 def initialize(account, password) @ci_procedure = CiProcedure.new(account, password) end |
Instance Attribute Details
#ci_procedure ⇒ Object (readonly)
Returns the value of attribute ci_procedure.
6 7 8 |
# File 'lib/ci_helper/issue_monitor.rb', line 6 def ci_procedure @ci_procedure end |
#issue_status ⇒ Object
Returns the value of attribute issue_status.
5 6 7 |
# File 'lib/ci_helper/issue_monitor.rb', line 5 def issue_status @issue_status end |
Instance Method Details
#content ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/ci_helper/issue_monitor.rb', line 54 def content Result.new(success?, parser.fail_examples, "#{ci_procedure.console_page.uri.host}/#{ci_procedure.console_page.uri.request_uri}", ci_procedure.issue_number, ci_procedure.branch_name, ci_procedure.commit_hash) end |
#failures_each ⇒ Object
50 51 52 |
# File 'lib/ci_helper/issue_monitor.rb', line 50 def failures_each parser.fail_examples.each { |failed_example| yield(failed_example) } end |
#finish_test? ⇒ Boolean
41 42 43 44 45 46 47 48 |
# File 'lib/ci_helper/issue_monitor.rb', line 41 def finish_test? begin ci_procedure.re_get_console_output.empty? ? false : true rescue CiHelper::Exceptions::IssueNotFound => e puts "#{e.} #{ci_procedure.matching_strategy}" false end end |
#goto_monitor_page ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ci_helper/issue_monitor.rb', line 24 def goto_monitor_page begin ci_procedure.run rescue CiHelper::Exceptions::IssueNotFound => e puts "#{e.} #{ci_procedure.matching_strategy}" return false end true end |
#matching_strategy ⇒ Object
20 21 22 |
# File 'lib/ci_helper/issue_monitor.rb', line 20 def matching_strategy ci_procedure.matching_strategy end |
#matching_strategy=(pattern) ⇒ Object
16 17 18 |
# File 'lib/ci_helper/issue_monitor.rb', line 16 def matching_strategy=(pattern) ci_procedure.matching_strategy = pattern end |
#success? ⇒ Boolean
35 36 37 38 39 |
# File 'lib/ci_helper/issue_monitor.rb', line 35 def success? parser.console_output = ci_procedure.get_console_output parser.formalize_output parser.success? end |