Class: Escort::Setup::Configuration::Loader
- Inherits:
-
Object
- Object
- Escort::Setup::Configuration::Loader
- Defined in:
- lib/escort/setup/configuration/loader.rb
Instance Attribute Summary collapse
-
#auto_options ⇒ Object
readonly
Returns the value of attribute auto_options.
-
#setup ⇒ Object
readonly
Returns the value of attribute setup.
Instance Method Summary collapse
- #configuration ⇒ Object
- #default_config_path ⇒ Object
-
#initialize(setup, auto_options) ⇒ Loader
constructor
A new instance of Loader.
Constructor Details
#initialize(setup, auto_options) ⇒ Loader
Returns a new instance of Loader.
7 8 9 10 |
# File 'lib/escort/setup/configuration/loader.rb', line 7 def initialize(setup, ) @setup = setup @auto_options = end |
Instance Attribute Details
#auto_options ⇒ Object (readonly)
Returns the value of attribute auto_options.
5 6 7 |
# File 'lib/escort/setup/configuration/loader.rb', line 5 def @auto_options end |
#setup ⇒ Object (readonly)
Returns the value of attribute setup.
5 6 7 |
# File 'lib/escort/setup/configuration/loader.rb', line 5 def setup @setup end |
Instance Method Details
#configuration ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/escort/setup/configuration/loader.rb', line 12 def configuration if setup.has_config_file? Writer.new(config_path, Generator.new(setup).default_data).write if setup.config_file_autocreatable? Reader.new(config_path).read else Instance.blank end end |
#default_config_path ⇒ Object
21 22 23 |
# File 'lib/escort/setup/configuration/loader.rb', line 21 def default_config_path @default_config_path ||= (config_filename ? File.join(File.(ENV["HOME"]), config_filename) : nil) end |