Class: Capistrano::CI::Clients::Travis

Inherits:
Base
  • Object
show all
Defined in:
lib/capistrano/ci/clients/travis.rb

Direct Known Subclasses

TravisPro

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings = {}) ⇒ Travis

Returns a new instance of Travis.



9
10
11
12
13
# File 'lib/capistrano/ci/clients/travis.rb', line 9

def initialize(settings = {})
  self.class.headers 'Accept' => 'application/json; version=2'

  @repository_name = settings[:ci_repository]
end

Instance Attribute Details

#repository_nameObject (readonly)

Returns the value of attribute repository_name.



7
8
9
# File 'lib/capistrano/ci/clients/travis.rb', line 7

def repository_name
  @repository_name
end

Instance Method Details

#passed?(branch) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/capistrano/ci/clients/travis.rb', line 15

def passed?(branch)
  state(branch) == "passed"
end

#state(branch) ⇒ Object



19
20
21
# File 'lib/capistrano/ci/clients/travis.rb', line 19

def state(branch)
  branch(branch)["state"]
end