Class: Drydock::Config
- Inherits:
-
Object
- Object
- Drydock::Config
- Defined in:
- lib/drydocker.rb
Overview
Configuration file reader
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#entrypoint ⇒ Object
readonly
Returns the value of attribute entrypoint.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(params = {}) ⇒ Config
Returns a new instance of Config.
19 20 21 22 23 24 25 26 27 |
# File 'lib/drydocker.rb', line 19 def initialize(params = {}) config = Config.default_config.merge(params) @name = config[:name] || "#{config[:image]}-test" @entrypoint = config[:entrypoint] @image = config[:image] @command = config[:command] @path = config[:path] @testing = config[:testing] end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
7 8 9 |
# File 'lib/drydocker.rb', line 7 def command @command end |
#entrypoint ⇒ Object (readonly)
Returns the value of attribute entrypoint.
7 8 9 |
# File 'lib/drydocker.rb', line 7 def entrypoint @entrypoint end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
7 8 9 |
# File 'lib/drydocker.rb', line 7 def image @image end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/drydocker.rb', line 7 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/drydocker.rb', line 7 def path @path end |
Class Method Details
.default_config ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/drydocker.rb', line 9 def self.default_config { name: nil, image: 'silarsis/drydocker', command: 'rspec spec', entrypoint: nil, path: `pwd`.strip } end |