dragonfly 0.1.6 → 0.2.1
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/.yardopts +4 -0
- data/{README.markdown → README.md} +12 -24
- data/Rakefile +6 -6
- data/VERSION +1 -1
- data/config.rb +1 -3
- data/docs.watchr +1 -1
- data/dragonfly-rails.gemspec +2 -5
- data/dragonfly.gemspec +32 -12
- data/extra_docs/ActiveRecord.md +195 -0
- data/extra_docs/Analysers.md +63 -0
- data/extra_docs/DataStorage.md +33 -0
- data/extra_docs/Encoding.md +58 -0
- data/extra_docs/GettingStarted.md +114 -0
- data/extra_docs/Processing.md +58 -0
- data/extra_docs/Shortcuts.md +118 -0
- data/extra_docs/UsingWithRails.md +104 -0
- data/features/{dragonfly.feature → images.feature} +14 -4
- data/features/no_processing.feature +20 -0
- data/features/steps/dragonfly_steps.rb +29 -8
- data/features/support/env.rb +20 -8
- data/generators/dragonfly_app/USAGE +0 -1
- data/generators/dragonfly_app/dragonfly_app_generator.rb +1 -13
- data/generators/dragonfly_app/templates/metal_file.erb +1 -1
- data/lib/dragonfly/active_record_extensions.rb +1 -0
- data/lib/dragonfly/active_record_extensions/attachment.rb +52 -6
- data/lib/dragonfly/active_record_extensions/validations.rb +26 -6
- data/lib/dragonfly/analysis/base.rb +6 -3
- data/lib/dragonfly/analysis/r_magick_analyser.rb +0 -6
- data/lib/dragonfly/app.rb +53 -35
- data/lib/dragonfly/configurable.rb +1 -1
- data/lib/dragonfly/data_storage/file_data_store.rb +8 -8
- data/lib/dragonfly/delegatable.rb +14 -0
- data/lib/dragonfly/delegator.rb +50 -0
- data/lib/dragonfly/encoding/base.rb +7 -7
- data/lib/dragonfly/encoding/r_magick_encoder.rb +3 -0
- data/lib/dragonfly/encoding/transparent_encoder.rb +1 -1
- data/lib/dragonfly/extended_temp_object.rb +13 -7
- data/lib/dragonfly/parameters.rb +17 -11
- data/lib/dragonfly/processing/base.rb +9 -0
- data/lib/dragonfly/processing/r_magick_processor.rb +15 -1
- data/lib/dragonfly/r_magick_configuration.rb +12 -8
- data/lib/dragonfly/rails/images.rb +1 -1
- data/lib/dragonfly/temp_object.rb +14 -2
- data/lib/dragonfly/url_handler.rb +5 -6
- data/samples/sample.docx +0 -0
- data/spec/dragonfly/active_record_extensions/model_spec.rb +175 -84
- data/spec/dragonfly/analysis/r_magick_analyser_spec.rb +0 -8
- data/spec/dragonfly/app_spec.rb +3 -3
- data/spec/dragonfly/configurable_spec.rb +1 -1
- data/spec/dragonfly/data_storage/file_data_store_spec.rb +55 -40
- data/spec/dragonfly/delegatable_spec.rb +32 -0
- data/spec/dragonfly/delegator_spec.rb +133 -0
- data/spec/dragonfly/encoding/r_magick_encoder_spec.rb +28 -0
- data/spec/dragonfly/extended_temp_object_spec.rb +5 -5
- data/spec/dragonfly/parameters_spec.rb +22 -32
- data/spec/dragonfly/processing/rmagick_processor_spec.rb +1 -2
- data/spec/dragonfly/temp_object_spec.rb +51 -0
- data/spec/dragonfly/url_handler_spec.rb +10 -15
- data/yard/handlers/configurable_attr_handler.rb +38 -0
- data/yard/setup.rb +9 -0
- data/yard/templates/default/fulldoc/html/css/common.css +27 -0
- data/yard/templates/default/module/html/configuration_summary.erb +31 -0
- data/yard/templates/default/module/setup.rb +17 -0
- metadata +31 -12
- data/features/support/image_helpers.rb +0 -9
- data/generators/dragonfly_app/templates/custom_processing.erb +0 -13
- data/lib/dragonfly/analysis/analyser.rb +0 -45
- data/lib/dragonfly/processing/processor.rb +0 -14
- data/spec/dragonfly/analysis/analyser_spec.rb +0 -85
@@ -5,8 +5,7 @@ describe Dragonfly::Processing::RMagickProcessor do
|
|
5
5
|
before(:each) do
|
6
6
|
sample_file = File.dirname(__FILE__) + '/../../../samples/beach.png' # 280x355
|
7
7
|
@image = Dragonfly::TempObject.new(File.new(sample_file))
|
8
|
-
@processor =
|
9
|
-
@processor.extend Dragonfly::Processing::RMagickProcessor
|
8
|
+
@processor = Dragonfly::Processing::RMagickProcessor.new
|
10
9
|
end
|
11
10
|
|
12
11
|
describe "#resize" do
|
@@ -195,6 +195,10 @@ describe Dragonfly::TempObject do
|
|
195
195
|
@temp_object.modify_self!(tempfile)
|
196
196
|
@temp_object.data.should == data
|
197
197
|
end
|
198
|
+
it "should still work when the object is itself" do
|
199
|
+
@temp_object.modify_self!(@temp_object)
|
200
|
+
@temp_object.data.should == 'DATA_ONE'
|
201
|
+
end
|
198
202
|
|
199
203
|
end
|
200
204
|
|
@@ -228,6 +232,11 @@ describe Dragonfly::TempObject do
|
|
228
232
|
it "should not set the name if the initial object doesn't respond to 'original filename'" do
|
229
233
|
Dragonfly::TempObject.new(@obj).name.should be_nil
|
230
234
|
end
|
235
|
+
it "should set the name if the initial object is a file object" do
|
236
|
+
file = File.new(SAMPLES_DIR + '/round.gif')
|
237
|
+
temp_object = Dragonfly::TempObject.new(file)
|
238
|
+
temp_object.name.should == 'round.gif'
|
239
|
+
end
|
231
240
|
end
|
232
241
|
|
233
242
|
describe "ext" do
|
@@ -248,4 +257,46 @@ describe Dragonfly::TempObject do
|
|
248
257
|
end
|
249
258
|
end
|
250
259
|
|
260
|
+
describe "to_file" do
|
261
|
+
|
262
|
+
describe "common behaviour for to_file", :shared => true do
|
263
|
+
before(:each) do
|
264
|
+
@filename = 'eggnog.txt'
|
265
|
+
FileUtils.rm(@filename) if File.exists?(@filename)
|
266
|
+
end
|
267
|
+
after(:each) do
|
268
|
+
FileUtils.rm(@filename) if File.exists?(@filename)
|
269
|
+
end
|
270
|
+
it "should write to a file" do
|
271
|
+
@temp_object.to_file(@filename)
|
272
|
+
File.exists?(@filename).should be_true
|
273
|
+
end
|
274
|
+
it "should write the correct data to the file" do
|
275
|
+
@temp_object.to_file(@filename)
|
276
|
+
File.read(@filename).should == 'HELLO'
|
277
|
+
end
|
278
|
+
it "should return a readable file" do
|
279
|
+
file = @temp_object.to_file(@filename)
|
280
|
+
file.should be_a(File)
|
281
|
+
file.read.should == 'HELLO'
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
describe "when initialized with a string" do
|
286
|
+
before(:each){ @temp_object = Dragonfly::TempObject.new('HELLO') }
|
287
|
+
it_should_behave_like "common behaviour for to_file"
|
288
|
+
end
|
289
|
+
|
290
|
+
describe "when initialized with a file" do
|
291
|
+
before(:each){ @temp_object = Dragonfly::TempObject.new(new_tempfile('HELLO')) }
|
292
|
+
it_should_behave_like "common behaviour for to_file"
|
293
|
+
end
|
294
|
+
|
295
|
+
describe "when initialized with a tempfile" do
|
296
|
+
before(:each){ @temp_object = Dragonfly::TempObject.new(new_file('HELLO')) }
|
297
|
+
it_should_behave_like "common behaviour for to_file"
|
298
|
+
end
|
299
|
+
|
300
|
+
end
|
301
|
+
|
251
302
|
end
|
@@ -19,11 +19,6 @@ describe Dragonfly::UrlHandler do
|
|
19
19
|
@parameters.uid.should == 'images/some_image'
|
20
20
|
end
|
21
21
|
|
22
|
-
it "should behave the same if there is no beginning slash" do
|
23
|
-
parameters = @url_handler.url_to_parameters('images/some_image.jpg', @query_string)
|
24
|
-
parameters.uid.should == 'images/some_image'
|
25
|
-
end
|
26
|
-
|
27
22
|
it "should take into account the path prefix if there is one" do
|
28
23
|
@url_handler.path_prefix = '/images'
|
29
24
|
parameters = @url_handler.url_to_parameters('/images/2009/some_image.jpg', @query_string)
|
@@ -67,10 +62,10 @@ describe Dragonfly::UrlHandler do
|
|
67
62
|
url_handler.url_to_parameters(@path, @query_string)
|
68
63
|
end
|
69
64
|
|
70
|
-
it "should
|
71
|
-
|
72
|
-
|
73
|
-
|
65
|
+
it "should not set the format if the path doesn't have an extension" do
|
66
|
+
parameters = @url_handler.url_to_parameters('/hello', @query_string)
|
67
|
+
parameters.uid.should == 'hello'
|
68
|
+
parameters.format.should be_nil
|
74
69
|
end
|
75
70
|
|
76
71
|
it "should raise an UnknownUrl error if the path doesn't have a uid bit" do
|
@@ -86,13 +81,13 @@ describe Dragonfly::UrlHandler do
|
|
86
81
|
end
|
87
82
|
|
88
83
|
it "should set most of the path as the uid if there is more than one dot" do
|
89
|
-
parameters = @url_handler.url_to_parameters('hello.old.bean', @query_string)
|
84
|
+
parameters = @url_handler.url_to_parameters('/hello.old.bean', @query_string)
|
90
85
|
parameters.uid.should == 'hello.old'
|
91
86
|
parameters.format.should == 'bean'
|
92
87
|
end
|
93
88
|
|
94
89
|
it "should unescape any url-escaped characters" do
|
95
|
-
parameters = @url_handler.url_to_parameters('hello%20bean.jpg', 'm=whats%20up')
|
90
|
+
parameters = @url_handler.url_to_parameters('/hello%20bean.jpg', 'm=whats%20up')
|
96
91
|
parameters.uid.should == 'hello bean'
|
97
92
|
parameters.processing_method.should == 'whats up'
|
98
93
|
end
|
@@ -121,6 +116,10 @@ describe Dragonfly::UrlHandler do
|
|
121
116
|
@parameters.processing_method = nil
|
122
117
|
@url_handler.parameters_to_url(@parameters).should match_url('/thisisunique.gif?o[d]=e&o[j]=k&e[x]=y')
|
123
118
|
end
|
119
|
+
it "should leave out the format if there is none" do
|
120
|
+
@parameters.format = nil
|
121
|
+
@url_handler.parameters_to_url(@parameters).should match_url('/thisisunique?m=b&o[d]=e&o[j]=k&e[x]=y')
|
122
|
+
end
|
124
123
|
it "should leave out any empty parameters" do
|
125
124
|
@parameters.processing_options = {}
|
126
125
|
@url_handler.parameters_to_url(@parameters).should match_url('/thisisunique.gif?m=b&e[x]=y')
|
@@ -129,10 +128,6 @@ describe Dragonfly::UrlHandler do
|
|
129
128
|
@url_handler.path_prefix = '/images'
|
130
129
|
@url_handler.parameters_to_url(@parameters).should match_url('/images/thisisunique.gif?m=b&o[d]=e&o[j]=k&e[x]=y')
|
131
130
|
end
|
132
|
-
it "should validate the parameters" do
|
133
|
-
@parameters.should_receive(:validate!)
|
134
|
-
@url_handler.parameters_to_url(@parameters)
|
135
|
-
end
|
136
131
|
it "should escape any non-url friendly characters except for '/'" do
|
137
132
|
parameters = Dragonfly::Parameters.new :uid => 'hello/u"u', :processing_method => 'm"m', :format => 'jpg'
|
138
133
|
@url_handler.parameters_to_url(parameters).should == '/hello/u%22u.jpg?m=m%22m'
|
@@ -0,0 +1,38 @@
|
|
1
|
+
class ConfigurableAttrHandler < YARD::Handlers::Ruby::Legacy::Base
|
2
|
+
handles(/^\s*configurable_attr/)
|
3
|
+
|
4
|
+
def process
|
5
|
+
owner[:configurable_attributes] ||= []
|
6
|
+
|
7
|
+
attribute = token_to_object(statement.tokens[2])
|
8
|
+
comments = statement.comments.join(' ') if statement.comments
|
9
|
+
|
10
|
+
if statement.block
|
11
|
+
# e.g. configurable_attr :datastore do FileDataStore.new end
|
12
|
+
lazy_default_value = statement.block.to_s
|
13
|
+
else
|
14
|
+
# e.g. configurable_attr :fallback_mime_type, 'application/octet-stream'
|
15
|
+
default_value = token_to_object(statement.tokens[5..-1])
|
16
|
+
end
|
17
|
+
owner[:configurable_attributes] << {
|
18
|
+
:attribute => attribute,
|
19
|
+
:default_value => default_value,
|
20
|
+
:lazy_default_value => lazy_default_value,
|
21
|
+
:comments => comments
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def token_to_object(token)
|
28
|
+
if token
|
29
|
+
if token.is_a?(YARD::Parser::Ruby::Legacy::TokenList)
|
30
|
+
eval(token.to_s)
|
31
|
+
else # is a single token
|
32
|
+
eval(token.text)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
data/yard/setup.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Allow debugging
|
2
|
+
require 'rubygems'
|
3
|
+
require 'ruby-debug'
|
4
|
+
|
5
|
+
YARD::Templates::Engine.register_template_path(File.dirname(__FILE__) + '/templates')
|
6
|
+
Dir[File.dirname(__FILE__) + '/handlers/*.rb'].each do |file|
|
7
|
+
require File.expand_path(file)
|
8
|
+
end
|
9
|
+
YARD::Parser::SourceParser.parser_type = :ruby18
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/* Overrides for yard documentation */
|
2
|
+
|
3
|
+
pre, code, .code,
|
4
|
+
#filecontents pre.code,
|
5
|
+
.docstring pre.code,
|
6
|
+
.source_code pre {
|
7
|
+
font-family: monaco, 'Trebuchet MS', monospace;
|
8
|
+
}
|
9
|
+
|
10
|
+
pre.code, code {
|
11
|
+
background:#F5F5FF;
|
12
|
+
border:1px solid #EEEEFF;
|
13
|
+
}
|
14
|
+
pre.code {
|
15
|
+
margin-top:4px;
|
16
|
+
padding:5px 12px;
|
17
|
+
}
|
18
|
+
|
19
|
+
code .val {
|
20
|
+
color:#036A07;
|
21
|
+
}
|
22
|
+
code .kw {
|
23
|
+
color:#0000FF;
|
24
|
+
}
|
25
|
+
code .symbol {
|
26
|
+
color:#C5060B;
|
27
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% configurable_attributes = object[:configurable_attributes] || [] %>
|
2
|
+
<% if configurable_attributes.any? %>
|
3
|
+
<h2>Configuration Summary</h2>
|
4
|
+
<h3>Configurable attributes</h3>
|
5
|
+
Configurable attributes for an object in general <code>object</code> can be configured either by using something like
|
6
|
+
<pre class="code">
|
7
|
+
object.configure <%= hl :do %> |c|
|
8
|
+
c.some_configurable_attribute = <%= hl 'some value' %>
|
9
|
+
c.some_other_configurable_attribute = <%= hl 42 %>
|
10
|
+
...
|
11
|
+
<%= hl :end %>
|
12
|
+
</pre>
|
13
|
+
or
|
14
|
+
<pre class="code">
|
15
|
+
object.some_configurable_attribute = <%= hl 'some value' %>
|
16
|
+
</pre>
|
17
|
+
<h4>Configurable attributes for instances of <%= object %></h4>
|
18
|
+
<ul>
|
19
|
+
<% configurable_attributes.each do |attribute| %>
|
20
|
+
<li>
|
21
|
+
<code><%= attribute[:attribute] %></code>
|
22
|
+
<% if attribute[:lazy_default_value] %>
|
23
|
+
- default <code><%= hl attribute[:lazy_default_value] %></code> (evaluated lazily)
|
24
|
+
<% else %>
|
25
|
+
- default <code><%= hl attribute[:default_value] %></code>
|
26
|
+
<% end %>
|
27
|
+
<%= '- ' + attribute[:comments] if attribute[:comments] %>
|
28
|
+
</li>
|
29
|
+
<% end %>
|
30
|
+
</ul>
|
31
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
def init
|
2
|
+
super
|
3
|
+
sections.place(:configuration_summary).before(:method_summary)
|
4
|
+
end
|
5
|
+
|
6
|
+
# Highlight stuff
|
7
|
+
def hl(code)
|
8
|
+
case code
|
9
|
+
when :do, :end then %(<span class="kw">#{code}</span>)
|
10
|
+
when Symbol then %(<span class="symbol">#{code.inspect}</span>)
|
11
|
+
when Integer then %(<span class="integer val">#{code}</span>)
|
12
|
+
when String then %(<span class="string val">#{code.inspect}</span>)
|
13
|
+
when true, false then %(<span class="kw">#{code.inspect}</span>)
|
14
|
+
when nil then %(<span class="nil kw">#{code.inspect}</span>)
|
15
|
+
else code
|
16
|
+
end
|
17
|
+
end
|
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.1
|
4
|
+
version: 0.2.1
|
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: 2009-11
|
12
|
+
date: 2009-12-11 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,11 +30,12 @@ extensions: []
|
|
30
30
|
|
31
31
|
extra_rdoc_files:
|
32
32
|
- LICENSE
|
33
|
-
- README.
|
33
|
+
- README.md
|
34
34
|
files:
|
35
35
|
- .gitignore
|
36
|
+
- .yardopts
|
36
37
|
- LICENSE
|
37
|
-
- README.
|
38
|
+
- README.md
|
38
39
|
- Rakefile
|
39
40
|
- VERSION
|
40
41
|
- config.rb
|
@@ -42,14 +43,21 @@ files:
|
|
42
43
|
- docs.watchr
|
43
44
|
- dragonfly-rails.gemspec
|
44
45
|
- dragonfly.gemspec
|
45
|
-
-
|
46
|
+
- extra_docs/ActiveRecord.md
|
47
|
+
- extra_docs/Analysers.md
|
48
|
+
- extra_docs/DataStorage.md
|
49
|
+
- extra_docs/Encoding.md
|
50
|
+
- extra_docs/GettingStarted.md
|
51
|
+
- extra_docs/Processing.md
|
52
|
+
- extra_docs/Shortcuts.md
|
53
|
+
- extra_docs/UsingWithRails.md
|
54
|
+
- features/images.feature
|
55
|
+
- features/no_processing.feature
|
46
56
|
- features/steps/common_steps.rb
|
47
57
|
- features/steps/dragonfly_steps.rb
|
48
58
|
- features/support/env.rb
|
49
|
-
- features/support/image_helpers.rb
|
50
59
|
- generators/dragonfly_app/USAGE
|
51
60
|
- generators/dragonfly_app/dragonfly_app_generator.rb
|
52
|
-
- generators/dragonfly_app/templates/custom_processing.erb
|
53
61
|
- generators/dragonfly_app/templates/initializer.erb
|
54
62
|
- generators/dragonfly_app/templates/metal_file.erb
|
55
63
|
- irbrc.rb
|
@@ -59,7 +67,6 @@ files:
|
|
59
67
|
- lib/dragonfly/active_record_extensions/class_methods.rb
|
60
68
|
- lib/dragonfly/active_record_extensions/instance_methods.rb
|
61
69
|
- lib/dragonfly/active_record_extensions/validations.rb
|
62
|
-
- lib/dragonfly/analysis/analyser.rb
|
63
70
|
- lib/dragonfly/analysis/base.rb
|
64
71
|
- lib/dragonfly/analysis/file_command_analyser.rb
|
65
72
|
- lib/dragonfly/analysis/r_magick_analyser.rb
|
@@ -71,6 +78,8 @@ files:
|
|
71
78
|
- lib/dragonfly/data_storage/base64_data_store.rb
|
72
79
|
- lib/dragonfly/data_storage/file_data_store.rb
|
73
80
|
- lib/dragonfly/data_storage/transparent_data_store.rb
|
81
|
+
- lib/dragonfly/delegatable.rb
|
82
|
+
- lib/dragonfly/delegator.rb
|
74
83
|
- lib/dragonfly/encoding/base.rb
|
75
84
|
- lib/dragonfly/encoding/r_magick_encoder.rb
|
76
85
|
- lib/dragonfly/encoding/transparent_encoder.rb
|
@@ -78,7 +87,7 @@ files:
|
|
78
87
|
- lib/dragonfly/middleware.rb
|
79
88
|
- lib/dragonfly/middleware_with_cache.rb
|
80
89
|
- lib/dragonfly/parameters.rb
|
81
|
-
- lib/dragonfly/processing/
|
90
|
+
- lib/dragonfly/processing/base.rb
|
82
91
|
- lib/dragonfly/processing/r_magick_processor.rb
|
83
92
|
- lib/dragonfly/r_magick_configuration.rb
|
84
93
|
- lib/dragonfly/rails/images.rb
|
@@ -87,6 +96,7 @@ files:
|
|
87
96
|
- samples/beach.png
|
88
97
|
- samples/egg.png
|
89
98
|
- samples/round.gif
|
99
|
+
- samples/sample.docx
|
90
100
|
- samples/taj.jpg
|
91
101
|
- spec/argument_matchers.rb
|
92
102
|
- spec/dragonfly/active_record_extensions/attachment_spec.rb
|
@@ -95,12 +105,14 @@ files:
|
|
95
105
|
- spec/dragonfly/active_record_extensions/model_spec.rb
|
96
106
|
- spec/dragonfly/active_record_extensions/models.rb
|
97
107
|
- spec/dragonfly/active_record_extensions/spec_helper.rb
|
98
|
-
- spec/dragonfly/analysis/analyser_spec.rb
|
99
108
|
- spec/dragonfly/analysis/r_magick_analyser_spec.rb
|
100
109
|
- spec/dragonfly/app_spec.rb
|
101
110
|
- spec/dragonfly/configurable_spec.rb
|
102
111
|
- spec/dragonfly/data_storage/data_store_spec.rb
|
103
112
|
- spec/dragonfly/data_storage/file_data_store_spec.rb
|
113
|
+
- spec/dragonfly/delegatable_spec.rb
|
114
|
+
- spec/dragonfly/delegator_spec.rb
|
115
|
+
- spec/dragonfly/encoding/r_magick_encoder_spec.rb
|
104
116
|
- spec/dragonfly/extended_temp_object_spec.rb
|
105
117
|
- spec/dragonfly/middleware_spec.rb
|
106
118
|
- spec/dragonfly/middleware_with_cache_spec.rb
|
@@ -113,7 +125,12 @@ files:
|
|
113
125
|
- spec/image_matchers.rb
|
114
126
|
- spec/simple_matchers.rb
|
115
127
|
- spec/spec_helper.rb
|
116
|
-
|
128
|
+
- yard/handlers/configurable_attr_handler.rb
|
129
|
+
- yard/setup.rb
|
130
|
+
- yard/templates/default/fulldoc/html/css/common.css
|
131
|
+
- yard/templates/default/module/html/configuration_summary.erb
|
132
|
+
- yard/templates/default/module/setup.rb
|
133
|
+
has_rdoc: yard
|
117
134
|
homepage: http://github.com/markevans/dragonfly
|
118
135
|
licenses: []
|
119
136
|
|
@@ -149,12 +166,14 @@ test_files:
|
|
149
166
|
- spec/dragonfly/active_record_extensions/model_spec.rb
|
150
167
|
- spec/dragonfly/active_record_extensions/models.rb
|
151
168
|
- spec/dragonfly/active_record_extensions/spec_helper.rb
|
152
|
-
- spec/dragonfly/analysis/analyser_spec.rb
|
153
169
|
- spec/dragonfly/analysis/r_magick_analyser_spec.rb
|
154
170
|
- spec/dragonfly/app_spec.rb
|
155
171
|
- spec/dragonfly/configurable_spec.rb
|
156
172
|
- spec/dragonfly/data_storage/data_store_spec.rb
|
157
173
|
- spec/dragonfly/data_storage/file_data_store_spec.rb
|
174
|
+
- spec/dragonfly/delegatable_spec.rb
|
175
|
+
- spec/dragonfly/delegator_spec.rb
|
176
|
+
- spec/dragonfly/encoding/r_magick_encoder_spec.rb
|
158
177
|
- spec/dragonfly/extended_temp_object_spec.rb
|
159
178
|
- spec/dragonfly/middleware_spec.rb
|
160
179
|
- spec/dragonfly/middleware_with_cache_spec.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module <%= module_name %>
|
2
|
-
|
3
|
-
# Define any of your own custom processing methods here
|
4
|
-
# e.g.
|
5
|
-
# def my_processing_method(<%= temp_object_name %>, opts={})
|
6
|
-
# # ...do processing here - you can use methods like
|
7
|
-
# # <%= temp_object_name %>.data, <%= temp_object_name %>.path, etc.
|
8
|
-
# # (see Dragonfly::ExtendedTempObject for more details)
|
9
|
-
# #
|
10
|
-
# # the method must return a String, Tempfile, File, or Dragonfly::TempObject
|
11
|
-
# end
|
12
|
-
|
13
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
module Dragonfly
|
2
|
-
module Analysis
|
3
|
-
class Analyser
|
4
|
-
|
5
|
-
def initialize
|
6
|
-
@analysers = []
|
7
|
-
end
|
8
|
-
|
9
|
-
include Configurable
|
10
|
-
|
11
|
-
def register(analyser)
|
12
|
-
analysers.unshift(analyser)
|
13
|
-
end
|
14
|
-
configuration_method :register
|
15
|
-
|
16
|
-
def mime_type(temp_object)
|
17
|
-
analysers.each do |analyser|
|
18
|
-
mime_type = analyser.mime_type(temp_object)
|
19
|
-
return mime_type if mime_type
|
20
|
-
end
|
21
|
-
nil
|
22
|
-
end
|
23
|
-
|
24
|
-
def analysis_methods
|
25
|
-
analysers.map{|a| a.public_methods(false) }.flatten.uniq
|
26
|
-
end
|
27
|
-
|
28
|
-
def has_analysis_method?(method)
|
29
|
-
analysis_methods.include?(method.to_s)
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
attr_reader :analysers
|
35
|
-
|
36
|
-
def method_missing(meth, *args)
|
37
|
-
analysers.each do |analyser|
|
38
|
-
return analyser.send(meth, *args) if analyser.respond_to?(meth)
|
39
|
-
end
|
40
|
-
super
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|