s3-publisher 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -12,7 +12,6 @@ Basic usage:
12
12
 
13
13
  This will:
14
14
  * push test.txt to my-bucket.s3.amazonaws.com
15
- * use reduced redundancy storage
16
15
  * set security to public-read
17
16
  * gzip contents ('abc1234') and set a Content-Encoding: gzip header so clients know to decompress
18
17
  * set a Cache-Control: max-age=5 header
@@ -30,9 +29,11 @@ In this example:
30
29
  A few miscellaneous notes:
31
30
  * gzip compress is skipped on .jpg/gif/png/tif files
32
31
  * uploads are multi-threaded. You can control worker thread count on instantiation.
32
+ * pass :redundancy => :reduced when instantiating the publisher to write to reduced
33
+ redundancy storage (this used to be the default, but now requires the option to be set.)
33
34
 
34
35
  See class docs for further options.
35
36
 
36
37
  == Copyright
37
38
 
38
- Copyright (c) 2010 Ben Koski. See LICENSE for details.
39
+ Copyright (c) 2011 Ben Koski. See LICENSE for details.
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ begin
12
12
  gem.authors = ["Ben Koski"]
13
13
  gem.add_development_dependency "thoughtbot-shoulda"
14
14
  gem.add_dependency 'aws_credentials'
15
- gem.add_dependency 'right_aws', '=2.0.0'
15
+ gem.add_dependency 'right_aws', '>=3.0.0'
16
16
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
17
  end
18
18
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
data/lib/s3-publisher.rb CHANGED
@@ -1,11 +1,8 @@
1
- require 'rubygems'
1
+ require 'zlib'
2
+ require 'thread'
2
3
 
3
- gem 'right_aws', '=2.0.0'
4
4
  require 'right_aws'
5
-
6
5
  require 'aws_credentials'
7
- require 'zlib'
8
- require 'thread'
9
6
 
10
7
  Thread.abort_on_exception = true
11
8
 
@@ -64,7 +61,7 @@ class S3Publisher
64
61
  headers['Content-Encoding'] = 'gzip'
65
62
  end
66
63
 
67
- headers['x-amz-storage-class'] = opts[:redundancy] == :standard ? 'STANDARD' : 'REDUCED_REDUNDANCY'
64
+ headers['x-amz-storage-class'] = opts[:redundancy] == :reduced ? 'REDUCED_REDUNDANCY' : 'STANDARD'
68
65
  headers['Content-Type'] = parse_content_type(opts[:content_type]) if opts[:content_type]
69
66
 
70
67
  if opts.has_key?(:cache_control)
data/s3-publisher.gemspec CHANGED
@@ -1,59 +1,53 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{s3-publisher}
8
- s.version = "0.4.1"
7
+ s.name = "s3-publisher"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Koski"]
12
- s.date = %q{2010-07-01}
13
- s.description = %q{Publish data to S3 for the world to see}
14
- s.email = %q{gems@benkoski.com}
12
+ s.date = "2011-12-12"
13
+ s.description = "Publish data to S3 for the world to see"
14
+ s.email = "gems@benkoski.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc"
17
+ "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "lib/s3-publisher.rb",
27
- "s3-publisher.gemspec",
28
- "test/s3-publisher_test.rb",
29
- "test/test_helper.rb"
30
- ]
31
- s.homepage = %q{http://github.com/bkoski/s3-publisher}
32
- s.rdoc_options = ["--charset=UTF-8"]
33
- s.require_paths = ["lib"]
34
- s.rubygems_version = %q{1.3.5}
35
- s.summary = %q{Publish data to S3 for the world to see}
36
- s.test_files = [
21
+ "LICENSE",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "lib/s3-publisher.rb",
26
+ "s3-publisher.gemspec",
37
27
  "test/s3-publisher_test.rb",
38
- "test/test_helper.rb"
28
+ "test/test_helper.rb"
39
29
  ]
30
+ s.homepage = "http://github.com/bkoski/s3-publisher"
31
+ s.require_paths = ["lib"]
32
+ s.rubygems_version = "1.8.10"
33
+ s.summary = "Publish data to S3 for the world to see"
40
34
 
41
35
  if s.respond_to? :specification_version then
42
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
43
36
  s.specification_version = 3
44
37
 
45
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
38
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
39
  s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
47
40
  s.add_runtime_dependency(%q<aws_credentials>, [">= 0"])
48
- s.add_runtime_dependency(%q<right_aws>, ["= 2.0.0"])
41
+ s.add_runtime_dependency(%q<right_aws>, [">= 3.0.0"])
49
42
  else
50
43
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
51
44
  s.add_dependency(%q<aws_credentials>, [">= 0"])
52
- s.add_dependency(%q<right_aws>, ["= 2.0.0"])
45
+ s.add_dependency(%q<right_aws>, [">= 3.0.0"])
53
46
  end
54
47
  else
55
48
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
56
49
  s.add_dependency(%q<aws_credentials>, [">= 0"])
57
- s.add_dependency(%q<right_aws>, ["= 2.0.0"])
50
+ s.add_dependency(%q<right_aws>, [">= 3.0.0"])
58
51
  end
59
52
  end
53
+
@@ -43,15 +43,15 @@ class S3PublisherTest < Test::Unit::TestCase
43
43
  end
44
44
 
45
45
  context "redundancy" do
46
- should "set REDUCED_REDUNDANCY by default" do
47
- set_put_expectation(:headers => { 'x-amz-storage-class' => 'REDUCED_REDUNDANCY' })
46
+ should "set STANDARD by default" do
47
+ set_put_expectation(:headers => { 'x-amz-storage-class' => 'STANDARD' })
48
48
  push_test_data('myfile.txt', '1234', {})
49
49
 
50
50
  end
51
51
 
52
- should "set STANDARD if :redundancy => :standard is passed" do
53
- set_put_expectation(:headers => { 'x-amz-storage-class' => 'STANDARD' })
54
- push_test_data('myfile.txt', '1234', :redundancy => :standard)
52
+ should "set REDUCED_REDUNDANCY if :redundancy => :reduced is passed" do
53
+ set_put_expectation(:headers => { 'x-amz-storage-class' => 'REDUCED_REDUNDANCY' })
54
+ push_test_data('myfile.txt', '1234', :redundancy => :reduced)
55
55
  end
56
56
  end
57
57
 
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ hash: 11
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 2
10
+ version: 0.4.2
5
11
  platform: ruby
6
12
  authors:
7
13
  - Ben Koski
@@ -9,39 +15,52 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-07-01 00:00:00 -04:00
13
- default_executable:
18
+ date: 2011-12-12 00:00:00 Z
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: thoughtbot-shoulda
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
20
25
  requirements:
21
26
  - - ">="
22
27
  - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
23
31
  version: "0"
24
- version:
32
+ type: :development
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: aws_credentials
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
30
39
  requirements:
31
40
  - - ">="
32
41
  - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
33
45
  version: "0"
34
- version:
46
+ type: :runtime
47
+ version_requirements: *id002
35
48
  - !ruby/object:Gem::Dependency
36
49
  name: right_aws
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
40
53
  requirements:
41
- - - "="
54
+ - - ">="
42
55
  - !ruby/object:Gem::Version
43
- version: 2.0.0
44
- version:
56
+ hash: 7
57
+ segments:
58
+ - 3
59
+ - 0
60
+ - 0
61
+ version: 3.0.0
62
+ type: :runtime
63
+ version_requirements: *id003
45
64
  description: Publish data to S3 for the world to see
46
65
  email: gems@benkoski.com
47
66
  executables: []
@@ -53,7 +72,6 @@ extra_rdoc_files:
53
72
  - README.rdoc
54
73
  files:
55
74
  - .document
56
- - .gitignore
57
75
  - LICENSE
58
76
  - README.rdoc
59
77
  - Rakefile
@@ -62,34 +80,38 @@ files:
62
80
  - s3-publisher.gemspec
63
81
  - test/s3-publisher_test.rb
64
82
  - test/test_helper.rb
65
- has_rdoc: true
66
83
  homepage: http://github.com/bkoski/s3-publisher
67
84
  licenses: []
68
85
 
69
86
  post_install_message:
70
- rdoc_options:
71
- - --charset=UTF-8
87
+ rdoc_options: []
88
+
72
89
  require_paths:
73
90
  - lib
74
91
  required_ruby_version: !ruby/object:Gem::Requirement
92
+ none: false
75
93
  requirements:
76
94
  - - ">="
77
95
  - !ruby/object:Gem::Version
96
+ hash: 3
97
+ segments:
98
+ - 0
78
99
  version: "0"
79
- version:
80
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
+ none: false
81
102
  requirements:
82
103
  - - ">="
83
104
  - !ruby/object:Gem::Version
105
+ hash: 3
106
+ segments:
107
+ - 0
84
108
  version: "0"
85
- version:
86
109
  requirements: []
87
110
 
88
111
  rubyforge_project:
89
- rubygems_version: 1.3.5
112
+ rubygems_version: 1.8.10
90
113
  signing_key:
91
114
  specification_version: 3
92
115
  summary: Publish data to S3 for the world to see
93
- test_files:
94
- - test/s3-publisher_test.rb
95
- - test/test_helper.rb
116
+ test_files: []
117
+
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
- rdoc
5
- pkg