rack-mogilefs 0.3.0 → 0.3.1
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/Gemfile.lock +4 -6
- data/HISTORY.md +3 -0
- data/README.md +27 -0
- data/lib/rack/mogilefs/version.rb +1 -1
- data/rack-mogilefs.gemspec +1 -2
- metadata +5 -6
- data/release.rb +0 -6
data/Gemfile.lock
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rack-mogilefs (0.3.
|
4
|
+
rack-mogilefs (0.3.1)
|
5
5
|
mogilefs-client (~> 2.1.0)
|
6
|
-
rack (
|
6
|
+
rack (>= 1.1.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
mocha (0.9.
|
11
|
+
mocha (0.9.10)
|
12
12
|
rake
|
13
13
|
mogilefs-client (2.1.0)
|
14
|
-
rack (1.1
|
14
|
+
rack (1.2.1)
|
15
15
|
rake (0.8.7)
|
16
16
|
|
17
17
|
PLATFORMS
|
@@ -19,6 +19,4 @@ PLATFORMS
|
|
19
19
|
|
20
20
|
DEPENDENCIES
|
21
21
|
mocha
|
22
|
-
mogilefs-client (~> 2.1.0)
|
23
|
-
rack (~> 1.1.0)
|
24
22
|
rack-mogilefs!
|
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -51,6 +51,33 @@ you can provide a mapper proc (or anything that responds to call) like this:
|
|
51
51
|
|
52
52
|
## Configuration
|
53
53
|
|
54
|
+
### Endpoint configuration
|
55
|
+
|
56
|
+
Here is an example of a fully customized `Rack::MogileFS::Endpoint`. Read the
|
57
|
+
source for more documentation.
|
58
|
+
|
59
|
+
Using the expires option is recommended, other options probably aren't needed.
|
60
|
+
|
61
|
+
Rack::MogileFS::Endpoint.new(
|
62
|
+
:default_content_type => "image/png",
|
63
|
+
:expires => 1.month, # or pass a proc...
|
64
|
+
:expires => lambda { |path, ext, mime| if mime == "images/png" ? 600 : 300 },
|
65
|
+
:client => MyMogileClient.new,
|
66
|
+
:mapper => lambda { |path| "/namespace/" + path },
|
67
|
+
:strategy => :reproxy,
|
68
|
+
:debug => false
|
69
|
+
)
|
70
|
+
|
71
|
+
Here is how I usually use it in development:
|
72
|
+
|
73
|
+
Rack::MogileFS::Endpoint.new(:expires => 1.month, :debug => true)
|
74
|
+
|
75
|
+
And production:
|
76
|
+
|
77
|
+
Rack::MogileFS::Endpoint.new(:expires => 1.month)
|
78
|
+
|
79
|
+
### Client Configuration
|
80
|
+
|
54
81
|
If `Rack::MogileFS` detects it is inside a Rails app, it will look for a yaml
|
55
82
|
config in `config/mogilefs.yml` that looks like this:
|
56
83
|
|
data/rack-mogilefs.gemspec
CHANGED
@@ -7,7 +7,6 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Rack::MogileFS::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
|
10
|
-
s.date = "2010-09-10"
|
11
10
|
s.summary = "A rack middleware and/or endpoint to serve up files from MogileFS"
|
12
11
|
s.email = "bmarini@gmail.com"
|
13
12
|
s.homepage = "http://github.com/bmarini/rack-mogilefs"
|
@@ -17,7 +16,7 @@ Gem::Specification.new do |s|
|
|
17
16
|
s.rubyforge_project = "rack-mogilefs"
|
18
17
|
|
19
18
|
s.add_dependency "mogilefs-client", "~> 2.1.0"
|
20
|
-
s.add_dependency "rack", "
|
19
|
+
s.add_dependency "rack", ">= 1.1.0"
|
21
20
|
s.add_development_dependency "mocha"
|
22
21
|
|
23
22
|
s.files = `git ls-files`.split("\n")
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-mogilefs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ben Marini
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-24 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
hash: 19
|
46
46
|
segments:
|
@@ -90,7 +90,6 @@ files:
|
|
90
90
|
- lib/rack/mogilefs/endpoint/rescues.rb
|
91
91
|
- lib/rack/mogilefs/version.rb
|
92
92
|
- rack-mogilefs.gemspec
|
93
|
-
- release.rb
|
94
93
|
- test/caching_test.rb
|
95
94
|
- test/content_type_test.rb
|
96
95
|
- test/mapper_test.rb
|