asset_uploader 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,35 @@
1
1
  # AssetUploader
2
2
 
3
- TODO: Write a gem description
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
@@ -2,6 +2,7 @@
2
2
  #require "bundler/gem_tasks"
3
3
 
4
4
  require 'rake/testtask'
5
+ require 'bundler/gem_tasks'
5
6
 
6
7
  Rake::TestTask.new do |t|
7
8
  t.libs << 'test'
@@ -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/, '')
@@ -1,3 +1,3 @@
1
1
  class AssetUploader
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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-11 00:00:00.000000000 Z
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.19
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