Class: Deploy::Configuration
- Inherits:
-
Object
- Object
- Deploy::Configuration
- Defined in:
- lib/deploy/configuration.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#project ⇒ Object
Returns the value of attribute project.
-
#username ⇒ Object
Returns the value of attribute username.
- #websocket_hostname ⇒ Object
Class Method Summary collapse
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
6 7 8 |
# File 'lib/deploy/configuration.rb', line 6 def account @account end |
#api_key ⇒ Object
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/deploy/configuration.rb', line 8 def api_key @api_key end |
#project ⇒ Object
Returns the value of attribute project.
9 10 11 |
# File 'lib/deploy/configuration.rb', line 9 def project @project end |
#username ⇒ Object
Returns the value of attribute username.
7 8 9 |
# File 'lib/deploy/configuration.rb', line 7 def username @username end |
#websocket_hostname ⇒ Object
12 13 14 |
# File 'lib/deploy/configuration.rb', line 12 def websocket_hostname @websocket_hostname || 'wss://websocket.deployhq.com' end |
Class Method Details
.from_file(path) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/deploy/configuration.rb', line 16 def self.from_file(path) file_contents = File.read(path) parsed_contents = JSON.parse(file_contents) new.tap do |config| config.account = parsed_contents['account'] config.username = parsed_contents['username'] config.api_key = parsed_contents['api_key'] config.project = parsed_contents['project'] config.websocket_hostname = parsed_contents['websocket_hostname'] end end |