class Ey::Core::Cli::EnvironmentVariables
Constants
- MASK
- MAX_LENGTH_TO_DISPLAY
- SYMBOLS_TO_DISPLAY
Public Instance Methods
handle()
click to toggle source
# File lib/ey-core/cli/environment_variables.rb, line 35 def handle environment_variables = if option(:application) core_applications(option(:application)).flat_map(&:environment_variables) elsif option(:environment) core_environments(option(:environment)).flat_map(&:environment_variables) else core_environment_variables end stream_print("ID" => 10, "Name" => 30, "Value" => 50, "Environment" => 30, "Application" => 30) do |printer| environment_variables.each_entry do |ev| printer.print(ev.id, ev.name, print_variable_value(ev), ev.environment_name, ev.application_name) end end end
Private Instance Methods
hide_sensitive_data(value)
click to toggle source
# File lib/ey-core/cli/environment_variables.rb, line 61 def hide_sensitive_data(value) if value.length > SYMBOLS_TO_DISPLAY MASK + value[-SYMBOLS_TO_DISPLAY, SYMBOLS_TO_DISPLAY] else MASK end end
print_variable_value(environment_variable)
click to toggle source
# File lib/ey-core/cli/environment_variables.rb, line 53 def print_variable_value(environment_variable) if environment_variable.sensitive && !switch_active?(:display_sensitive) hide_sensitive_data(environment_variable.value) else environment_variable.value end end