Sha256: 2a92a8110dc3f08bb641614ed17ba8db919dafb51499c1046a97b4b4cd8a56c9

Contents?: true

Size: 520 Bytes

Versions: 6

Compression:

Stored size: 520 Bytes

Contents

module Credman
  class Get < Credman::Base
    def perform(keys)
      abort pastel.red("At least one key required") if keys.empty?

      keys_with_path = keys.index_with { |key| key.split(".").map(&:to_sym) }

      configs.each do |env, config|
        puts pastel.green("#{env}:")

        keys_with_path.each do |full_key, key_path|
          value = config_has_keys?(config, key_path) ? configs[env].dig(*key_path) : "not set"
          print_key_and_value(full_key, value)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
credman-0.0.7 lib/credman/get.rb
credman-0.0.6 lib/credman/get.rb
credman-0.0.5 lib/credman/get.rb
credman-0.0.4 lib/credman/get.rb
credman-0.0.3 lib/credman/get.rb
credman-0.0.2.pre.alpha lib/credman/get.rb