Class: Integrity::Build
- Includes:
- DataMapper::Resource
- Defined in:
- lib/integrity/build.rb
Class Method Summary collapse
Instance Method Summary collapse
- #commit_author ⇒ Object
- #commit_identifier ⇒ Object
- #commit_message ⇒ Object
- #commit_metadata ⇒ Object
- #commited_at ⇒ Object
- #complete!(time = Time.now) ⇒ Object
- #failed? ⇒ Boolean
- #pending? ⇒ Boolean
- #project_id ⇒ Object
-
#short_commit_identifier ⇒ Object
Deprecated methods.
- #start!(time = Time.now) ⇒ Object
- #status ⇒ Object
Class Method Details
.pending ⇒ Object
16 17 18 |
# File 'lib/integrity/build.rb', line 16 def self.pending all(:started_at => nil) end |
.queue(commit) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/integrity/build.rb', line 20 def self.queue(commit) commit.update_attributes(:build => new) # Build on foreground (this will move away, I promise) ProjectBuilder.build(commit) end |
Instance Method Details
#commit_author ⇒ Object
64 65 66 67 |
# File 'lib/integrity/build.rb', line 64 def warn "Build#commit_author is deprecated, use Commit#author (#{caller[0]})" commit. end |
#commit_identifier ⇒ Object
59 60 61 62 |
# File 'lib/integrity/build.rb', line 59 def commit_identifier warn "Build#commit_identifier is deprecated, use Commit#identifier (#{caller[0]})" commit.identifier end |
#commit_message ⇒ Object
69 70 71 72 |
# File 'lib/integrity/build.rb', line 69 def warn "Build#commit_message is deprecated, use Commit#message (#{caller[0]})" commit. end |
#commit_metadata ⇒ Object
84 85 86 87 88 89 |
# File 'lib/integrity/build.rb', line 84 def warn "Build#commit_metadata is deprecated, use the different methods in Commit instead (#{caller[0]})" { :message => commit., :author => commit., :date => commit.committed_at } end |
#commited_at ⇒ Object
74 75 76 77 |
# File 'lib/integrity/build.rb', line 74 def commited_at warn "Build#commited_at is deprecated, use Commit#committed_at (#{caller[0]})" commit.committed_at end |
#complete!(time = Time.now) ⇒ Object
47 48 49 |
# File 'lib/integrity/build.rb', line 47 def complete!(time=Time.now) self.completed_at = time end |
#failed? ⇒ Boolean
31 32 33 |
# File 'lib/integrity/build.rb', line 31 def failed? !successful? end |
#pending? ⇒ Boolean
27 28 29 |
# File 'lib/integrity/build.rb', line 27 def pending? started_at.nil? end |
#project_id ⇒ Object
79 80 81 82 |
# File 'lib/integrity/build.rb', line 79 def project_id warn "Build#project_id is deprecated, use Commit#project_id (#{caller[0]})" commit.project_id end |
#short_commit_identifier ⇒ Object
Deprecated methods
54 55 56 57 |
# File 'lib/integrity/build.rb', line 54 def short_commit_identifier warn "Build#short_commit_identifier is deprecated, use Commit#short_identifier (#{caller[0]})" commit.short_identifier end |
#start!(time = Time.now) ⇒ Object
43 44 45 |
# File 'lib/integrity/build.rb', line 43 def start!(time=Time.now) self.started_at = time end |
#status ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/integrity/build.rb', line 35 def status case when pending? then :pending when successful? then :success when failed? then :failed end end |