Class: Conjur::Command::Env
- Inherits:
-
Conjur::Command
- Object
- Conjur::Command
- Conjur::Command::Env
- Defined in:
- lib/conjur/command/env.rb
Class Method Summary collapse
-
.common_parameters(c) ⇒ Object
self.prefix = :env.
- .get_env_object(options) ⇒ Object
Methods inherited from Conjur::Command
acting_as_option, api, command, command_impl_for_list, command_options_for_list, display, display_members, hide_docs, method_missing, require_arg, retire_resource, retire_role
Methods included from IdentifierManipulation
#conjur_account, #full_resource_id, #get_kind_and_id_from_args
Class Method Details
.common_parameters(c) ⇒ Object
self.prefix = :env
31 32 33 34 35 36 37 38 |
# File 'lib/conjur/command/env.rb', line 31 def self.common_parameters c c.desc "Environment configuration file" c.default_value ".conjurenv" c.flag ["c"] c.desc "Environment configuration as inline yaml" c.flag ["yaml"] end |
.get_env_object(options) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/conjur/command/env.rb', line 40 def self.get_env_object if [:yaml] and [:c]!='.conjurenv' exit_now! "Options -c and --yaml can not be provided together" end env = if [:yaml] Conjur::Env.new(yaml: [:yaml]) else Conjur::Env.new(file: ([:c]||'.conjurenv')) end return env end |