Class: Capistrano::CI::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/ci/client.rb

Defined Under Namespace

Classes: NotFound

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Client

Returns a new instance of Client.



22
23
24
25
26
27
# File 'lib/capistrano/ci/client.rb', line 22

def initialize(context)
  @config = self.class.settings.inject({}) do |result, key|
    result[key] = context.fetch(key)
    result
  end
end

Class Method Details

.clientsObject



12
13
14
# File 'lib/capistrano/ci/client.rb', line 12

def clients
  @clients ||= {}
end

.register(client_name, client_class, attributes = []) ⇒ Object



7
8
9
10
# File 'lib/capistrano/ci/client.rb', line 7

def register(client_name, client_class, attributes = [])
  self.clients[client_name] ||= { client_class: client_class, attributes: attributes }
  @settings = settings | attributes
end

.settingsObject



16
17
18
# File 'lib/capistrano/ci/client.rb', line 16

def settings
  @settings ||= [:ci_client]
end

Instance Method Details

#passed?(branch) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/capistrano/ci/client.rb', line 33

def passed?(branch)
  client.passed?(branch)
end

#state(branch) ⇒ Object



29
30
31
# File 'lib/capistrano/ci/client.rb', line 29

def state(branch)
  client.state(branch)
end