Class: Integrity::Build

Inherits:
Object show all
Includes:
DataMapper::Resource
Defined in:
lib/integrity/build.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.pendingObject



16
17
18
# File 'lib/integrity/build.rb', line 16

def self.pending
  all(:started_at => nil)
end

Instance Method Details

#commit_authorObject



57
58
59
60
# File 'lib/integrity/build.rb', line 57

def commit_author
  warn "Build#commit_author is deprecated, use Commit#author"
  commit.author
end

#commit_identifierObject



52
53
54
55
# File 'lib/integrity/build.rb', line 52

def commit_identifier
  warn "Build#commit_identifier is deprecated, use Commit#identifier"
  commit.identifier
end

#commit_messageObject



62
63
64
65
# File 'lib/integrity/build.rb', line 62

def commit_message
  warn "Build#commit_message is deprecated, use Commit#message"
  commit.message
end

#commit_metadataObject



77
78
79
80
81
82
# File 'lib/integrity/build.rb', line 77

def 
  warn "Build#commit_metadata is deprecated, use the different methods in Commit instead"
  { :message => commit.message,
    :author  => commit.author,
    :date    => commit.committed_at }
end

#commited_atObject



67
68
69
70
# File 'lib/integrity/build.rb', line 67

def commited_at
  warn "Build#commited_at is deprecated, use Commit#committed_at"
  commit.committed_at
end

#complete!(time = Time.now) ⇒ Object



40
41
42
# File 'lib/integrity/build.rb', line 40

def complete!(time=Time.now)
  self.completed_at = time
end

#failed?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/integrity/build.rb', line 24

def failed?
  !successful?
end

#pending?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/integrity/build.rb', line 20

def pending?
  started_at.nil?
end

#project_idObject



72
73
74
75
# File 'lib/integrity/build.rb', line 72

def project_id
  warn "Build#project_id is deprecated, use Commit#project_id"
  commit.project_id
end

#short_commit_identifierObject

Deprecated methods



47
48
49
50
# File 'lib/integrity/build.rb', line 47

def short_commit_identifier
  warn "Build#short_commit_identifier is deprecated, use Commit#short_identifier"
  commit.short_identifier
end

#start!(time = Time.now) ⇒ Object



36
37
38
# File 'lib/integrity/build.rb', line 36

def start!(time=Time.now)
  self.started_at = time
end

#statusObject



28
29
30
31
32
33
34
# File 'lib/integrity/build.rb', line 28

def status
  case
  when pending?    then :pending
  when successful? then :success
  when failed?     then :failed
  end
end