dragonfly 0.9.15 → 1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +1 -8
- data/.travis.yml +11 -0
- data/Gemfile +1 -0
- data/History.md +52 -2
- data/LICENSE +1 -1
- data/README.md +38 -95
- data/dev/grid.jpg +0 -0
- data/dev/irbrc.rb +27 -0
- data/dev/rails_template.rb +38 -0
- data/dev/test.ru +56 -0
- data/dev/test_rails +19 -0
- data/dragonfly.gemspec +3 -21
- data/lib/dragonfly.rb +45 -44
- data/lib/dragonfly/app.rb +175 -96
- data/lib/dragonfly/configurable.rb +71 -170
- data/lib/dragonfly/content.rb +211 -0
- data/lib/dragonfly/core_ext/object.rb +1 -6
- data/lib/dragonfly/file_data_store.rb +197 -0
- data/lib/dragonfly/image_magick/analysers/image_properties.rb +23 -0
- data/lib/dragonfly/image_magick/generators/convert.rb +19 -0
- data/lib/dragonfly/image_magick/generators/plain.rb +26 -0
- data/lib/dragonfly/image_magick/generators/plasma.rb +25 -0
- data/lib/dragonfly/image_magick/generators/text.rb +127 -0
- data/lib/dragonfly/image_magick/plugin.rb +83 -0
- data/lib/dragonfly/image_magick/processors/convert.rb +29 -0
- data/lib/dragonfly/image_magick/processors/encode.rb +18 -0
- data/lib/dragonfly/image_magick/processors/thumb.rb +76 -0
- data/lib/dragonfly/job.rb +118 -134
- data/lib/dragonfly/job_endpoint.rb +2 -0
- data/lib/dragonfly/memory_data_store.rb +34 -0
- data/lib/dragonfly/middleware.rb +5 -3
- data/lib/dragonfly/{active_model_extensions.rb → model.rb} +5 -3
- data/lib/dragonfly/{active_model_extensions → model}/attachment.rb +40 -35
- data/lib/dragonfly/{active_model_extensions → model}/attachment_class_methods.rb +36 -40
- data/lib/dragonfly/model/class_methods.rb +109 -0
- data/lib/dragonfly/{active_model_extensions → model}/instance_methods.rb +2 -2
- data/lib/dragonfly/{active_model_extensions → model}/validations.rb +17 -12
- data/lib/dragonfly/railtie.rb +8 -6
- data/lib/dragonfly/register.rb +27 -0
- data/lib/dragonfly/response.rb +47 -52
- data/lib/dragonfly/routed_endpoint.rb +4 -0
- data/lib/dragonfly/serializer.rb +15 -5
- data/lib/dragonfly/server.rb +56 -29
- data/lib/dragonfly/shell.rb +12 -23
- data/lib/dragonfly/spec/data_store_examples.rb +64 -0
- data/lib/dragonfly/temp_object.rb +32 -47
- data/lib/dragonfly/url_attributes.rb +19 -22
- data/lib/dragonfly/url_mapper.rb +3 -0
- data/lib/dragonfly/utils.rb +12 -0
- data/lib/dragonfly/version.rb +1 -1
- data/lib/dragonfly/whitelist.rb +19 -0
- data/lib/rails/generators/dragonfly/USAGE +8 -0
- data/lib/rails/generators/dragonfly/dragonfly_generator.rb +24 -0
- data/lib/rails/generators/dragonfly/templates/initializer.rb.erb +27 -0
- data/samples/gif.gif +0 -0
- data/spec/dragonfly/app_spec.rb +270 -64
- data/spec/dragonfly/configurable_spec.rb +142 -418
- data/spec/dragonfly/content_spec.rb +353 -0
- data/spec/dragonfly/cookie_monster_spec.rb +2 -1
- data/spec/dragonfly/file_data_store_spec.rb +301 -0
- data/spec/dragonfly/image_magick/analysers/image_properties_spec.rb +20 -0
- data/spec/dragonfly/image_magick/generators/convert_spec.rb +19 -0
- data/spec/dragonfly/image_magick/generators/plain_spec.rb +50 -0
- data/spec/dragonfly/image_magick/generators/plasma_spec.rb +32 -0
- data/spec/dragonfly/image_magick/generators/text_spec.rb +77 -0
- data/spec/dragonfly/image_magick/plugin_spec.rb +131 -0
- data/spec/dragonfly/image_magick/processors/convert_spec.rb +56 -0
- data/spec/dragonfly/image_magick/processors/thumb_spec.rb +173 -0
- data/spec/dragonfly/job_endpoint_spec.rb +30 -73
- data/spec/dragonfly/job_spec.rb +280 -608
- data/spec/dragonfly/memory_data_store_spec.rb +20 -0
- data/spec/dragonfly/middleware_spec.rb +47 -27
- data/spec/dragonfly/{active_model_extensions → model}/model_spec.rb +331 -555
- data/spec/dragonfly/model/validations_spec.rb +196 -0
- data/spec/dragonfly/register_spec.rb +35 -0
- data/spec/dragonfly/routed_endpoint_spec.rb +6 -6
- data/spec/dragonfly/serializer_spec.rb +13 -15
- data/spec/dragonfly/server_spec.rb +122 -46
- data/spec/dragonfly/shell_spec.rb +43 -24
- data/spec/dragonfly/temp_object_spec.rb +69 -94
- data/spec/dragonfly/url_attributes_spec.rb +49 -0
- data/spec/dragonfly/utils_spec.rb +32 -0
- data/spec/dragonfly/whitelist_spec.rb +30 -0
- data/spec/dragonfly_spec.rb +43 -0
- data/spec/fixtures/deprecated_stored_content/eggs.bonus +1 -0
- data/spec/fixtures/deprecated_stored_content/eggs.bonus.meta +1 -0
- data/spec/functional/configuration_spec.rb +19 -0
- data/spec/functional/model_urls_spec.rb +43 -41
- data/spec/functional/remote_on_the_fly_spec.rb +14 -16
- data/spec/functional/shell_commands_spec.rb +24 -14
- data/spec/functional/to_response_spec.rb +10 -10
- data/spec/functional/urls_spec.rb +5 -3
- data/spec/spec_helper.rb +23 -28
- data/spec/support/argument_matchers.rb +7 -8
- data/spec/support/image_matchers.rb +14 -36
- data/spec/support/model_helpers.rb +97 -0
- data/spec/support/simple_matchers.rb +12 -0
- metadata +92 -393
- data/.yardopts +0 -29
- data/Rakefile +0 -36
- data/config.ru +0 -14
- data/docs.watchr +0 -1
- data/extra_docs/Analysers.md +0 -68
- data/extra_docs/Caching.md +0 -23
- data/extra_docs/Configuration.md +0 -149
- data/extra_docs/Couch.md +0 -49
- data/extra_docs/DataStorage.md +0 -226
- data/extra_docs/Encoding.md +0 -67
- data/extra_docs/ExampleUseCases.md +0 -116
- data/extra_docs/GeneralUsage.md +0 -105
- data/extra_docs/Generators.md +0 -68
- data/extra_docs/Heroku.md +0 -50
- data/extra_docs/ImageMagick.md +0 -136
- data/extra_docs/Index.md +0 -33
- data/extra_docs/MimeTypes.md +0 -40
- data/extra_docs/Models.md +0 -441
- data/extra_docs/Mongo.md +0 -42
- data/extra_docs/Processing.md +0 -77
- data/extra_docs/Rack.md +0 -52
- data/extra_docs/Rails2.md +0 -57
- data/extra_docs/Rails3.md +0 -56
- data/extra_docs/ServingRemotely.md +0 -104
- data/extra_docs/Sinatra.md +0 -25
- data/extra_docs/URLs.md +0 -203
- data/features/images.feature +0 -47
- data/features/no_processing.feature +0 -14
- data/features/rails.feature +0 -8
- data/features/steps/common_steps.rb +0 -8
- data/features/steps/dragonfly_steps.rb +0 -66
- data/features/steps/rails_steps.rb +0 -40
- data/features/support/env.rb +0 -13
- data/features/support/setup.rb +0 -41
- data/fixtures/rails/files/app/models/album.rb +0 -6
- data/fixtures/rails/files/app/views/albums/new.html.erb +0 -7
- data/fixtures/rails/files/app/views/albums/show.html.erb +0 -6
- data/fixtures/rails/files/config/initializers/dragonfly.rb +0 -4
- data/fixtures/rails/files/features/manage_album_images.feature +0 -38
- data/fixtures/rails/files/features/step_definitions/helper_steps.rb +0 -7
- data/fixtures/rails/files/features/step_definitions/image_steps.rb +0 -25
- data/fixtures/rails/files/features/step_definitions/web_steps.rb +0 -189
- data/fixtures/rails/files/features/support/paths.rb +0 -17
- data/fixtures/rails/files/features/text_images.feature +0 -7
- data/fixtures/rails/template.rb +0 -20
- data/irbrc.rb +0 -19
- data/lib/dragonfly/active_model_extensions/class_methods.rb +0 -98
- data/lib/dragonfly/analyser.rb +0 -58
- data/lib/dragonfly/analysis/file_command_analyser.rb +0 -33
- data/lib/dragonfly/analysis/image_magick_analyser.rb +0 -6
- data/lib/dragonfly/config/heroku.rb +0 -26
- data/lib/dragonfly/config/image_magick.rb +0 -6
- data/lib/dragonfly/config/rails.rb +0 -20
- data/lib/dragonfly/data_storage.rb +0 -11
- data/lib/dragonfly/data_storage/couch_data_store.rb +0 -83
- data/lib/dragonfly/data_storage/file_data_store.rb +0 -144
- data/lib/dragonfly/data_storage/mongo_data_store.rb +0 -96
- data/lib/dragonfly/data_storage/s3data_store.rb +0 -168
- data/lib/dragonfly/encoder.rb +0 -13
- data/lib/dragonfly/encoding/image_magick_encoder.rb +0 -6
- data/lib/dragonfly/function_manager.rb +0 -67
- data/lib/dragonfly/generation/image_magick_generator.rb +0 -6
- data/lib/dragonfly/generator.rb +0 -9
- data/lib/dragonfly/image_magick/analyser.rb +0 -53
- data/lib/dragonfly/image_magick/config.rb +0 -44
- data/lib/dragonfly/image_magick/encoder.rb +0 -57
- data/lib/dragonfly/image_magick/generator.rb +0 -147
- data/lib/dragonfly/image_magick/processor.rb +0 -114
- data/lib/dragonfly/image_magick/utils.rb +0 -46
- data/lib/dragonfly/image_magick_utils.rb +0 -4
- data/lib/dragonfly/job_builder.rb +0 -39
- data/lib/dragonfly/job_definitions.rb +0 -30
- data/lib/dragonfly/loggable.rb +0 -28
- data/lib/dragonfly/processing/image_magick_processor.rb +0 -6
- data/lib/dragonfly/processor.rb +0 -9
- data/lib/dragonfly/rails/images.rb +0 -32
- data/lib/dragonfly/simple_cache.rb +0 -23
- data/spec/dragonfly/active_model_extensions/spec_helper.rb +0 -95
- data/spec/dragonfly/analyser_spec.rb +0 -123
- data/spec/dragonfly/analysis/file_command_analyser_spec.rb +0 -49
- data/spec/dragonfly/data_storage/couch_data_store_spec.rb +0 -84
- data/spec/dragonfly/data_storage/file_data_store_spec.rb +0 -308
- data/spec/dragonfly/data_storage/mongo_data_store_spec.rb +0 -81
- data/spec/dragonfly/data_storage/s3_data_store_spec.rb +0 -277
- data/spec/dragonfly/data_storage/shared_data_store_examples.rb +0 -77
- data/spec/dragonfly/function_manager_spec.rb +0 -154
- data/spec/dragonfly/image_magick/analyser_spec.rb +0 -73
- data/spec/dragonfly/image_magick/encoder_spec.rb +0 -46
- data/spec/dragonfly/image_magick/generator_spec.rb +0 -178
- data/spec/dragonfly/image_magick/processor_spec.rb +0 -293
- data/spec/dragonfly/job_builder_spec.rb +0 -37
- data/spec/dragonfly/job_definitions_spec.rb +0 -57
- data/spec/dragonfly/loggable_spec.rb +0 -80
- data/spec/dragonfly/simple_cache_spec.rb +0 -27
- data/spec/dragonfly/url_attributes.rb +0 -47
- data/spec/functional/deprecations_spec.rb +0 -51
- data/spec/functional/image_magick_app_spec.rb +0 -27
- data/spec/test_imagemagick.ru +0 -49
- data/yard/handlers/configurable_attr_handler.rb +0 -38
- data/yard/setup.rb +0 -15
- data/yard/templates/default/fulldoc/html/css/common.css +0 -109
- data/yard/templates/default/layout/html/layout.erb +0 -93
- data/yard/templates/default/module/html/configuration_summary.erb +0 -31
- data/yard/templates/default/module/setup.rb +0 -17
@@ -1,93 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<%= erb(:headers) %>
|
6
|
-
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata">
|
7
|
-
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=PT+Sans">
|
8
|
-
<script type="text/javascript" charset="utf-8">
|
9
|
-
(function($){
|
10
|
-
// YARD automatically creates a table of contents
|
11
|
-
// Let's place it inside .col1, instead of #content
|
12
|
-
$(document).ready(function(){
|
13
|
-
$('#toc').prependTo($('.col1'));
|
14
|
-
<% if options[:file] == 'extra_docs/Index.md' %>
|
15
|
-
$('#toc').hide();
|
16
|
-
<% end %>
|
17
|
-
});
|
18
|
-
})(jQuery);
|
19
|
-
</script>
|
20
|
-
</head>
|
21
|
-
<body>
|
22
|
-
<!-- GOOGLE ANALYTICS -->
|
23
|
-
<script type="text/javascript">
|
24
|
-
|
25
|
-
var _gaq = _gaq || [];
|
26
|
-
_gaq.push(['_setAccount', 'UA-16382932-1']);
|
27
|
-
_gaq.push(['_trackPageview']);
|
28
|
-
|
29
|
-
(function() {
|
30
|
-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
31
|
-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
32
|
-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
33
|
-
})();
|
34
|
-
|
35
|
-
</script>
|
36
|
-
<!-- *************** -->
|
37
|
-
|
38
|
-
<script type="text/javascript" charset="utf-8">
|
39
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
40
|
-
</script>
|
41
|
-
|
42
|
-
<div id="header" class="clearfix">
|
43
|
-
<%#= erb(:breadcrumb) %>
|
44
|
-
<div id="logo">DRAGONFLY (v <%= DRAGONFLY_VERSION %>)</div>
|
45
|
-
<%= erb(:search) %>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
<div>
|
49
|
-
<iframe id="search_frame"></iframe>
|
50
|
-
</div>
|
51
|
-
|
52
|
-
<div id="content" class="clearfix">
|
53
|
-
<div class="col1">
|
54
|
-
<%= yieldall %>
|
55
|
-
</div>
|
56
|
-
<div class="col2">
|
57
|
-
<ul class="main_files clearfix">
|
58
|
-
<%= [
|
59
|
-
['Index', 'Home'],
|
60
|
-
['README', 'Quick start for Rails (README)'],
|
61
|
-
['GeneralUsage', 'General usage'],
|
62
|
-
['Rails2', 'Rails 2.3'],
|
63
|
-
['Rails3', 'Rails 3'],
|
64
|
-
['Models', 'Models'],
|
65
|
-
['ImageMagick', 'ImageMagick'],
|
66
|
-
['Rack', 'Rack'],
|
67
|
-
['Sinatra', 'Sinatra'],
|
68
|
-
['Heroku', 'Heroku'],
|
69
|
-
['Mongo', 'Mongo'],
|
70
|
-
['Couch', 'Couch'],
|
71
|
-
['DataStorage', 'Data Storage'],
|
72
|
-
['Analysers', 'Analysers'],
|
73
|
-
['Processing', 'Processing'],
|
74
|
-
['Encoding', 'Encoding'],
|
75
|
-
['Generators', 'Generators'],
|
76
|
-
['Configuration', 'Configuration'],
|
77
|
-
['URLs', 'URLs / Endpoints'],
|
78
|
-
['MimeTypes', 'Mime Types'],
|
79
|
-
['Caching', 'Caching'],
|
80
|
-
['ServingRemotely', 'Serving Remotely'],
|
81
|
-
['ExampleUseCases', 'Example Use Cases'],
|
82
|
-
['History', 'History'],
|
83
|
-
].map{|(file, text)|
|
84
|
-
"<li>#{link_file(file, text)}</li>"
|
85
|
-
}.join
|
86
|
-
%>
|
87
|
-
</ul>
|
88
|
-
</div>
|
89
|
-
</div>
|
90
|
-
|
91
|
-
<%= erb(:footer) %>
|
92
|
-
</body>
|
93
|
-
</html>
|
@@ -1,31 +0,0 @@
|
|
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 %>
|
@@ -1,17 +0,0 @@
|
|
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
|