Class: ECSHelper::Command::ExportEnvSecrets

Inherits:
Base
  • Object
show all
Defined in:
lib/ecs_helper/command/export_env_secrets.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #helper, #option_parser, #options, #type

Instance Method Summary collapse

Methods inherited from Base

#application, #check_bin, #initialize, #project, #validate

Methods included from Logging

#console, #error, #log

Constructor Details

This class inherits a constructor from ECSHelper::Command::Base

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



4
5
6
# File 'lib/ecs_helper/command/export_env_secrets.rb', line 4

def params
  @params
end

Instance Method Details

#cmd_option_parserObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/ecs_helper/command/export_env_secrets.rb', line 6

def cmd_option_parser
  options = {
    env_vars: []
  }
  parser = ::OptionParser.new do |opts|
    opts.banner = "Usage: ecs_helper export_env_secrets"
    opts.on('-n', '--name=VARIABLE', '') { |o| options[:env_vars] << o }
  end
  [parser, options]
end

#printable?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/ecs_helper/command/export_env_secrets.rb', line 21

def printable?
  true
end

#requiredObject



17
18
19
# File 'lib/ecs_helper/command/export_env_secrets.rb', line 17

def required
  []
end

#runObject



25
26
27
28
# File 'lib/ecs_helper/command/export_env_secrets.rb', line 25

def run
  return log("No ENV secrets to export. Please pass ENV variables names using -n") if options[:env_vars].empty?
  export_values
end