Module: Bashly::Script::Introspection::EnvironmentVariables
- Included in:
- Command
- Defined in:
- lib/bashly/script/introspection/environment_variables.rb
Instance Method Summary collapse
-
#default_environment_variables ⇒ Object
Returns an array of all the Environment Variables with default values.
-
#environment_variables ⇒ Object
Returns an array of EnvironmentVariable objects.
-
#public_environment_variables ⇒ Object
Returns only environment variables that are not private.
-
#required_environment_variables ⇒ Object
Returns an array of all the required EnvironmentVariables.
-
#validated_environment_variables ⇒ Object
Returns an array of all the environment_variables with a validation.
-
#visible_environment_variables ⇒ Object
Returns only public environment variables, or both public and private environment variables if Settings.private_reveal_key is set.
-
#whitelisted_environment_variables ⇒ Object
Returns an array of all the environment_variables with a whitelist arg.
Instance Method Details
#default_environment_variables ⇒ Object
Returns an array of all the Environment Variables with default values
6 7 8 |
# File 'lib/bashly/script/introspection/environment_variables.rb', line 6 def default_environment_variables environment_variables.select(&:default) end |
#environment_variables ⇒ Object
Returns an array of EnvironmentVariable objects
11 12 13 14 15 16 17 |
# File 'lib/bashly/script/introspection/environment_variables.rb', line 11 def environment_variables return [] unless ['environment_variables'] ['environment_variables'].map do || EnvironmentVariable.new end end |
#public_environment_variables ⇒ Object
Returns only environment variables that are not private
20 21 22 |
# File 'lib/bashly/script/introspection/environment_variables.rb', line 20 def public_environment_variables environment_variables.reject(&:private) end |
#required_environment_variables ⇒ Object
Returns an array of all the required EnvironmentVariables
25 26 27 |
# File 'lib/bashly/script/introspection/environment_variables.rb', line 25 def required_environment_variables environment_variables.select(&:required) end |
#validated_environment_variables ⇒ Object
Returns an array of all the environment_variables with a validation
30 31 32 |
# File 'lib/bashly/script/introspection/environment_variables.rb', line 30 def validated_environment_variables environment_variables.select(&:validate) end |
#visible_environment_variables ⇒ Object
Returns only public environment variables, or both public and private environment variables if Settings.private_reveal_key is set
36 37 38 |
# File 'lib/bashly/script/introspection/environment_variables.rb', line 36 def visible_environment_variables Settings.private_reveal_key ? environment_variables : public_environment_variables end |
#whitelisted_environment_variables ⇒ Object
Returns an array of all the environment_variables with a whitelist arg
41 42 43 |
# File 'lib/bashly/script/introspection/environment_variables.rb', line 41 def whitelisted_environment_variables environment_variables.select(&:allowed) end |