Class: Lotus::Lotusrc Private
- Inherits:
-
Object
- Object
- Lotus::Lotusrc
- Defined in:
- lib/lotus/lotusrc.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Read the .lotusrc file in the root of the application
Constant Summary collapse
- FILE_NAME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Lotusrc name file
'.lotusrc'.freeze
- DEFAULT_ARCHITECTURE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Architecture default value
'container'.freeze
- APP_ARCHITECTURE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Application architecture value
'app'.freeze
- ARCHITECTURE_KEY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Architecture key for writing the lotusrc file
'architecture'.freeze
- DEFAULT_TEST_SUITE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Test suite default value
'minitest'.freeze
- TEST_KEY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Test suite key for writing the lotusrc file
'test'.freeze
- DEFAULT_TEMPLATE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Template default value
'erb'.freeze
- TEMPLATE_KEY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Template key for writing the lotusrc file
'template'.freeze
- DEFAULT_OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Default values for writing the lotusrc file
Utils::Hash.new({ ARCHITECTURE_KEY => DEFAULT_ARCHITECTURE, TEST_KEY => DEFAULT_TEST_SUITE, TEMPLATE_KEY => DEFAULT_TEMPLATE }).symbolize!.freeze
Instance Method Summary collapse
-
#exists? ⇒ Boolean
private
Check if lotusrc file exists.
-
#initialize(root) ⇒ Lotusrc
constructor
private
Initialize Lotusrc class with application’s root and environment options.
-
#options ⇒ Lotus::Utils::Hash
private
Read lotusrc file (if exists) and parse it’s values or return default.
Constructor Details
#initialize(root) ⇒ Lotusrc
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize Lotusrc class with application’s root and environment options.
90 91 92 |
# File 'lib/lotus/lotusrc.rb', line 90 def initialize(root) @root = root end |
Instance Method Details
#exists? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Check if lotusrc file exists
116 117 118 |
# File 'lib/lotus/lotusrc.rb', line 116 def exists? path_file.exist? end |
#options ⇒ Lotus::Utils::Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Read lotusrc file (if exists) and parse it’s values or return default.
106 107 108 |
# File 'lib/lotus/lotusrc.rb', line 106 def @options ||= symbolize(DEFAULT_OPTIONS.merge()) end |