dragonfly 0.4.3 → 0.4.4
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.txt +13 -0
- data/Rakefile +35 -19
- data/VERSION +1 -1
- data/dragonfly.gemspec +36 -6
- data/features/steps/dragonfly_steps.rb +5 -1
- data/features/support/env.rb +0 -1
- data/lib/dragonfly.rb +2 -0
- data/lib/dragonfly/active_record_extensions/attachment.rb +7 -3
- data/lib/dragonfly/analysis/r_magick_analyser.rb +5 -0
- data/lib/dragonfly/core_ext/string.rb +9 -0
- data/lib/dragonfly/core_ext/symbol.rb +9 -0
- data/lib/dragonfly/delegator.rb +1 -1
- data/lib/dragonfly/parameters.rb +2 -2
- data/lib/dragonfly/processing/r_magick_processor.rb +3 -3
- data/lib/dragonfly/temp_object.rb +2 -1
- data/lib/dragonfly/url_handler.rb +3 -4
- data/spec/dragonfly/active_record_extensions/model_spec.rb +3 -2
- data/spec/dragonfly/analysis/r_magick_analyser_spec.rb +4 -0
- data/spec/dragonfly/core_ext/string_spec.rb +17 -0
- data/spec/dragonfly/core_ext/symbol_spec.rb +17 -0
- data/spec/dragonfly/delegatable_spec.rb +2 -2
- data/spec/dragonfly/delegator_spec.rb +1 -1
- data/spec/dragonfly/middleware_spec.rb +2 -2
- data/spec/dragonfly/temp_object_spec.rb +2 -2
- data/spec/spec_helper.rb +0 -1
- metadata +89 -4
- data/spec/dragonfly/shared_middleware_spec.rb +0 -44
data/History.txt
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
0.4.4 (2010-02-16)
|
2
|
+
==================
|
3
|
+
|
4
|
+
Better late than never to start logging change history...
|
5
|
+
|
6
|
+
New features
|
7
|
+
------------
|
8
|
+
- added aspect_ratio to rmagick_analyser
|
9
|
+
|
10
|
+
Added support
|
11
|
+
-------------
|
12
|
+
- support for ruby 1.9
|
13
|
+
- added development dependencies to gemspec for easier setting up
|
data/Rakefile
CHANGED
@@ -10,10 +10,18 @@ begin
|
|
10
10
|
s.homepage = "http://github.com/markevans/dragonfly"
|
11
11
|
s.authors = ["Mark Evans"]
|
12
12
|
s.add_dependency('rack')
|
13
|
+
s.add_development_dependency 'jeweler'
|
14
|
+
s.add_development_dependency 'yard'
|
15
|
+
s.add_development_dependency 'rmagick'
|
16
|
+
s.add_development_dependency 'aws-s3'
|
17
|
+
s.add_development_dependency 'rspec'
|
18
|
+
s.add_development_dependency 'cucumber'
|
19
|
+
s.add_development_dependency 'activerecord'
|
20
|
+
s.add_development_dependency 'sqlite3-ruby'
|
13
21
|
end
|
14
22
|
Jeweler::GemcutterTasks.new
|
15
23
|
rescue LoadError
|
16
|
-
puts "Jeweler not available. Install it with: sudo gem install
|
24
|
+
puts "Jeweler not available. Install it with: (sudo) gem install jeweler"
|
17
25
|
end
|
18
26
|
|
19
27
|
require 'rake/rdoctask'
|
@@ -25,33 +33,41 @@ Rake::RDocTask.new do |rdoc|
|
|
25
33
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
26
34
|
end
|
27
35
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
+
begin
|
37
|
+
require 'yard'
|
38
|
+
YARD::Rake::YardocTask.new do |t|
|
39
|
+
t.files = ['lib/**/*.rb']
|
40
|
+
t.options = %w(-e yard/setup.rb)
|
41
|
+
end
|
42
|
+
YARD::Rake::YardocTask.new 'yard:changed' do |t|
|
43
|
+
t.files = `git status | grep '.rb' | grep modified | grep -v yard | cut -d' ' -f4`.split
|
44
|
+
t.options = %w(-e yard/setup.rb)
|
45
|
+
end
|
46
|
+
rescue LoadError
|
47
|
+
puts "YARD is not available. To run the documentation tasks, install it with: (sudo) gem install yard"
|
36
48
|
end
|
37
49
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
50
|
+
begin
|
51
|
+
require 'spec/rake/spectask'
|
52
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
53
|
+
t.libs << 'lib' << 'spec'
|
54
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
55
|
+
end
|
43
56
|
|
44
|
-
Spec::Rake::SpecTask.new(:rcov) do |t|
|
45
|
-
|
46
|
-
|
47
|
-
|
57
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
58
|
+
t.libs << 'lib' << 'spec'
|
59
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
60
|
+
t.rcov = true
|
61
|
+
end
|
62
|
+
rescue LoadError
|
63
|
+
puts "RSpec is not available. To run tests, install it with: (sudo) gem install rspec"
|
48
64
|
end
|
49
65
|
|
50
66
|
begin
|
51
67
|
require 'cucumber/rake/task'
|
52
68
|
Cucumber::Rake::Task.new(:features)
|
53
69
|
rescue LoadError
|
54
|
-
puts "Cucumber is not available.
|
70
|
+
puts "Cucumber is not available. To run features, install it with: (sudo) gem install cucumber"
|
55
71
|
end
|
56
72
|
|
57
73
|
task :default => [:spec, :features]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/dragonfly.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dragonfly}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.4"
|
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{2010-
|
12
|
+
s.date = %q{2010-02-16}
|
13
13
|
s.email = %q{mark@new-bamboo.co.uk}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.files = [
|
19
19
|
".gitignore",
|
20
20
|
".yardopts",
|
21
|
+
"History.txt",
|
21
22
|
"LICENSE",
|
22
23
|
"README.md",
|
23
24
|
"Rakefile",
|
@@ -58,6 +59,8 @@ Gem::Specification.new do |s|
|
|
58
59
|
"lib/dragonfly/app.rb",
|
59
60
|
"lib/dragonfly/configurable.rb",
|
60
61
|
"lib/dragonfly/core_ext/object.rb",
|
62
|
+
"lib/dragonfly/core_ext/string.rb",
|
63
|
+
"lib/dragonfly/core_ext/symbol.rb",
|
61
64
|
"lib/dragonfly/data_storage.rb",
|
62
65
|
"lib/dragonfly/data_storage/base.rb",
|
63
66
|
"lib/dragonfly/data_storage/base64_data_store.rb",
|
@@ -97,6 +100,8 @@ Gem::Specification.new do |s|
|
|
97
100
|
"spec/dragonfly/analysis/r_magick_analyser_spec.rb",
|
98
101
|
"spec/dragonfly/app_spec.rb",
|
99
102
|
"spec/dragonfly/configurable_spec.rb",
|
103
|
+
"spec/dragonfly/core_ext/string_spec.rb",
|
104
|
+
"spec/dragonfly/core_ext/symbol_spec.rb",
|
100
105
|
"spec/dragonfly/data_storage/data_store_spec.rb",
|
101
106
|
"spec/dragonfly/data_storage/file_data_store_spec.rb",
|
102
107
|
"spec/dragonfly/data_storage/s3_data_store_spec.rb",
|
@@ -107,7 +112,6 @@ Gem::Specification.new do |s|
|
|
107
112
|
"spec/dragonfly/middleware_spec.rb",
|
108
113
|
"spec/dragonfly/parameters_spec.rb",
|
109
114
|
"spec/dragonfly/processing/rmagick_processor_spec.rb",
|
110
|
-
"spec/dragonfly/shared_middleware_spec.rb",
|
111
115
|
"spec/dragonfly/temp_object_spec.rb",
|
112
116
|
"spec/dragonfly/url_handler_spec.rb",
|
113
117
|
"spec/dragonfly_spec.rb",
|
@@ -138,6 +142,8 @@ Gem::Specification.new do |s|
|
|
138
142
|
"spec/dragonfly/analysis/r_magick_analyser_spec.rb",
|
139
143
|
"spec/dragonfly/app_spec.rb",
|
140
144
|
"spec/dragonfly/configurable_spec.rb",
|
145
|
+
"spec/dragonfly/core_ext/string_spec.rb",
|
146
|
+
"spec/dragonfly/core_ext/symbol_spec.rb",
|
141
147
|
"spec/dragonfly/data_storage/data_store_spec.rb",
|
142
148
|
"spec/dragonfly/data_storage/file_data_store_spec.rb",
|
143
149
|
"spec/dragonfly/data_storage/s3_data_store_spec.rb",
|
@@ -148,7 +154,6 @@ Gem::Specification.new do |s|
|
|
148
154
|
"spec/dragonfly/middleware_spec.rb",
|
149
155
|
"spec/dragonfly/parameters_spec.rb",
|
150
156
|
"spec/dragonfly/processing/rmagick_processor_spec.rb",
|
151
|
-
"spec/dragonfly/shared_middleware_spec.rb",
|
152
157
|
"spec/dragonfly/temp_object_spec.rb",
|
153
158
|
"spec/dragonfly/url_handler_spec.rb",
|
154
159
|
"spec/dragonfly_spec.rb",
|
@@ -163,10 +168,35 @@ Gem::Specification.new do |s|
|
|
163
168
|
|
164
169
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
165
170
|
s.add_runtime_dependency(%q<rack>, [">= 0"])
|
171
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
172
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
173
|
+
s.add_development_dependency(%q<rmagick>, [">= 0"])
|
174
|
+
s.add_development_dependency(%q<aws-s3>, [">= 0"])
|
175
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
176
|
+
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
177
|
+
s.add_development_dependency(%q<activerecord>, [">= 0"])
|
178
|
+
s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
|
166
179
|
else
|
167
180
|
s.add_dependency(%q<rack>, [">= 0"])
|
181
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
182
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
183
|
+
s.add_dependency(%q<rmagick>, [">= 0"])
|
184
|
+
s.add_dependency(%q<aws-s3>, [">= 0"])
|
185
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
186
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
187
|
+
s.add_dependency(%q<activerecord>, [">= 0"])
|
188
|
+
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
168
189
|
end
|
169
190
|
else
|
170
191
|
s.add_dependency(%q<rack>, [">= 0"])
|
192
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
193
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
194
|
+
s.add_dependency(%q<rmagick>, [">= 0"])
|
195
|
+
s.add_dependency(%q<aws-s3>, [">= 0"])
|
196
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
197
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
198
|
+
s.add_dependency(%q<activerecord>, [">= 0"])
|
199
|
+
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
171
200
|
end
|
172
201
|
end
|
202
|
+
|
@@ -56,5 +56,9 @@ Then /^the image should have format '(.+?)'$/ do |format|
|
|
56
56
|
end
|
57
57
|
|
58
58
|
Then /^the response should have the same content as the file "([^\"]*)"$/ do |name|
|
59
|
-
|
59
|
+
if RUBY_VERSION =~ /^1\.8/
|
60
|
+
@response.body.should == $app.fetch(TEMP_FILES[name]).data
|
61
|
+
else
|
62
|
+
@response.body.force_encoding('BINARY').should == $app.fetch(TEMP_FILES[name]).data.force_encoding('BINARY')
|
63
|
+
end
|
60
64
|
end
|
data/features/support/env.rb
CHANGED
@@ -2,7 +2,6 @@ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
|
|
2
2
|
require 'dragonfly'
|
3
3
|
require 'spec/expectations'
|
4
4
|
require 'test/unit/assertions'
|
5
|
-
require 'ruby-debug'
|
6
5
|
require File.dirname(__FILE__) + '/../../spec/image_matchers.rb'
|
7
6
|
|
8
7
|
# A hack as system calls weren't using my path
|
data/lib/dragonfly.rb
CHANGED
@@ -31,3 +31,5 @@ autoload_files_in_dir("#{File.dirname(__FILE__)}/dragonfly", 'Dragonfly')
|
|
31
31
|
|
32
32
|
require 'rubygems'
|
33
33
|
require File.dirname(__FILE__) + '/dragonfly/core_ext/object'
|
34
|
+
require File.dirname(__FILE__) + '/dragonfly/core_ext/string'
|
35
|
+
require File.dirname(__FILE__) + '/dragonfly/core_ext/symbol'
|
@@ -71,7 +71,7 @@ module Dragonfly
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def respond_to?(method)
|
74
|
-
super || methods_to_delegate_to_temp_object.include?(method.
|
74
|
+
super || methods_to_delegate_to_temp_object.include?(method.to_method_name)
|
75
75
|
end
|
76
76
|
|
77
77
|
def ext
|
@@ -124,10 +124,14 @@ module Dragonfly
|
|
124
124
|
analyser.callable_methods
|
125
125
|
end
|
126
126
|
|
127
|
+
def can_delegate_to_temp_object?(meth)
|
128
|
+
methods_to_delegate_to_temp_object.include?(meth.to_method_name)
|
129
|
+
end
|
130
|
+
|
127
131
|
def magic_attributes
|
128
132
|
parent_model.class.column_names.select { |name|
|
129
133
|
name =~ /^#{attribute_name}_(.+)$/ &&
|
130
|
-
(
|
134
|
+
(can_delegate_to_temp_object?($1) || %w(size ext name).include?($1))
|
131
135
|
}
|
132
136
|
end
|
133
137
|
|
@@ -151,7 +155,7 @@ module Dragonfly
|
|
151
155
|
end
|
152
156
|
|
153
157
|
def method_missing(meth, *args, &block)
|
154
|
-
if
|
158
|
+
if can_delegate_to_temp_object?(meth)
|
155
159
|
has_magic_attribute_for?(meth) ? magic_attribute_for(meth) : temp_object.send(meth, *args, &block)
|
156
160
|
else
|
157
161
|
super
|
data/lib/dragonfly/delegator.rb
CHANGED
data/lib/dragonfly/parameters.rb
CHANGED
@@ -152,8 +152,8 @@ module Dragonfly
|
|
152
152
|
def to_sorted_array
|
153
153
|
[
|
154
154
|
uid,
|
155
|
-
format,
|
156
|
-
processing_method,
|
155
|
+
format.to_s,
|
156
|
+
processing_method.to_s,
|
157
157
|
processing_options.sort{|a,b| a[0].to_s <=> b[0].to_s },
|
158
158
|
encoding.sort{|a,b| a[0].to_s <=> b[0].to_s }
|
159
159
|
]
|
@@ -195,13 +195,13 @@ module Dragonfly
|
|
195
195
|
padding_parts = str.gsub('px','').split(/\s+/).map{|px| px.to_i}
|
196
196
|
case padding_parts.size
|
197
197
|
when 1
|
198
|
-
p =
|
198
|
+
p = padding_parts.first
|
199
199
|
[p,p,p,p]
|
200
200
|
when 2
|
201
|
-
p,q =
|
201
|
+
p,q = padding_parts
|
202
202
|
[p,q,p,q]
|
203
203
|
when 3
|
204
|
-
p,q,r =
|
204
|
+
p,q,r = padding_parts
|
205
205
|
[p,q,r,q]
|
206
206
|
when 4
|
207
207
|
padding_parts
|
@@ -94,11 +94,10 @@ module Dragonfly
|
|
94
94
|
attr_reader :parameters_class
|
95
95
|
|
96
96
|
def symbolize_keys(hash)
|
97
|
-
hash
|
98
|
-
|
99
|
-
|
97
|
+
hash.inject({}) do |memo, (key, value)|
|
98
|
+
memo[key.to_sym] = hash[key]
|
99
|
+
memo
|
100
100
|
end
|
101
|
-
hash
|
102
101
|
end
|
103
102
|
|
104
103
|
def validate_parameters(parameters, query)
|
@@ -449,11 +449,12 @@ describe Item do
|
|
449
449
|
@item.preview_image.respond_to?(:number_of_As).should be_true
|
450
450
|
end
|
451
451
|
it "should include analyser methods in methods" do
|
452
|
-
@item.preview_image.methods.include?('number_of_As').should be_true
|
452
|
+
@item.preview_image.methods.include?('number_of_As'.to_method_name).should be_true
|
453
453
|
end
|
454
454
|
it "should include analyser methods in public_methods" do
|
455
|
-
@item.preview_image.public_methods.include?('number_of_As').should be_true
|
455
|
+
@item.preview_image.public_methods.include?('number_of_As'.to_method_name).should be_true
|
456
456
|
end
|
457
|
+
|
457
458
|
it "should update when something new is assigned" do
|
458
459
|
@item.preview_image = 'ANEWDATASTRING'
|
459
460
|
@item.preview_image.number_of_As.should == 3
|
@@ -16,6 +16,10 @@ describe Dragonfly::Analysis::RMagickAnalyser do
|
|
16
16
|
@analyser.height(@beach).should == 355
|
17
17
|
end
|
18
18
|
|
19
|
+
it "should return the aspect ratio" do
|
20
|
+
@analyser.aspect_ratio(@beach).should == (280.0/355.0)
|
21
|
+
end
|
22
|
+
|
19
23
|
it "should return the number of colours" do
|
20
24
|
@analyser.number_of_colours(@beach).should == 34703
|
21
25
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe String do
|
4
|
+
|
5
|
+
describe "to_method_name" do
|
6
|
+
if RUBY_VERSION =~ /^1.8/
|
7
|
+
it "should return a string" do
|
8
|
+
'hello'.to_method_name.should == 'hello'
|
9
|
+
end
|
10
|
+
else
|
11
|
+
it "should return a symbol" do
|
12
|
+
'hello'.to_method_name.should == :hello
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe Symbol do
|
4
|
+
|
5
|
+
describe "to_method_name" do
|
6
|
+
if RUBY_VERSION =~ /^1.8/
|
7
|
+
it "should return a string" do
|
8
|
+
:hello.to_method_name.should == 'hello'
|
9
|
+
end
|
10
|
+
else
|
11
|
+
it "should return a symbol" do
|
12
|
+
:hello.to_method_name.should == :hello
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -18,13 +18,13 @@ describe Dragonfly::Delegatable do
|
|
18
18
|
|
19
19
|
describe "delegatable_methods" do
|
20
20
|
it "should include all methods defined after including, including mixed-in and inherited" do
|
21
|
-
B.new.delegatable_methods.
|
21
|
+
B.new.delegatable_methods.should == [:b, :m, :a].map{|m| m.to_method_name }
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should work the second (cached) time" do
|
25
25
|
b = B.new
|
26
26
|
b.delegatable_methods
|
27
|
-
b.delegatable_methods.
|
27
|
+
b.delegatable_methods.should == [:b, :m, :a].map{|m| m.to_method_name }
|
28
28
|
end
|
29
29
|
|
30
30
|
end
|
@@ -81,7 +81,7 @@ describe Dragonfly::Delegator do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
it "should return all the callable methods" do
|
84
|
-
@delegator.callable_methods.sort.should == %w(clean drive open_back_doors open_boot pick_up)
|
84
|
+
@delegator.callable_methods.sort.should == %w(clean drive open_back_doors open_boot pick_up).map{|m| m.to_method_name }
|
85
85
|
end
|
86
86
|
|
87
87
|
it "should say if if has a callable method (as a string)" do
|
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
2
|
require 'rack'
|
3
3
|
|
4
4
|
def dummy_rack_app
|
5
|
-
lambda{|env| [200, {"Content-Type" => "text/html"}, ["
|
5
|
+
lambda{|env| [200, {"Content-Type" => "text/html"}, ["dummy_rack_app body"]] }
|
6
6
|
end
|
7
7
|
|
8
8
|
describe Dragonfly::Middleware do
|
@@ -24,7 +24,7 @@ describe Dragonfly::Middleware do
|
|
24
24
|
)
|
25
25
|
response = make_request(@stack, 'hello.png?howare=you')
|
26
26
|
response.status.should == 200
|
27
|
-
response.body.should == '
|
27
|
+
response.body.should == 'dummy_rack_app body'
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should return as per the dragonfly app if the app returns a 200" do
|
@@ -40,9 +40,9 @@ describe Dragonfly::TempObject do
|
|
40
40
|
it "should yield 8192 bytes each time" do
|
41
41
|
parts = get_parts(@temp_object)
|
42
42
|
parts[0...-1].each do |part|
|
43
|
-
part.
|
43
|
+
part.bytesize.should == 8192
|
44
44
|
end
|
45
|
-
parts.last.
|
45
|
+
parts.last.bytesize.should <= 8192
|
46
46
|
end
|
47
47
|
|
48
48
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dragonfly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Evans
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-02-16 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +22,86 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: "0"
|
24
24
|
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: jeweler
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: yard
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: rmagick
|
47
|
+
type: :development
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
|
+
version:
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: aws-s3
|
57
|
+
type: :development
|
58
|
+
version_requirement:
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
version:
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: rspec
|
67
|
+
type: :development
|
68
|
+
version_requirement:
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
74
|
+
version:
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: cucumber
|
77
|
+
type: :development
|
78
|
+
version_requirement:
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: "0"
|
84
|
+
version:
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: activerecord
|
87
|
+
type: :development
|
88
|
+
version_requirement:
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: "0"
|
94
|
+
version:
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: sqlite3-ruby
|
97
|
+
type: :development
|
98
|
+
version_requirement:
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: "0"
|
104
|
+
version:
|
25
105
|
description:
|
26
106
|
email: mark@new-bamboo.co.uk
|
27
107
|
executables: []
|
@@ -34,6 +114,7 @@ extra_rdoc_files:
|
|
34
114
|
files:
|
35
115
|
- .gitignore
|
36
116
|
- .yardopts
|
117
|
+
- History.txt
|
37
118
|
- LICENSE
|
38
119
|
- README.md
|
39
120
|
- Rakefile
|
@@ -74,6 +155,8 @@ files:
|
|
74
155
|
- lib/dragonfly/app.rb
|
75
156
|
- lib/dragonfly/configurable.rb
|
76
157
|
- lib/dragonfly/core_ext/object.rb
|
158
|
+
- lib/dragonfly/core_ext/string.rb
|
159
|
+
- lib/dragonfly/core_ext/symbol.rb
|
77
160
|
- lib/dragonfly/data_storage.rb
|
78
161
|
- lib/dragonfly/data_storage/base.rb
|
79
162
|
- lib/dragonfly/data_storage/base64_data_store.rb
|
@@ -113,6 +196,8 @@ files:
|
|
113
196
|
- spec/dragonfly/analysis/r_magick_analyser_spec.rb
|
114
197
|
- spec/dragonfly/app_spec.rb
|
115
198
|
- spec/dragonfly/configurable_spec.rb
|
199
|
+
- spec/dragonfly/core_ext/string_spec.rb
|
200
|
+
- spec/dragonfly/core_ext/symbol_spec.rb
|
116
201
|
- spec/dragonfly/data_storage/data_store_spec.rb
|
117
202
|
- spec/dragonfly/data_storage/file_data_store_spec.rb
|
118
203
|
- spec/dragonfly/data_storage/s3_data_store_spec.rb
|
@@ -123,7 +208,6 @@ files:
|
|
123
208
|
- spec/dragonfly/middleware_spec.rb
|
124
209
|
- spec/dragonfly/parameters_spec.rb
|
125
210
|
- spec/dragonfly/processing/rmagick_processor_spec.rb
|
126
|
-
- spec/dragonfly/shared_middleware_spec.rb
|
127
211
|
- spec/dragonfly/temp_object_spec.rb
|
128
212
|
- spec/dragonfly/url_handler_spec.rb
|
129
213
|
- spec/dragonfly_spec.rb
|
@@ -176,6 +260,8 @@ test_files:
|
|
176
260
|
- spec/dragonfly/analysis/r_magick_analyser_spec.rb
|
177
261
|
- spec/dragonfly/app_spec.rb
|
178
262
|
- spec/dragonfly/configurable_spec.rb
|
263
|
+
- spec/dragonfly/core_ext/string_spec.rb
|
264
|
+
- spec/dragonfly/core_ext/symbol_spec.rb
|
179
265
|
- spec/dragonfly/data_storage/data_store_spec.rb
|
180
266
|
- spec/dragonfly/data_storage/file_data_store_spec.rb
|
181
267
|
- spec/dragonfly/data_storage/s3_data_store_spec.rb
|
@@ -186,7 +272,6 @@ test_files:
|
|
186
272
|
- spec/dragonfly/middleware_spec.rb
|
187
273
|
- spec/dragonfly/parameters_spec.rb
|
188
274
|
- spec/dragonfly/processing/rmagick_processor_spec.rb
|
189
|
-
- spec/dragonfly/shared_middleware_spec.rb
|
190
275
|
- spec/dragonfly/temp_object_spec.rb
|
191
276
|
- spec/dragonfly/url_handler_spec.rb
|
192
277
|
- spec/dragonfly_spec.rb
|
@@ -1,44 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
require 'rack'
|
3
|
-
|
4
|
-
def dummy_rack_app
|
5
|
-
lambda{|env| [200, {"Content-Type" => "text/html"}, ["#{env['PATH_INFO']}, #{env['QUERY_STRING']}"]] }
|
6
|
-
end
|
7
|
-
|
8
|
-
|
9
|
-
describe "dragonfly middleware", :shared => true do
|
10
|
-
|
11
|
-
# REQUIRES THAT @stack and Dragonfly::App[:images] IS DEFINED
|
12
|
-
|
13
|
-
def make_request(app, url)
|
14
|
-
Rack::MockRequest.new(app).get(url)
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should continue the calling chain if the app returns a 404 for that url" do
|
18
|
-
Dragonfly::App[:images].should_receive(:call).and_return(
|
19
|
-
[404, {"Content-Type" => 'text/plain'}, ['Not found']]
|
20
|
-
)
|
21
|
-
response = make_request(@stack, 'hello.png?howare=you')
|
22
|
-
response.status.should == 200
|
23
|
-
response.body.should == 'hello.png, howare=you'
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should return as per the dragonfly app if the app returns a 200" do
|
27
|
-
Dragonfly::App[:images].should_receive(:call).and_return(
|
28
|
-
[200, {"Content-Type" => 'text/plain'}, ['ABCD']]
|
29
|
-
)
|
30
|
-
response = make_request(@stack, 'hello.png?howare=you')
|
31
|
-
response.status.should == 200
|
32
|
-
response.body.should == 'ABCD'
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should return as per the dragonfly app if the app returns a 400" do
|
36
|
-
Dragonfly::App[:images].should_receive(:call).and_return(
|
37
|
-
[400, {"Content-Type" => 'text/plain'}, ['ABCD']]
|
38
|
-
)
|
39
|
-
response = make_request(@stack, 'hello.png?howare=you')
|
40
|
-
response.status.should == 400
|
41
|
-
response.body.should == 'ABCD'
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|