Sha256: fb15f5693434c9421765dc0f8f74a3dcd3f7708083ae5acce358ed960655f8b4

Contents?: true

Size: 753 Bytes

Versions: 3

Compression:

Stored size: 753 Bytes

Contents

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

      buckets.each do |bucket|
        $stderr.puts "Getting lifecycle policy for bucket #{bucket.color(:green)}"

        show = Show.new(bucket: bucket)
        row = [bucket, show.any?]
        if @options[:lifecycle].nil?
          presenter.rows << row # always show policy
        elsif @options[:lifecycle]
          presenter.rows << row if status # only show if bucket has some encryption rules
        else
          presenter.rows << row unless status # 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/lifecycle/list.rb
s3-secure-0.6.1 lib/s3_secure/lifecycle/list.rb
s3-secure-0.6.0 lib/s3_secure/lifecycle/list.rb