Class: Fuci::TeamCity::Build

Inherits:
Struct
  • Object
show all
Defined in:
lib/fuci/team_city/build.rb

Constant Summary collapse

ERROR =
'ERROR'
SUCCESS =
'SUCCESS'
LOG_RESOURCE =
lambda { |id| "/downloadBuildLog.html?buildId=#{id}" }

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#elementObject

Returns the value of attribute element

Returns:

  • (Object)

    the current value of element



8
9
10
# File 'lib/fuci/team_city/build.rb', line 8

def element
  @element
end

Class Method Details

.createObject



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

def self.create
  if branch_name = Fuci::TeamCity::CliOptions.branch
    project.latest_build_from branch_name
  else
    create_with_default_branch
  end
end

Instance Method Details

#logObject



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

def log
  Request.new(log_resource).call
end

#status_codeObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/fuci/team_city/build.rb', line 13

def status_code
  case status
  when ERROR
    :red
  when SUCCESS
    :green
  else
    :yellow
  end
end