Class: CIJoe::Build
- Inherits:
-
Struct
- Object
- Struct
- CIJoe::Build
- Defined in:
- lib/cijoe/build.rb
Instance Attribute Summary collapse
-
#finished_at ⇒ Object
Returns the value of attribute finished_at.
-
#output ⇒ Object
Returns the value of attribute output.
-
#project ⇒ Object
Returns the value of attribute project.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#status ⇒ Object
Returns the value of attribute status.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #clean_output ⇒ Object
- #commit ⇒ Object
- #failed? ⇒ Boolean
-
#initialize(*args) ⇒ Build
constructor
A new instance of Build.
- #short_sha ⇒ Object
- #worked? ⇒ Boolean
Constructor Details
#initialize(*args) ⇒ Build
Returns a new instance of Build.
3 4 5 6 |
# File 'lib/cijoe/build.rb', line 3 def initialize(*args) super self.started_at = Time.now end |
Instance Attribute Details
#finished_at ⇒ Object
Returns the value of attribute finished_at
2 3 4 |
# File 'lib/cijoe/build.rb', line 2 def finished_at @finished_at end |
#output ⇒ Object
Returns the value of attribute output
2 3 4 |
# File 'lib/cijoe/build.rb', line 2 def output @output end |
#project ⇒ Object
Returns the value of attribute project
2 3 4 |
# File 'lib/cijoe/build.rb', line 2 def project @project end |
#sha ⇒ Object
Returns the value of attribute sha
2 3 4 |
# File 'lib/cijoe/build.rb', line 2 def sha @sha end |
#started_at ⇒ Object
Returns the value of attribute started_at
2 3 4 |
# File 'lib/cijoe/build.rb', line 2 def started_at @started_at end |
#status ⇒ Object
Returns the value of attribute status
2 3 4 |
# File 'lib/cijoe/build.rb', line 2 def status @status end |
#user ⇒ Object
Returns the value of attribute user
2 3 4 |
# File 'lib/cijoe/build.rb', line 2 def user @user end |
Instance Method Details
#clean_output ⇒ Object
25 26 27 |
# File 'lib/cijoe/build.rb', line 25 def clean_output output.gsub(/\e\[.+?m/, '').strip end |
#commit ⇒ Object
29 30 31 |
# File 'lib/cijoe/build.rb', line 29 def commit @commit ||= Commit.new(sha, user, project) end |
#failed? ⇒ Boolean
13 14 15 |
# File 'lib/cijoe/build.rb', line 13 def failed? status == :failed end |
#short_sha ⇒ Object
21 22 23 |
# File 'lib/cijoe/build.rb', line 21 def short_sha sha[0,7] if sha end |
#worked? ⇒ Boolean
17 18 19 |
# File 'lib/cijoe/build.rb', line 17 def worked? status == :worked end |