Sha256: 5115bcba0f89662a31f028e4a41cb071e788f85ac7b88fe8b04ce7e1b428ce69

Contents?: true

Size: 747 Bytes

Versions: 17

Compression:

Stored size: 747 Bytes

Contents

module S3Website
  module Cloudfront
    class Invalidator
      def self.invalidate(config, changed_files)
        aws_key = config['s3_id']
        aws_secret = config['s3_secret']
        s3_bucket_name = config['s3_bucket']
        cloudfront_distribution_id = config['cloudfront_distribution_id']
        s3 = AWS::S3.new(
          :access_key_id => aws_key,
          :secret_access_key => aws_secret)
        s3_object_keys = changed_files
        s3_object_keys << ""
        report = SimpleCloudfrontInvalidator::CloudfrontClient.new(
          aws_key, aws_secret, cloudfront_distribution_id).invalidate(
            s3_object_keys)
        puts report[:text_report]
        report[:invalidated_items_count]
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
s3_website-1.3.2 lib/cloudfront/invalidator.rb
s3_website-1.3.1 lib/cloudfront/invalidator.rb
s3_website-1.3.0 lib/cloudfront/invalidator.rb
s3_website-1.2.1 lib/cloudfront/invalidator.rb
s3_website-1.2.0 lib/cloudfront/invalidator.rb
s3_website-1.1.2 lib/cloudfront/invalidator.rb
s3_website-1.1.1 lib/cloudfront/invalidator.rb
s3_website-1.1.0 lib/cloudfront/invalidator.rb
s3_website-1.0.3 lib/cloudfront/invalidator.rb
s3_website-1.0.2 lib/cloudfront/invalidator.rb
s3_website-1.0.1 lib/cloudfront/invalidator.rb
s3_website-1.0.0 lib/cloudfront/invalidator.rb
s3_website-0.4.0 lib/cloudfront/invalidator.rb
s3_website-0.3.0 lib/cloudfront/invalidator.rb
s3_website-0.2.1 lib/cloudfront/invalidator.rb
s3_website-0.2.0 lib/cloudfront/invalidator.rb
s3_website-0.1.0 lib/cloudfront/invalidator.rb