asset_sync 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ require "asset_sync/version"
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "asset_sync"
8
8
  s.version = AssetSync::VERSION
9
- s.date = "2013-01-07"
9
+ s.date = "2013-01-08"
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = ["Simon Hamilton", "David Rice", "Phil McClure"]
12
12
  s.email = ["shamilton@rumblelabs.com", "me@davidjrice.co.uk", "pmcclure@rumblelabs.com"]
@@ -144,7 +144,11 @@ module AssetSync
144
144
  if !config.gzip? && File.extname(f) == ".gz"
145
145
  # set content encoding for gzipped files this allows cloudfront to properly handle requests with Accept-Encoding
146
146
  # http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html
147
+ uncompressed_filename = f[0..-4]
148
+ ext = File.extname(uncompressed_filename)[1..-1]
149
+ mime = Mime::Type.lookup_by_extension( ext )
147
150
  file.merge!({
151
+ :content_type => mime,
148
152
  :content_encoding => 'gzip'
149
153
  })
150
154
  end
@@ -1,3 +1,3 @@
1
1
  module AssetSync
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
@@ -33,6 +33,13 @@ describe "AssetSync" do
33
33
  it "sync" do
34
34
  execute "rake ASSET_SYNC_PREFIX=#{@prefix} assets:precompile"
35
35
  bucket(@prefix).files.size.should == 5
36
+
37
+ app_js = bucket(@prefix).files.get("#{@prefix}/application.js")
38
+ app_js.content_type.should == "text/javascript"
39
+
40
+ app_js_gz = bucket(@prefix).files.get("#{@prefix}/application.js.gz")
41
+ app_js_gz.content_type.should == "text/javascript"
42
+ app_js_gz.content_encoding.should == "gzip"
36
43
  end
37
44
 
38
45
  it "sync with enabled=false" do
@@ -43,6 +50,9 @@ describe "AssetSync" do
43
50
  it "sync with gzip_compression=true" do
44
51
  execute "rake ASSET_SYNC_PREFIX=#{@prefix} ASSET_SYNC_GZIP_COMPRESSION=true assets:precompile"
45
52
  bucket(@prefix).files.size.should == 3
53
+
54
+ app_js = bucket(@prefix).files.get("#{@prefix}/application.js")
55
+ app_js.content_type.should == "text/javascript"
46
56
  end
47
57
 
48
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asset_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-01-07 00:00:00.000000000 Z
14
+ date: 2013-01-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fog
@@ -196,7 +196,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
196
196
  version: '0'
197
197
  segments:
198
198
  - 0
199
- hash: -3032835724923262885
199
+ hash: 3874412606411759569
200
200
  required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  none: false
202
202
  requirements:
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  version: '0'
206
206
  segments:
207
207
  - 0
208
- hash: -3032835724923262885
208
+ hash: 3874412606411759569
209
209
  requirements: []
210
210
  rubyforge_project: asset_sync
211
211
  rubygems_version: 1.8.24