Class: Capistrano::CI::Clients::Semaphore

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings = {}) ⇒ Semaphore

Returns a new instance of Semaphore.



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

def initialize(settings = {})
  self.class.default_params "auth_token" => settings[:ci_access_token]

  @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/semaphore.rb', line 7

def repository_name
  @repository_name
end

Instance Method Details

#passed?(branch_name) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#state(branch_name) ⇒ Object



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

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