asset_id 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +14 -1
- data/lib/asset_id/asset.rb +1 -0
- data/lib/asset_id/cache.rb +1 -1
- metadata +1 -1
data/README.textile
CHANGED
@@ -35,7 +35,7 @@ and to use the id-stamped asset paths in helpers
|
|
35
35
|
'http://my_bucket.s3.amazonaws.com'
|
36
36
|
end
|
37
37
|
config.action_controller.asset_path = Proc.new do |source|
|
38
|
-
AssetID::
|
38
|
+
AssetID::Asset.fingerprint(source)
|
39
39
|
end
|
40
40
|
</code></pre>
|
41
41
|
|
@@ -73,6 +73,19 @@ If you want to use the SSL host in your configuration you can do so in <code>con
|
|
73
73
|
end
|
74
74
|
</code></pre>
|
75
75
|
|
76
|
+
h2. CSS Images
|
77
|
+
|
78
|
+
By default any relative CSS images that match files on the filesystem are converted to AssetID paths as well.
|
79
|
+
|
80
|
+
For S3, if you don't specify a <code>prefix</code> it will use the <code>http://</code> bucket URL by default. You can override this in <code>config/asset_id.yml</code>. For example if you wanted to use the <code>https://</code> url:
|
81
|
+
|
82
|
+
<pre><code>production:
|
83
|
+
access_key_id: 'MY_ACCESS_KEY'
|
84
|
+
secret_access_key: 'MY_ACCESS_SECRET'
|
85
|
+
bucket: "my_live_bucket"
|
86
|
+
prefix: "https://my_bucket.s3.amazonaws.com"
|
87
|
+
</code></pre>
|
88
|
+
|
76
89
|
h2. Using Amazon CloudFront Content Delivery Network (CDN)
|
77
90
|
|
78
91
|
To use Amazon CloudFront as a CDN for your assets all you need to do is "create a CloudFront distribution":http://docs.amazonwebservices.com/AmazonCloudFront/latest/GettingStartedGuide/ for the bucket you have defined your configuration and then substitute your unique CloudFront domain name in <code>config/environments/production.rb</code>
|
data/lib/asset_id/asset.rb
CHANGED
@@ -111,6 +111,7 @@ module AssetID
|
|
111
111
|
"url(#{uri})"
|
112
112
|
else
|
113
113
|
asset = Asset.new(uri)
|
114
|
+
# TODO: Check the referenced asset is in the asset_paths
|
114
115
|
puts " - Changing CSS URI #{uri} to #{options[:prefix]}#{asset.fingerprint}" if @@debug
|
115
116
|
"url(#{options[:prefix]}#{asset.fingerprint})"
|
116
117
|
end
|
data/lib/asset_id/cache.rb
CHANGED