Class: Capistrano::CI::Client
- Inherits:
-
Object
- Object
- Capistrano::CI::Client
- Defined in:
- lib/capistrano/ci/client.rb
Defined Under Namespace
Classes: NotFound
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context) ⇒ Client
constructor
A new instance of Client.
- #passed?(branch) ⇒ Boolean
- #state(branch) ⇒ Object
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
.clients ⇒ Object
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 |
.settings ⇒ Object
16 17 18 |
# File 'lib/capistrano/ci/client.rb', line 16 def settings @settings ||= [:ci_client] end |
Instance Method Details
#passed?(branch) ⇒ 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 |