Class: Capistrano::CI::Clients::Circle

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

Instance Method Summary collapse

Constructor Details

#initialize(settings = {}) ⇒ Circle

Returns a new instance of Circle.



7
8
9
10
11
12
# File 'lib/capistrano/ci/clients/circle.rb', line 7

def initialize(settings = {})
  self.class.default_params "circle-token" => settings[:ci_access_token]
  self.class.headers 'Accept' => 'application/json'

  @repository_name = settings[:ci_repository]
end

Instance Method Details

#passed?(branch_name) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/capistrano/ci/clients/circle.rb', line 14

def passed?(branch_name)
  state(branch_name) == "success"
end

#state(branch_name) ⇒ Object



18
19
20
# File 'lib/capistrano/ci/clients/circle.rb', line 18

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