Module: Avm::Sources::Base::Configuration
- Defined in:
- lib/avm/sources/base/configuration.rb
Constant Summary collapse
- PARENT_CONFIGURATION_SUFFIX =
%w[subs at].freeze
- CONFIGURATION_FILENAMES =
%w[.avm.yml .avm.yaml].freeze
Instance Method Summary collapse
- #configuration_entry(*entry_args) ⇒ EacConfig::NodeEntry
- #configuration_value_to_env_command(value) ⇒ EacRubyUtils::Envs::Command?
- #configuration_value_to_shell_words(value) ⇒ Array<String>?
-
#read_configuration_as_env_command(key) ⇒ EacRubyUtils::Envs::Command
Utility to read a configuration as a [EacRubyUtils::Envs::Command].
- #read_configuration_as_shell_words(key) ⇒ Array<String>?
Instance Method Details
#configuration_entry(*entry_args) ⇒ EacConfig::NodeEntry
16 17 18 19 20 21 22 23 |
# File 'lib/avm/sources/base/configuration.rb', line 16 def configuration_entry(*entry_args) parent_configuration.if_present do |v| parent_entry = v.entry(*entry_args) return parent_entry if parent_entry.found? end configuration.entry(*entry_args) end |
#configuration_value_to_env_command(value) ⇒ EacRubyUtils::Envs::Command?
26 27 28 |
# File 'lib/avm/sources/base/configuration.rb', line 26 def configuration_value_to_env_command(value) configuration_value_to_shell_words(value).if_present { |v| env.command(v).chdir(path) } end |
#configuration_value_to_shell_words(value) ⇒ Array<String>?
31 32 33 34 35 |
# File 'lib/avm/sources/base/configuration.rb', line 31 def configuration_value_to_shell_words(value) return nil if value.blank? value.is_a?(::Enumerable) ? value.map(&:to_s) : ::Shellwords.split(value.to_s) end |
#read_configuration_as_env_command(key) ⇒ EacRubyUtils::Envs::Command
Utility to read a configuration as a [EacRubyUtils::Envs::Command].
44 45 46 |
# File 'lib/avm/sources/base/configuration.rb', line 44 def read_configuration_as_env_command(key) configuration_value_to_env_command(configuration_entry(key).value) end |
#read_configuration_as_shell_words(key) ⇒ Array<String>?
38 39 40 |
# File 'lib/avm/sources/base/configuration.rb', line 38 def read_configuration_as_shell_words(key) configuration_value_to_shell_words(configuration_entry(key).value) end |