Sha256: d2b461187e40cc94d9fa78e7a1404c7a80b4c0ff051b1877cb28de66c7f9a8a1

Contents?: true

Size: 740 Bytes

Versions: 8

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true

require 'pp'
require 'chamber/commands/base'

module  Chamber
module  Commands
class   Show < Chamber::Commands::Base
  attr_accessor :as_env,
                :only_sensitive

  def initialize(options = {})
    super

    self.as_env         = options[:as_env]
    self.only_sensitive = options[:only_sensitive]
  end

  def call
    if as_env
      settings.to_s(pair_separator: "\n")
    else
      PP.
        pp(settings.to_hash, StringIO.new, 60).
        string.
        chomp
    end
  end

  protected

  def settings
    @settings ||= if only_sensitive
                    chamber.settings.securable
                  else
                    chamber.settings
                  end
  end
end
end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
chamber-2.13.1 lib/chamber/commands/show.rb
chamber-2.13.0 lib/chamber/commands/show.rb
chamber-2.12.5 lib/chamber/commands/show.rb
chamber-2.12.3 lib/chamber/commands/show.rb
chamber-2.12.2 lib/chamber/commands/show.rb
chamber-2.12.1 lib/chamber/commands/show.rb
chamber-2.12.0 lib/chamber/commands/show.rb
chamber-2.11.0 lib/chamber/commands/show.rb