codders-aws-s3 0.6.2 → 0.6.2.1331721623

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -72,7 +72,7 @@ Assuming the name you chose isn't already taken, your new bucket will now appear
72
72
  Service.buckets
73
73
  # => [#<AWS::S3::Bucket @attributes={"name"=>"jukebox"}>]
74
74
 
75
- Once you have succesfully created a bucket you can you can fetch it by name using Bucket.find.
75
+ Once you have succesfully created a bucket you can fetch it by name using Bucket.find.
76
76
 
77
77
  music_bucket = Bucket.find('jukebox')
78
78
 
@@ -82,7 +82,7 @@ module AWS
82
82
  end
83
83
 
84
84
  def date
85
- request['date'].to_s.strip.empty? ? Time.now : Time.parse(request['date'])
85
+ @date ||= request['date'].to_s.strip.empty? ? Time.now : Time.parse(request['date'])
86
86
  end
87
87
  end
88
88
 
@@ -218,4 +218,4 @@ module AWS
218
218
  end
219
219
  end
220
220
  end
221
- end
221
+ end
@@ -184,7 +184,7 @@ module AWS
184
184
  source_key = path!(bucket, key)
185
185
  default_options = {'x-amz-copy-source' => source_key}
186
186
  target_key = path!(bucket, copy_key)
187
- returning put(target_key, default_options) do
187
+ returning put(target_key, default_options.merge(options)) do
188
188
  acl(copy_key, bucket, acl(key, bucket)) if options[:copy_acl]
189
189
  end
190
190
  end
@@ -4,7 +4,7 @@ module AWS
4
4
  MAJOR = '0'
5
5
  MINOR = '6'
6
6
  TINY = '2'
7
- BETA = nil #Time.now.to_i.to_s
7
+ BETA = Time.now.to_i.to_s
8
8
  end
9
9
 
10
10
  Version = [VERSION::MAJOR, VERSION::MINOR, VERSION::TINY, VERSION::BETA].compact * '.'
@@ -49,6 +49,13 @@ class QueryStringAuthenticationTest < Test::Unit::TestCase
49
49
  query_string = Authentication::QueryString.new(request, key_id, secret, :expires_in => integer_proxy.new(actual_integer))
50
50
  assert_equal actual_integer, query_string.send(:expires_in)
51
51
  end
52
+
53
+ def test_ensure_time_is_only_evaluated_once
54
+ time = Time.now
55
+ flexmock(Time).should_receive(:now).once.and_return(time)
56
+ query_string = Authentication::QueryString.new(request, key_id, secret, :expires_in => 60)
57
+ assert_equal AmazonDocExampleData::Example3.query_string, query_string
58
+ end
52
59
 
53
60
  private
54
61
  def request; AmazonDocExampleData::Example3.request end
@@ -148,6 +148,21 @@ class ObjectTest < Test::Unit::TestCase
148
148
  S3Object.about('asdfasdfasdfas-this-does-not-exist', 'bucket does not matter')
149
149
  end
150
150
  end
151
+ def test_copy_options_are_used
152
+ options = {'x-amz-storage-class' => 'REDUCED_REDUNDANCY'}
153
+ resp = FakeResponse.new
154
+
155
+ connection = flexmock('Mock connection') do |mock|
156
+ mock.should_receive(:request).
157
+ # The storage-class key must be passed to connection.request(:put, ...)
158
+ with(:put, '/some-bucket/new', hsh(options), any, any).
159
+ and_return(resp)
160
+ end
161
+ flexmock(S3Object).should_receive(:connection).and_return(connection)
162
+
163
+ result = S3Object.copy('old', 'new', 'some-bucket', options)
164
+ assert_equal resp.code, result.code
165
+ end
151
166
  end
152
167
 
153
168
  class MetadataTest < Test::Unit::TestCase
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codders-aws-s3
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
4
+ hash: 2663443289
5
+ prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
9
  - 2
10
- version: 0.6.2
10
+ - 1331721623
11
+ version: 0.6.2.1331721623
11
12
  platform: ruby
12
13
  authors:
13
14
  - Marcel Molina Jr.
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2011-08-15 00:00:00 +02:00
19
+ date: 2012-03-14 00:00:00 +01:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
@@ -163,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
164
  requirements: []
164
165
 
165
166
  rubyforge_project: amazon
166
- rubygems_version: 1.6.2
167
+ rubygems_version: 1.3.7
167
168
  signing_key:
168
169
  specification_version: 3
169
170
  summary: Client library for Amazon's Simple Storage Service's REST API