Class: BuildEval::Server::TravisPro

Inherits:
Object
  • Object
show all
Defined in:
lib/build_eval/server/travis_pro.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ TravisPro

Returns a new instance of TravisPro.


6
7
8
9
10
# File 'lib/build_eval/server/travis_pro.rb', line 6

def initialize(args)
  @username     = args[:username]
  @github_token = args[:github_token]
  @branch       = args[:branch]
end

Instance Method Details

#build_result(build_name, branch_name) ⇒ Object


12
13
14
15
16
17
18
19
20
21
# File 'lib/build_eval/server/travis_pro.rb', line 12

def build_result(build_name, branch_name)
  repository_path = "#{@username}/#{build_name}"
  BuildEval::Result::BuildResult.create(
    build_name:  repository_path,
    branch_name: branch_name,
    status_name: BuildEval::Travis.last_build_status(github_token:    @github_token,
                                                     repository_path: repository_path,
                                                     branch:          branch_name)
  )
end

#to_sObject


23
24
25
# File 'lib/build_eval/server/travis_pro.rb', line 23

def to_s
  "Travis CI Pro #{@username}"
end