Sha256: 4e421f425f5d776a9f9d21830c37ca50fb6eea966a1dcd5e336b1d66c5ecc68f

Contents?: true

Size: 763 Bytes

Versions: 3

Compression:

Stored size: 763 Bytes

Contents

module S3Secure::Encryption
  class List < Base
    def run
      presenter = CliFormat::Presenter.new(@options)
      presenter.header = ["Bucket", "Has Encryption?"]

      buckets.each do |bucket|
        $stderr.puts "Getting encryption for bucket #{bucket.color(:green)}"
        show = Show.new(bucket: bucket)

        row = [bucket, show.enabled?]
        if @options[:encryption].nil?
          presenter.rows << row # always show policy
        elsif @options[:encryption]
          presenter.rows << row if show.enabled? # only show if bucket has some encryption rules
        else
          presenter.rows << row unless show.enabled? # only show if bucket doesnt have any encryption rules
        end
      end

      presenter.show
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
s3-secure-0.7.0 lib/s3_secure/encryption/list.rb
s3-secure-0.6.1 lib/s3_secure/encryption/list.rb
s3-secure-0.6.0 lib/s3_secure/encryption/list.rb