module GitHubStatus::Support::Params

Public Instance Methods

context() click to toggle source
# File lib/github-status/support/params.rb, line 26
def context
  @context ||= params.fetch 'context', ENV["BUILD_JOB_NAME"]
end
description() click to toggle source
# File lib/github-status/support/params.rb, line 31
def description
  @description ||= params.fetch 'description', "#{ENV["BUILD_JOB_NAME"]} number #{ENV["BUILD_NAME"]}"
end
path() click to toggle source
# File lib/github-status/support/params.rb, line 10
def path
  @path ||= params.fetch 'path'
rescue KeyError
  STDERR.puts 'Params is missing path'
  abort
end
state() click to toggle source
# File lib/github-status/support/params.rb, line 18
def state
  @state ||= params.fetch 'state'
rescue KeyError
  STDERR.puts 'Params is missing state'
  abort
end
statuses() click to toggle source
# File lib/github-status/support/params.rb, line 36
def statuses
  @statuses ||= params.fetch 'statuses', []
end
target_url() click to toggle source
# File lib/github-status/support/params.rb, line 41
def target_url
  url = params.fetch 'target_url', "#{atc_external_url}/builds/#{build_id}"
  if File.file?("#{workdir}/#{url}")
    url = File.read("#{workdir}/#{url}").chomp
  end
  @target_url ||= url
end