cloudfront-invalidator 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/cloudfront-invalidator.rb +5 -3
  2. metadata +4 -4
@@ -9,7 +9,9 @@ class CloudfrontInvalidator
9
9
  end
10
10
 
11
11
  def invalidate(*keys)
12
- keys = Array[keys]
12
+ keys.flatten!.map! do |k|
13
+ k.start_with?('/') ? k : '/' + k
14
+ end
13
15
 
14
16
  uri = URI.parse "https://cloudfront.amazonaws.com/2010-11-01/distribution/#{@cf_dist_id}/invalidation"
15
17
  http = Net::HTTP.new(uri.host, uri.port)
@@ -25,8 +27,8 @@ class CloudfrontInvalidator
25
27
  xml = <<XML
26
28
  <?xml version="1.0" encoding="UTF-8"?>
27
29
  <InvalidationBatch>
28
- #{keys.map{|k| "<Path>#{k}</Path>" }.join("\n")}
29
- <CallerReference>CloudFrontInvalidator at #{Time.now}</CallerReference>"
30
+ #{keys.map{|k| "<Path>#{k}</Path>" }.join("\n ")}
31
+ <CallerReference>CloudfrontInvalidator at #{Time.now}</CallerReference>"
30
32
  </InvalidationBatch>
31
33
  XML
32
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudfront-invalidator
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-15 00:00:00.000000000Z
12
+ date: 2011-06-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-hmac
16
- requirement: &774800 !ruby/object:Gem::Requirement
16
+ requirement: &987770 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *774800
24
+ version_requirements: *987770
25
25
  description:
26
26
  email: reid.lynch@gmail.com
27
27
  executables: []