rack-gridfs 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.rdoc CHANGED
@@ -1,5 +1,15 @@
1
1
  == CHANGE LOG
2
2
 
3
+ === 0.4.1 / June 26, 2011
4
+
5
+ {full commit log}[https://github.com/skinandbones/rack-gridfs/compare/v0.4.0...v0.4.1]
6
+
7
+ ==== Bug Fixes
8
+
9
+ - URL-decode before filename lookup so that non-ASCII filenames are handled
10
+ correctly (Konstantin Shabanov)
11
+
12
+
3
13
  === 0.4.0 / May 12, 2011
4
14
 
5
15
  Major refactoring and loads of new features! Thanks to {Ben Marini}[https://github.com/bmarini]
data/lib/rack/gridfs.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'mongo'
2
2
  require 'mime/types'
3
+ require 'cgi'
3
4
 
4
5
  module Rack
5
6
  class GridFSConnectionError < StandardError ; end
@@ -61,8 +61,11 @@ module Rack
61
61
 
62
62
  def find_file(id_or_path)
63
63
  case @lookup.to_sym
64
- when :id then Mongo::Grid.new(db).get(BSON::ObjectId.from_string(id_or_path))
65
- when :path then Mongo::GridFileSystem.new(db).open(id_or_path, "r")
64
+ when :id
65
+ Mongo::Grid.new(db).get(BSON::ObjectId.from_string(id_or_path))
66
+ when :path
67
+ path = CGI::unescape(id_or_path)
68
+ Mongo::GridFileSystem.new(db).open(path, "r")
66
69
  end
67
70
  end
68
71
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class GridFS
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-gridfs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Blake Carlson
@@ -15,12 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-13 00:00:00 +07:00
18
+ date: 2011-06-27 00:00:00 +07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- prerelease: false
23
- type: :runtime
24
22
  requirement: &id001 !ruby/object:Gem::Requirement
25
23
  none: false
26
24
  requirements:
@@ -30,11 +28,11 @@ dependencies:
30
28
  segments:
31
29
  - 0
32
30
  version: "0"
33
- version_requirements: *id001
34
- name: rack
35
- - !ruby/object:Gem::Dependency
36
31
  prerelease: false
32
+ name: rack
37
33
  type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
38
36
  requirement: &id002 !ruby/object:Gem::Requirement
39
37
  none: false
40
38
  requirements:
@@ -45,11 +43,11 @@ dependencies:
45
43
  - 1
46
44
  - 2
47
45
  version: "1.2"
48
- version_requirements: *id002
49
- name: mongo
50
- - !ruby/object:Gem::Dependency
51
46
  prerelease: false
47
+ name: mongo
52
48
  type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
53
51
  requirement: &id003 !ruby/object:Gem::Requirement
54
52
  none: false
55
53
  requirements:
@@ -59,11 +57,11 @@ dependencies:
59
57
  segments:
60
58
  - 0
61
59
  version: "0"
62
- version_requirements: *id003
60
+ prerelease: false
63
61
  name: mime-types
62
+ type: :runtime
63
+ version_requirements: *id003
64
64
  - !ruby/object:Gem::Dependency
65
- prerelease: false
66
- type: :development
67
65
  requirement: &id004 !ruby/object:Gem::Requirement
68
66
  none: false
69
67
  requirements:
@@ -75,11 +73,11 @@ dependencies:
75
73
  - 0
76
74
  - 0
77
75
  version: 1.0.0
78
- version_requirements: *id004
79
- name: bundler
80
- - !ruby/object:Gem::Dependency
81
76
  prerelease: false
77
+ name: bundler
82
78
  type: :development
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
83
81
  requirement: &id005 !ruby/object:Gem::Requirement
84
82
  none: false
85
83
  requirements:
@@ -91,11 +89,11 @@ dependencies:
91
89
  - 9
92
90
  - 12
93
91
  version: 0.9.12
94
- version_requirements: *id005
95
- name: mocha
96
- - !ruby/object:Gem::Dependency
97
92
  prerelease: false
93
+ name: mocha
98
94
  type: :development
95
+ version_requirements: *id005
96
+ - !ruby/object:Gem::Dependency
99
97
  requirement: &id006 !ruby/object:Gem::Requirement
100
98
  none: false
101
99
  requirements:
@@ -105,11 +103,11 @@ dependencies:
105
103
  segments:
106
104
  - 0
107
105
  version: "0"
108
- version_requirements: *id006
109
- name: rack-test
110
- - !ruby/object:Gem::Dependency
111
106
  prerelease: false
107
+ name: rack-test
112
108
  type: :development
109
+ version_requirements: *id006
110
+ - !ruby/object:Gem::Dependency
113
111
  requirement: &id007 !ruby/object:Gem::Requirement
114
112
  none: false
115
113
  requirements:
@@ -119,11 +117,11 @@ dependencies:
119
117
  segments:
120
118
  - 0
121
119
  version: "0"
122
- version_requirements: *id007
123
- name: rake
124
- - !ruby/object:Gem::Dependency
125
120
  prerelease: false
121
+ name: rake
126
122
  type: :development
123
+ version_requirements: *id007
124
+ - !ruby/object:Gem::Dependency
127
125
  requirement: &id008 !ruby/object:Gem::Requirement
128
126
  none: false
129
127
  requirements:
@@ -133,8 +131,10 @@ dependencies:
133
131
  segments:
134
132
  - 0
135
133
  version: "0"
136
- version_requirements: *id008
134
+ prerelease: false
137
135
  name: shoulda
136
+ type: :development
137
+ version_requirements: *id008
138
138
  description: Rack middleware for creating HTTP endpoints for files stored in MongoDB's GridFS
139
139
  email:
140
140
  - blake@coin-operated.net