Module: BuildEval::Travis

Defined in:
lib/build_eval/travis.rb,
lib/build_eval/travis/session.rb,
lib/build_eval/travis/session/pool.rb,
lib/build_eval/travis/session/factory.rb,
lib/build_eval/travis/session/session.rb

Defined Under Namespace

Modules: Session

Class Method Summary collapse

Class Method Details

.last_build_status(args) ⇒ Object


9
10
11
12
13
14
15
16
17
# File 'lib/build_eval/travis.rb', line 9

def self.last_build_status(args)
  BuildEval::Travis::Session.open(args[:github_token]) do |session|
    repository = session.repo(args[:repository_path])
    build = args[:branch] ? repository.branch(args[:branch]) : repository.last_build
    STATUS_BY_COLOR[build.color.to_sym]
  end
rescue ::Travis::Client::Error
  "Unknown"
end