Class: Superhosting::ConfigExecutor::Base
- Inherits:
-
Object
- Object
- Superhosting::ConfigExecutor::Base
- Includes:
- Helpers
- Defined in:
- lib/superhosting/config_executor/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#commands ⇒ Object
Returns the value of attribute commands.
-
#docker_api ⇒ Object
Returns the value of attribute docker_api.
-
#etc ⇒ Object
Returns the value of attribute etc.
-
#lib ⇒ Object
Returns the value of attribute lib.
-
#model ⇒ Object
Returns the value of attribute model.
Instance Method Summary collapse
- #execute(script) ⇒ Object
-
#initialize(model:, lib:, etc:, docker_api:, **kwargs) ⇒ Base
constructor
A new instance of Base.
Methods included from Helpers
Methods included from Helper::Config
#_config, #_config_options, #_save_registry!, #apply, #configure, #configure_with_apply, #reconfig, #unapply, #unconfigure, #unconfigure_with_unapply
Methods included from Helper::Cmd
#_command, #_command_without_debug, #command, #command!
Methods included from Helper::File
#chmod!, #chown!, #chown_r!, #safe_link!, #safe_unlink!
Methods included from Helper::Logger
#__debug, #__dry_run, #__dry_run=, #__logger, #__logger=, #debug, #debug_block, #debug_operation, #indent, #indent=, #indent_reset, #indent_step, #indent_step_back, #info, #storage, #t, #with_dry_run, #with_indent, #with_logger
Constructor Details
#initialize(model:, lib:, etc:, docker_api:, **kwargs) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/superhosting/config_executor/base.rb', line 9 def initialize(model:, lib:, etc:, docker_api:, **kwargs) kwargs.each do |k, v| instance_variable_set("@#{k}", v) self.class.class_eval("attr_accessor :#{k}") end self.commands = [] self.model = model self.lib = lib self.etc = etc self.docker_api = docker_api end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
6 7 8 |
# File 'lib/superhosting/config_executor/base.rb', line 6 def commands @commands end |
#docker_api ⇒ Object
Returns the value of attribute docker_api.
7 8 9 |
# File 'lib/superhosting/config_executor/base.rb', line 7 def docker_api @docker_api end |
#etc ⇒ Object
Returns the value of attribute etc.
7 8 9 |
# File 'lib/superhosting/config_executor/base.rb', line 7 def etc @etc end |
#lib ⇒ Object
Returns the value of attribute lib.
7 8 9 |
# File 'lib/superhosting/config_executor/base.rb', line 7 def lib @lib end |
#model ⇒ Object
Returns the value of attribute model.
7 8 9 |
# File 'lib/superhosting/config_executor/base.rb', line 7 def model @model end |
Instance Method Details
#execute(script) ⇒ Object
22 23 24 |
# File 'lib/superhosting/config_executor/base.rb', line 22 def execute(script) self.instance_eval(script, script.path.to_s) end |