dragonfly 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of dragonfly might be problematic. Click here for more details.
- data/History.md +22 -2
- data/README.md +1 -1
- data/Rakefile +0 -1
- data/VERSION +1 -1
- data/dragonfly.gemspec +6 -5
- data/extra_docs/Generators.md +1 -1
- data/extra_docs/Rails2.md +2 -2
- data/extra_docs/Rails3.md +1 -1
- data/lib/dragonfly/cookie_monster.rb +15 -0
- data/lib/dragonfly/railtie.rb +10 -0
- data/lib/dragonfly/response.rb +2 -0
- data/lib/dragonfly.rb +2 -0
- data/spec/dragonfly/cookie_monster_spec.rb +27 -0
- data/spec/dragonfly/job_endpoint_spec.rb +27 -0
- metadata +7 -14
data/History.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
0.9.2 (2011-05-19)
|
2
|
+
==================
|
3
|
+
Features
|
4
|
+
--------
|
5
|
+
- Added env['dragonfly.job'] for use in other Rack middlewares
|
6
|
+
- Added CookieMonster middleware for removing 'Set-Cookie' headers
|
7
|
+
|
8
|
+
Fixes
|
9
|
+
-----
|
10
|
+
- Remove 'Set-Cookie' header from any requests coming from a rails route
|
11
|
+
|
1
12
|
0.9.1 (2011-05-11)
|
2
13
|
==================
|
3
14
|
Features
|
@@ -8,6 +19,8 @@ Fixes
|
|
8
19
|
-----
|
9
20
|
- Improved performance of `resize_and_crop` method, using imagemagick built-in '^' operator
|
10
21
|
- Improved server security validations
|
22
|
+
- Deal with Excon::Errors::SocketError: EOFError errors which get thrown sometimes from S3 connection
|
23
|
+
- Allow files with '..' (but not '../') in the middle of their name in file data store
|
11
24
|
|
12
25
|
0.9.0 (2011-04-27)
|
13
26
|
==================
|
@@ -60,13 +73,20 @@ Fixes
|
|
60
73
|
-----
|
61
74
|
- Performance tweaks regarding temp_objects model accessors and job objects
|
62
75
|
|
63
|
-
0.8.
|
76
|
+
0.8.5 (2011-05-11)
|
77
|
+
==================
|
78
|
+
Fixes
|
79
|
+
-----
|
80
|
+
- Allow filenames that have '..' in them (but not '../') in the filedatastore
|
81
|
+
- Better security for server
|
82
|
+
|
83
|
+
0.8.4 (2011-04-27)
|
64
84
|
==================
|
65
85
|
Fixes
|
66
86
|
-----
|
67
87
|
- Security fix for file data store
|
68
88
|
|
69
|
-
0.8.2 (
|
89
|
+
0.8.2 (2011-01-11)
|
70
90
|
==================
|
71
91
|
Fixes
|
72
92
|
-----
|
data/README.md
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.2
|
data/dragonfly.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dragonfly}
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mark Evans"]
|
12
|
-
s.date = %q{2011-05-
|
12
|
+
s.date = %q{2011-05-19}
|
13
13
|
s.description = %q{Dragonfly is a framework that enables on-the-fly processing for any content type.
|
14
14
|
It is especially suited to image handling. Its uses range from image thumbnails to standard attachments to on-demand text generation.}
|
15
15
|
s.email = %q{mark@new-bamboo.co.uk}
|
@@ -85,6 +85,7 @@ Gem::Specification.new do |s|
|
|
85
85
|
"lib/dragonfly/config/image_magick.rb",
|
86
86
|
"lib/dragonfly/config/rails.rb",
|
87
87
|
"lib/dragonfly/configurable.rb",
|
88
|
+
"lib/dragonfly/cookie_monster.rb",
|
88
89
|
"lib/dragonfly/core_ext/array.rb",
|
89
90
|
"lib/dragonfly/core_ext/hash.rb",
|
90
91
|
"lib/dragonfly/core_ext/object.rb",
|
@@ -117,6 +118,7 @@ Gem::Specification.new do |s|
|
|
117
118
|
"lib/dragonfly/processing/image_magick_processor.rb",
|
118
119
|
"lib/dragonfly/processor.rb",
|
119
120
|
"lib/dragonfly/rails/images.rb",
|
121
|
+
"lib/dragonfly/railtie.rb",
|
120
122
|
"lib/dragonfly/response.rb",
|
121
123
|
"lib/dragonfly/routed_endpoint.rb",
|
122
124
|
"lib/dragonfly/serializer.rb",
|
@@ -135,6 +137,7 @@ Gem::Specification.new do |s|
|
|
135
137
|
"spec/dragonfly/analysis/file_command_analyser_spec.rb",
|
136
138
|
"spec/dragonfly/app_spec.rb",
|
137
139
|
"spec/dragonfly/configurable_spec.rb",
|
140
|
+
"spec/dragonfly/cookie_monster_spec.rb",
|
138
141
|
"spec/dragonfly/core_ext/array_spec.rb",
|
139
142
|
"spec/dragonfly/core_ext/hash_spec.rb",
|
140
143
|
"spec/dragonfly/core_ext/string_spec.rb",
|
@@ -192,6 +195,7 @@ Gem::Specification.new do |s|
|
|
192
195
|
"spec/dragonfly/analysis/file_command_analyser_spec.rb",
|
193
196
|
"spec/dragonfly/app_spec.rb",
|
194
197
|
"spec/dragonfly/configurable_spec.rb",
|
198
|
+
"spec/dragonfly/cookie_monster_spec.rb",
|
195
199
|
"spec/dragonfly/core_ext/array_spec.rb",
|
196
200
|
"spec/dragonfly/core_ext/hash_spec.rb",
|
197
201
|
"spec/dragonfly/core_ext/string_spec.rb",
|
@@ -253,7 +257,6 @@ Gem::Specification.new do |s|
|
|
253
257
|
s.add_development_dependency(%q<bluecloth>, [">= 0"])
|
254
258
|
s.add_development_dependency(%q<bson_ext>, [">= 0"])
|
255
259
|
s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
|
256
|
-
s.add_runtime_dependency(%q<rack>, [">= 0"])
|
257
260
|
else
|
258
261
|
s.add_dependency(%q<rack>, [">= 0"])
|
259
262
|
s.add_dependency(%q<capybara>, [">= 0"])
|
@@ -273,7 +276,6 @@ Gem::Specification.new do |s|
|
|
273
276
|
s.add_dependency(%q<bluecloth>, [">= 0"])
|
274
277
|
s.add_dependency(%q<bson_ext>, [">= 0"])
|
275
278
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
276
|
-
s.add_dependency(%q<rack>, [">= 0"])
|
277
279
|
end
|
278
280
|
else
|
279
281
|
s.add_dependency(%q<rack>, [">= 0"])
|
@@ -294,7 +296,6 @@ Gem::Specification.new do |s|
|
|
294
296
|
s.add_dependency(%q<bluecloth>, [">= 0"])
|
295
297
|
s.add_dependency(%q<bson_ext>, [">= 0"])
|
296
298
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
297
|
-
s.add_dependency(%q<rack>, [">= 0"])
|
298
299
|
end
|
299
300
|
end
|
300
301
|
|
data/extra_docs/Generators.md
CHANGED
data/extra_docs/Rails2.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Using With Rails 2.3
|
2
2
|
====================
|
3
3
|
|
4
|
-
**NOTE: RAILS 2.3 IS NOT SUPPORTED IN NEW VERSIONS OF DRAGONFLY SO PLEASE USE VERSION 0.8.
|
4
|
+
**NOTE: RAILS 2.3 IS NOT SUPPORTED IN NEW VERSIONS OF DRAGONFLY SO PLEASE USE VERSION 0.8.5**
|
5
5
|
|
6
6
|
Setting up the quick way
|
7
7
|
------------------------
|
@@ -36,7 +36,7 @@ Gems
|
|
36
36
|
----
|
37
37
|
environment.rb
|
38
38
|
|
39
|
-
config.gem 'dragonfly', '0.8.
|
39
|
+
config.gem 'dragonfly', '0.8.5'
|
40
40
|
config.gem 'rack-cache', :lib => 'rack/cache'
|
41
41
|
|
42
42
|
Capistrano
|
data/extra_docs/Rails3.md
CHANGED
data/lib/dragonfly/response.rb
CHANGED
@@ -19,9 +19,11 @@ module Dragonfly
|
|
19
19
|
[304, cache_headers, []]
|
20
20
|
elsif request.head?
|
21
21
|
job.apply
|
22
|
+
env['dragonfly.job'] = job
|
22
23
|
[200, success_headers, []]
|
23
24
|
elsif request.get?
|
24
25
|
job.apply
|
26
|
+
env['dragonfly.job'] = job
|
25
27
|
[200, success_headers, job.result]
|
26
28
|
end
|
27
29
|
rescue DataStorage::DataNotFound, DataStorage::BadUID => e
|
data/lib/dragonfly.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'rack'
|
3
|
+
|
4
|
+
describe Dragonfly::CookieMonster do
|
5
|
+
|
6
|
+
def app(extra_env={})
|
7
|
+
Rack::Builder.new do
|
8
|
+
use Dragonfly::CookieMonster
|
9
|
+
run proc{|env| env.merge!(extra_env); [200, {"Set-Cookie" => "blah", "Something" => "else"}, ["body here"]] }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should not delete the set-cookie header from the response if the response doesn't come from dragonfly" do
|
14
|
+
response = Rack::MockRequest.new(app).get('')
|
15
|
+
response.status.should == 200
|
16
|
+
response.body.should == "body here"
|
17
|
+
response.headers.should == {"Set-Cookie" => "blah", "Something" => "else"}
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should delete the set-cookie header from the response if the response comes from dragonfly" do
|
21
|
+
response = Rack::MockRequest.new(app('dragonfly.job' => mock)).get('')
|
22
|
+
response.status.should == 200
|
23
|
+
response.body.should == "body here"
|
24
|
+
response.headers.should == {"Something" => "else"}
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -199,4 +199,31 @@ describe Dragonfly::JobEndpoint do
|
|
199
199
|
end
|
200
200
|
end
|
201
201
|
|
202
|
+
describe "setting the job in the env for communicating with other rack middlewares" do
|
203
|
+
before(:each) do
|
204
|
+
@app.generator.add(:test_data){ "TEST DATA" }
|
205
|
+
@job = @app.generate(:test_data)
|
206
|
+
@endpoint = Dragonfly::JobEndpoint.new(@job)
|
207
|
+
@middleware = Class.new do
|
208
|
+
def initialize(app)
|
209
|
+
@app = app
|
210
|
+
end
|
211
|
+
|
212
|
+
def call(env)
|
213
|
+
@app.call(env)
|
214
|
+
throw :result, env['dragonfly.job']
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
it "should add the job to env" do
|
219
|
+
middleware, endpoint = @middleware, @endpoint
|
220
|
+
app = Rack::Builder.new do
|
221
|
+
use middleware
|
222
|
+
run endpoint
|
223
|
+
end
|
224
|
+
result = catch(:result){ Rack::MockRequest.new(app).get('/') }
|
225
|
+
result.should == @job
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
202
229
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dragonfly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.9.
|
5
|
+
version: 0.9.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mark Evans
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-19 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -211,17 +211,6 @@ dependencies:
|
|
211
211
|
type: :development
|
212
212
|
prerelease: false
|
213
213
|
version_requirements: *id018
|
214
|
-
- !ruby/object:Gem::Dependency
|
215
|
-
name: rack
|
216
|
-
requirement: &id019 !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
|
-
requirements:
|
219
|
-
- - ">="
|
220
|
-
- !ruby/object:Gem::Version
|
221
|
-
version: "0"
|
222
|
-
type: :runtime
|
223
|
-
prerelease: false
|
224
|
-
version_requirements: *id019
|
225
214
|
description: |-
|
226
215
|
Dragonfly is a framework that enables on-the-fly processing for any content type.
|
227
216
|
It is especially suited to image handling. Its uses range from image thumbnails to standard attachments to on-demand text generation.
|
@@ -301,6 +290,7 @@ files:
|
|
301
290
|
- lib/dragonfly/config/image_magick.rb
|
302
291
|
- lib/dragonfly/config/rails.rb
|
303
292
|
- lib/dragonfly/configurable.rb
|
293
|
+
- lib/dragonfly/cookie_monster.rb
|
304
294
|
- lib/dragonfly/core_ext/array.rb
|
305
295
|
- lib/dragonfly/core_ext/hash.rb
|
306
296
|
- lib/dragonfly/core_ext/object.rb
|
@@ -333,6 +323,7 @@ files:
|
|
333
323
|
- lib/dragonfly/processing/image_magick_processor.rb
|
334
324
|
- lib/dragonfly/processor.rb
|
335
325
|
- lib/dragonfly/rails/images.rb
|
326
|
+
- lib/dragonfly/railtie.rb
|
336
327
|
- lib/dragonfly/response.rb
|
337
328
|
- lib/dragonfly/routed_endpoint.rb
|
338
329
|
- lib/dragonfly/serializer.rb
|
@@ -351,6 +342,7 @@ files:
|
|
351
342
|
- spec/dragonfly/analysis/file_command_analyser_spec.rb
|
352
343
|
- spec/dragonfly/app_spec.rb
|
353
344
|
- spec/dragonfly/configurable_spec.rb
|
345
|
+
- spec/dragonfly/cookie_monster_spec.rb
|
354
346
|
- spec/dragonfly/core_ext/array_spec.rb
|
355
347
|
- spec/dragonfly/core_ext/hash_spec.rb
|
356
348
|
- spec/dragonfly/core_ext/string_spec.rb
|
@@ -409,7 +401,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
409
401
|
requirements:
|
410
402
|
- - ">="
|
411
403
|
- !ruby/object:Gem::Version
|
412
|
-
hash:
|
404
|
+
hash: 3194904429017796395
|
413
405
|
segments:
|
414
406
|
- 0
|
415
407
|
version: "0"
|
@@ -433,6 +425,7 @@ test_files:
|
|
433
425
|
- spec/dragonfly/analysis/file_command_analyser_spec.rb
|
434
426
|
- spec/dragonfly/app_spec.rb
|
435
427
|
- spec/dragonfly/configurable_spec.rb
|
428
|
+
- spec/dragonfly/cookie_monster_spec.rb
|
436
429
|
- spec/dragonfly/core_ext/array_spec.rb
|
437
430
|
- spec/dragonfly/core_ext/hash_spec.rb
|
438
431
|
- spec/dragonfly/core_ext/string_spec.rb
|