Class: Integrity::Build
- Includes:
- DataMapper::Resource
- Defined in:
- lib/integrity/build.rb
Instance Method Summary collapse
- #commit_author ⇒ Object
- #commit_message ⇒ Object
- #commited_at ⇒ Object
- #failed? ⇒ Boolean
- #human_readable_status ⇒ Object
- #short_commit_identifier ⇒ Object
- #status ⇒ Object
Instance Method Details
#commit_author ⇒ Object
33 34 35 36 37 38 |
# File 'lib/integrity/build.rb', line 33 def @author ||= begin [:author] =~ /^(.*) <(.*)>$/ OpenStruct.new(:name => $1.strip, :email => $2.strip, :full => [:author]) end end |
#commit_message ⇒ Object
40 41 42 |
# File 'lib/integrity/build.rb', line 40 def [:message] end |
#commited_at ⇒ Object
44 45 46 47 48 49 |
# File 'lib/integrity/build.rb', line 44 def commited_at case [:date] when String then Time.parse([:date]) else [:date] end end |
#failed? ⇒ Boolean
17 18 19 |
# File 'lib/integrity/build.rb', line 17 def failed? !successful? end |
#human_readable_status ⇒ Object
25 26 27 |
# File 'lib/integrity/build.rb', line 25 def human_readable_status successful? ? 'Build Successful' : 'Build Failed' end |
#short_commit_identifier ⇒ Object
29 30 31 |
# File 'lib/integrity/build.rb', line 29 def short_commit_identifier sha1?(commit_identifier) ? commit_identifier[0..6] : commit_identifier end |
#status ⇒ Object
21 22 23 |
# File 'lib/integrity/build.rb', line 21 def status successful? ? :success : :failed end |