asset_uploader 0.0.2 → 0.0.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.
- data/README.md +29 -1
- data/Rakefile +1 -0
- data/lib/asset_uploader.rb +1 -1
- data/lib/asset_uploader/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -1,7 +1,35 @@
|
|
1
1
|
# AssetUploader
|
2
2
|
|
3
|
-
|
3
|
+
Usage:
|
4
4
|
|
5
|
+
asset_uploader [ --no-upload | --no-sign ] target_prefix asset asset...
|
6
|
+
|
7
|
+
Takes the files (or files under directories) named by asset... and uploads them
|
8
|
+
to S3, renaming each file to include a checksum. Prints the path for each
|
9
|
+
file uploaded.
|
10
|
+
|
11
|
+
The target_prefix specifies where the file is stored on S3.
|
12
|
+
|
13
|
+
The --no-upload option prints the path but does not upload
|
14
|
+
|
15
|
+
The --no-sign option uploads the file with no checksum. Files uploaded with
|
16
|
+
no checksum will be hard to change, as the caching front end won't know they
|
17
|
+
have changed
|
18
|
+
|
19
|
+
You need to set the S3 credentials in your environment
|
20
|
+
|
21
|
+
export AU_ACCESS_KEY_ID=...
|
22
|
+
export SECRET_ACCESS_KEY=...
|
23
|
+
export AU_BUCKET_NAME=...
|
24
|
+
|
25
|
+
The default bucket name for assets is a-origin.pragprog.com
|
26
|
+
|
27
|
+
Examples
|
28
|
+
|
29
|
+
asset_uploader magazines/2012-06/images images
|
30
|
+
|
31
|
+
asset_uploader --no-sign newsletter/2012-06-04 newsletter.html
|
32
|
+
|
5
33
|
## Installation
|
6
34
|
|
7
35
|
Add this line to your application's Gemfile:
|
data/Rakefile
CHANGED
data/lib/asset_uploader.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "asset_uploader/version"
|
2
|
-
require "asset_uploader/uploader"
|
3
2
|
|
4
3
|
require 'digest/sha1'
|
5
4
|
|
@@ -28,6 +27,7 @@ class AssetUploader
|
|
28
27
|
end
|
29
28
|
|
30
29
|
def upload
|
30
|
+
require "asset_uploader/uploader" # Defer because we don't need S3 keys just to sign
|
31
31
|
uploader = Uploader.new
|
32
32
|
path = uploader.do_upload(target_path, @path_to_asset)
|
33
33
|
path.sub(/s3.amazonaws.com\//, '').sub(/\?AWS.*/, '').sub(/-origin/, '')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asset_uploader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-14 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Support uploading of checksummed assets to S3
|
15
15
|
email:
|
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
50
|
version: '0'
|
51
51
|
requirements: []
|
52
52
|
rubyforge_project:
|
53
|
-
rubygems_version: 1.8.
|
53
|
+
rubygems_version: 1.8.21
|
54
54
|
signing_key:
|
55
55
|
specification_version: 3
|
56
56
|
summary: Support uploading of checksummed assets to S3
|