Class: Jets::CLI::Dotenv::List
- Defined in:
- lib/jets/cli/dotenv/list.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#initialize, #paginate, #paging_params, rescue_api_error
Methods included from Util::Logging
Methods included from AwsServices
#apigateway, #aws_options, #cfn, #codebuild, #dynamodb, #lambda_client, #logs, #s3, #s3_resource, #sns, #sqs, #ssm, #sts, #wafv2
Methods included from AwsServices::StackStatus
Methods included from AwsServices::GlobalMemoist
Methods included from Api
Constructor Details
This class inherits a constructor from Jets::CLI::Base
Instance Method Details
#inspect?(value) ⇒ Boolean
28 29 30 |
# File 'lib/jets/cli/dotenv/list.rb', line 28 def inspect?(value) value.include?("\n") || Shellwords.escape(value) != value end |
#run ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jets/cli/dotenv/list.rb', line 5 def run presenter = CliFormat::Presenter.new(@options) warn "# Env from config/jets/env files and SSM parameters" warn "# Values are not used locally. They are only used for the Lambda Function" unless @options[:reveal] warn "# To show values also, use the --reveal option" end presenter. = "# No env vars found" unless @options[:format] == "dotenv" header = ["Name"] header << "Value" if @options[:reveal] presenter.header = header end vars = Jets::Dotenv.parse vars.each do |key, value| v = inspect?(value) ? value.inspect : value row = [key] row << v if @options[:reveal] presenter.rows << row end presenter.show end |