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
api, api=, assert_empty, command, command_impl_for_list, command_options_for_list, context_option, current_user, display, display_members, has_admin?, hide_docs, highline, integer?, method_missing, prompt_for_password, read_till_eof, require_arg, validate_privileges
Methods included from IdentifierManipulation
#full_resource_id, #get_kind_and_id_from_args
Class Method Details
.common_parameters(c) ⇒ Object
self.prefix = :env
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/conjur/command/env.rb', line 28 def self.common_parameters c c.desc "Environment configuration file" c.arg_name "FILE" c.default_value ".conjurenv" c.flag ["c"] c.desc "Environment configuration as inline yaml" c.flag ["yaml"] c.desc "Policy id to substitute for $policy in the YAML values" c.flag ["policy"] end |
.get_env_object(options) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/conjur/command/env.rb', line 41 def self.get_env_object require 'conjur/conjurenv' if [:yaml] and [:c]!='.conjurenv' exit_now! "Options -c and --yaml can not be provided together" end = if [:yaml] { yaml: [:yaml]} else { file: ([:c]||'.conjurenv') } end [:substitutions] = { "$policy" => [:policy] } if [:policy] Conjur::Env.new end |