Module: Build::States

Extended by:
ActiveSupport::Concern
Included in:
Build
Defined in:
lib/travis/model/build/states.rb

Instance Method Summary collapse

Instance Method Details

#colorObject



39
40
41
# File 'lib/travis/model/build/states.rb', line 39

def color
  pending? ? 'yellow' : passed? ? 'green' : 'red'
end

#failed?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/travis/model/build/states.rb', line 35

def failed?
  !passed?
end

#finish(data = {}) ⇒ Object



22
23
24
25
# File 'lib/travis/model/build/states.rb', line 22

def finish(data = {})
  self.status = matrix_status
  self.finished_at = data[:finished_at]
end

#passed?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/travis/model/build/states.rb', line 31

def passed?
  status == 0
end

#pending?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/travis/model/build/states.rb', line 27

def pending?
  !finished?
end

#start(data = {}) ⇒ Object



18
19
20
# File 'lib/travis/model/build/states.rb', line 18

def start(data = {})
  self.started_at = data[:started_at]
end