rack_fake_s3 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack_fake_s3 (0.2.0)
4
+ rack_fake_s3 (0.2.1)
5
5
  builder
6
+ mime-types
6
7
  rack
7
8
  thor
8
9
 
@@ -15,7 +16,7 @@ GEM
15
16
  xml-simple
16
17
  builder (3.0.0)
17
18
  mime-types (1.18)
18
- rack (1.4.1)
19
+ rack (1.4.4)
19
20
  rake (0.9.2.2)
20
21
  rest-client (1.6.7)
21
22
  mime-types (>= 1.16)
data/README.md CHANGED
@@ -23,17 +23,21 @@ list, copy, and make bucket are supported. More coming soon.
23
23
 
24
24
  ### Rails (as a mounted rack app)
25
25
 
26
- Add rack_fake_s3 to your Gemfile and bundle
26
+ Add rack_fake_s3 to your Gemfile and bundle
27
27
 
28
- # Gemfile
29
- gem 'rack_fake_s3'
28
+ ```ruby
29
+ # Gemfile
30
+ gem 'rack_fake_s3'
31
+ ```
30
32
 
31
- Mount the app to your routes
33
+ Mount the app to your routes
32
34
 
33
- # config/routes.rb
35
+ ```ruby
36
+ # config/routes.rb
34
37
 
35
- constraints :host => domain do
36
- mount RackFakeS3::App.new(root_path, domain)
37
- end
38
+ constraints :host => domain do
39
+ mount RackFakeS3::App.new(root_path, domain)
40
+ end
41
+ ```
38
42
 
39
- Setup your app to point to the specified domain instead of the real AWS S3.
43
+ Setup your app to point to the specified domain instead of the real AWS S3.
@@ -6,6 +6,7 @@ require 'rack_fake_s3/rate_limitable_file'
6
6
  require 'digest/md5'
7
7
  require 'yaml'
8
8
  require 'uri'
9
+ require 'mime/types'
9
10
 
10
11
  module RackFakeS3
11
12
  class FileStore
@@ -176,7 +177,7 @@ module RackFakeS3
176
177
 
177
178
  metadata_struct = {}
178
179
  metadata_struct[:md5] = md5.hexdigest
179
- metadata_struct[:content_type] = request.media_type || ""
180
+ metadata_struct[:content_type] = MIME::Types.type_for(object_name).first.to_s
180
181
 
181
182
  yaml = YAML::dump(metadata_struct)
182
183
  File.open(metadata,'w') do |f|
@@ -1,3 +1,3 @@
1
1
  module RackFakeS3
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
data/rack_fake_s3.gemspec CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.add_dependency "thor"
21
21
  s.add_dependency "builder"
22
22
  s.add_dependency "rack"
23
+ s.add_dependency 'mime-types'
23
24
 
24
25
  s.files = `git ls-files`.split("\n")
25
26
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack_fake_s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
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-12-20 00:00:00.000000000 Z
12
+ date: 2013-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -139,6 +139,22 @@ dependencies:
139
139
  - - ! '>='
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: mime-types
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :runtime
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
142
158
  description: Test S3 integration locally. Originally created by Curtis Spencer, modified
143
159
  by Mario Visic at Envato.
144
160
  email: