dragonfly 0.6.2 → 0.7.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.

Files changed (157) hide show
  1. data/.gitignore +2 -0
  2. data/.specopts +2 -0
  3. data/.yardopts +11 -5
  4. data/Gemfile +22 -0
  5. data/Gemfile.rails.2.3.5 +13 -0
  6. data/History.md +49 -0
  7. data/README.md +18 -28
  8. data/Rakefile +24 -36
  9. data/VERSION +1 -1
  10. data/config.ru +4 -1
  11. data/dragonfly.gemspec +85 -99
  12. data/extra_docs/Analysers.md +66 -30
  13. data/extra_docs/Caching.md +22 -0
  14. data/extra_docs/Configuration.md +116 -0
  15. data/extra_docs/DataStorage.md +114 -14
  16. data/extra_docs/Encoding.md +62 -37
  17. data/extra_docs/GeneralUsage.md +118 -0
  18. data/extra_docs/Generators.md +92 -0
  19. data/extra_docs/Heroku.md +51 -0
  20. data/extra_docs/Index.md +8 -9
  21. data/extra_docs/MimeTypes.md +18 -17
  22. data/extra_docs/Models.md +251 -0
  23. data/extra_docs/Processing.md +94 -70
  24. data/extra_docs/Rack.md +53 -0
  25. data/extra_docs/Rails2.md +44 -0
  26. data/extra_docs/Rails3.md +51 -0
  27. data/extra_docs/Sinatra.md +21 -0
  28. data/extra_docs/URLs.md +114 -0
  29. data/features/images.feature +6 -7
  30. data/features/no_processing.feature +0 -6
  31. data/features/rails_2.3.5.feature +1 -1
  32. data/features/rails_3.0.0.rc.feature +8 -0
  33. data/features/steps/dragonfly_steps.rb +14 -12
  34. data/features/steps/rails_steps.rb +20 -9
  35. data/features/support/env.rb +10 -11
  36. data/fixtures/files/app/views/albums/new.html.erb +4 -4
  37. data/fixtures/files/app/views/albums/show.html.erb +1 -1
  38. data/fixtures/files/features/manage_album_images.feature +1 -1
  39. data/fixtures/files/features/step_definitions/{album_steps.rb → image_steps.rb} +4 -3
  40. data/fixtures/files/features/support/paths.rb +2 -0
  41. data/fixtures/files/features/text_images.feature +7 -0
  42. data/fixtures/rails_3.0.0.rc/template.rb +21 -0
  43. data/irbrc.rb +2 -1
  44. data/lib/dragonfly.rb +4 -16
  45. data/lib/dragonfly/{active_record_extensions.rb → active_model_extensions.rb} +1 -1
  46. data/lib/dragonfly/active_model_extensions/attachment.rb +146 -0
  47. data/lib/dragonfly/{active_record_extensions → active_model_extensions}/class_methods.rb +5 -6
  48. data/lib/dragonfly/{active_record_extensions → active_model_extensions}/instance_methods.rb +1 -1
  49. data/lib/dragonfly/{active_record_extensions → active_model_extensions}/validations.rb +5 -9
  50. data/lib/dragonfly/analyser.rb +59 -0
  51. data/lib/dragonfly/analysis/file_command_analyser.rb +1 -1
  52. data/lib/dragonfly/analysis/r_magick_analyser.rb +46 -31
  53. data/lib/dragonfly/app.rb +138 -173
  54. data/lib/dragonfly/config/heroku.rb +19 -0
  55. data/lib/dragonfly/config/r_magick.rb +37 -0
  56. data/lib/dragonfly/config/{rails_defaults.rb → rails.rb} +6 -7
  57. data/lib/dragonfly/configurable.rb +30 -27
  58. data/lib/dragonfly/core_ext/object.rb +1 -1
  59. data/lib/dragonfly/data_storage/file_data_store.rb +59 -26
  60. data/lib/dragonfly/data_storage/mongo_data_store.rb +65 -0
  61. data/lib/dragonfly/data_storage/s3data_store.rb +31 -12
  62. data/lib/dragonfly/encoder.rb +13 -0
  63. data/lib/dragonfly/encoding/r_magick_encoder.rb +10 -19
  64. data/lib/dragonfly/endpoint.rb +43 -0
  65. data/lib/dragonfly/function_manager.rb +65 -0
  66. data/lib/dragonfly/{processing/r_magick_text_processor.rb → generation/r_magick_generator.rb} +25 -11
  67. data/lib/dragonfly/generator.rb +9 -0
  68. data/lib/dragonfly/job.rb +290 -0
  69. data/lib/dragonfly/job_builder.rb +39 -0
  70. data/lib/dragonfly/job_definitions.rb +26 -0
  71. data/lib/dragonfly/job_endpoint.rb +17 -0
  72. data/lib/dragonfly/loggable.rb +28 -0
  73. data/lib/dragonfly/middleware.rb +21 -14
  74. data/lib/dragonfly/processing/r_magick_processor.rb +71 -48
  75. data/lib/dragonfly/processor.rb +9 -0
  76. data/lib/dragonfly/r_magick_utils.rb +24 -0
  77. data/lib/dragonfly/rails/images.rb +10 -7
  78. data/lib/dragonfly/routed_endpoint.rb +42 -0
  79. data/lib/dragonfly/serializer.rb +32 -0
  80. data/lib/dragonfly/simple_cache.rb +23 -0
  81. data/lib/dragonfly/simple_endpoint.rb +64 -0
  82. data/lib/dragonfly/temp_object.rb +77 -45
  83. data/spec/argument_matchers.rb +7 -17
  84. data/spec/dragonfly/active_model_extensions/active_model_setup.rb +97 -0
  85. data/spec/dragonfly/active_model_extensions/active_record_setup.rb +85 -0
  86. data/spec/dragonfly/{active_record_extensions → active_model_extensions}/model_spec.rb +282 -244
  87. data/spec/dragonfly/active_model_extensions/spec_helper.rb +11 -0
  88. data/spec/dragonfly/analyser_spec.rb +123 -0
  89. data/spec/dragonfly/analysis/file_command_analyser_spec.rb +2 -2
  90. data/spec/dragonfly/analysis/r_magick_analyser_spec.rb +10 -1
  91. data/spec/dragonfly/app_spec.rb +175 -69
  92. data/spec/dragonfly/configurable_spec.rb +14 -0
  93. data/spec/dragonfly/data_storage/data_store_spec.rb +36 -9
  94. data/spec/dragonfly/data_storage/file_data_store_spec.rb +61 -38
  95. data/spec/dragonfly/data_storage/mongo_data_store_spec.rb +18 -0
  96. data/spec/dragonfly/data_storage/s3_data_store_spec.rb +34 -39
  97. data/spec/dragonfly/deprecation_spec.rb +20 -0
  98. data/spec/dragonfly/function_manager_spec.rb +154 -0
  99. data/spec/dragonfly/generation/r_magick_generator_spec.rb +119 -0
  100. data/spec/dragonfly/job_builder_spec.rb +37 -0
  101. data/spec/dragonfly/job_definitions_spec.rb +35 -0
  102. data/spec/dragonfly/job_endpoint_spec.rb +66 -0
  103. data/spec/dragonfly/job_spec.rb +605 -0
  104. data/spec/dragonfly/loggable_spec.rb +80 -0
  105. data/spec/dragonfly/middleware_spec.rb +37 -17
  106. data/spec/dragonfly/processing/r_magick_processor_spec.rb +182 -166
  107. data/spec/dragonfly/routed_endpoint_spec.rb +48 -0
  108. data/spec/dragonfly/serializer_spec.rb +61 -0
  109. data/spec/dragonfly/simple_cache_spec.rb +27 -0
  110. data/spec/dragonfly/simple_endpoint_spec.rb +78 -0
  111. data/spec/dragonfly/temp_object_spec.rb +154 -119
  112. data/spec/simple_matchers.rb +22 -0
  113. data/spec/spec_helper.rb +28 -4
  114. data/yard/templates/default/layout/html/layout.erb +18 -11
  115. metadata +89 -190
  116. data/config.rb +0 -5
  117. data/extra_docs/ActiveRecord.md +0 -196
  118. data/extra_docs/ExampleUseCases.md +0 -189
  119. data/extra_docs/GettingStarted.md +0 -114
  120. data/extra_docs/Shortcuts.md +0 -118
  121. data/extra_docs/UsingWithRails.md +0 -81
  122. data/features/rails_3.0.0.beta3.feature +0 -7
  123. data/fixtures/rails_3.0.0.beta3/template.rb +0 -16
  124. data/lib/dragonfly/active_record_extensions/attachment.rb +0 -170
  125. data/lib/dragonfly/analyser_list.rb +0 -9
  126. data/lib/dragonfly/analysis/base.rb +0 -10
  127. data/lib/dragonfly/belongs_to_app.rb +0 -24
  128. data/lib/dragonfly/config/heroku_rails_images.rb +0 -23
  129. data/lib/dragonfly/config/r_magick_images.rb +0 -69
  130. data/lib/dragonfly/config/r_magick_text.rb +0 -25
  131. data/lib/dragonfly/config/rails_images.rb +0 -13
  132. data/lib/dragonfly/data_storage/base.rb +0 -21
  133. data/lib/dragonfly/data_storage/base64_data_store.rb +0 -23
  134. data/lib/dragonfly/data_storage/transparent_data_store.rb +0 -21
  135. data/lib/dragonfly/delegatable.rb +0 -14
  136. data/lib/dragonfly/delegator.rb +0 -62
  137. data/lib/dragonfly/encoder_list.rb +0 -9
  138. data/lib/dragonfly/encoding/base.rb +0 -14
  139. data/lib/dragonfly/encoding/transparent_encoder.rb +0 -14
  140. data/lib/dragonfly/extended_temp_object.rb +0 -120
  141. data/lib/dragonfly/parameters.rb +0 -163
  142. data/lib/dragonfly/processing/base.rb +0 -10
  143. data/lib/dragonfly/processor_list.rb +0 -9
  144. data/lib/dragonfly/url_handler.rb +0 -147
  145. data/spec/dragonfly/active_record_extensions/attachment_spec.rb +0 -8
  146. data/spec/dragonfly/active_record_extensions/migration.rb +0 -42
  147. data/spec/dragonfly/active_record_extensions/models.rb +0 -6
  148. data/spec/dragonfly/active_record_extensions/spec_helper.rb +0 -24
  149. data/spec/dragonfly/belongs_to_app_spec.rb +0 -55
  150. data/spec/dragonfly/delegatable_spec.rb +0 -32
  151. data/spec/dragonfly/delegator_spec.rb +0 -145
  152. data/spec/dragonfly/extended_temp_object_spec.rb +0 -71
  153. data/spec/dragonfly/parameters_spec.rb +0 -298
  154. data/spec/dragonfly/processing/r_magick_text_processor_spec.rb +0 -84
  155. data/spec/dragonfly/url_handler_spec.rb +0 -247
  156. data/spec/dragonfly_spec.rb +0 -16
  157. data/spec/ginger_scenarios.rb +0 -13
data/.gitignore CHANGED
@@ -8,3 +8,5 @@ doc
8
8
  tmp
9
9
  fixtures/*/tmp_app
10
10
  .ginger
11
+ .bundle
12
+ spec/spec.log
data/.specopts ADDED
@@ -0,0 +1,2 @@
1
+ --colour
2
+
data/.yardopts CHANGED
@@ -2,15 +2,21 @@
2
2
  -e yard/setup.rb
3
3
  -
4
4
  README.md
5
- extra_docs/GettingStarted.md
6
- extra_docs/UsingWithRails.md
7
- extra_docs/ActiveRecord.md
5
+ extra_docs/GeneralUsage.md
6
+ extra_docs/Rails2.md
7
+ extra_docs/Rails3.md
8
+ extra_docs/Rack.md
9
+ extra_docs/Sinatra.md
10
+ extra_docs/Heroku.md
11
+ extra_docs/Models.md
8
12
  extra_docs/DataStorage.md
9
- extra_docs/Shortcuts.md
10
13
  extra_docs/Analysers.md
11
14
  extra_docs/Processing.md
12
15
  extra_docs/Encoding.md
16
+ extra_docs/Generators.md
17
+ extra_docs/Configuration.md
18
+ extra_docs/URLs.md
19
+ extra_docs/Caching.md
13
20
  extra_docs/MimeTypes.md
14
- extra_docs/ExampleUseCases.md
15
21
  LICENSE
16
22
  History.md
data/Gemfile ADDED
@@ -0,0 +1,22 @@
1
+ source :rubygems
2
+
3
+ # These gems are needed for development and testing
4
+
5
+ gem 'aws-s3'
6
+ gem 'bson_ext'
7
+ gem 'capybara'
8
+ gem 'cucumber', '0.8.5'
9
+ gem 'cucumber-rails'
10
+ gem 'database_cleaner', '>= 0.5.0'
11
+ gem 'jeweler', '~> 1.4'
12
+ gem 'gherkin', '2.1.4' # 2.1.5 seems to segfault on Ruby 1.9.2
13
+ gem 'mongo'
14
+ gem 'nokogiri', '1.5.0.beta.2' # 1.4.3.1 segfaults on Ruby 1.9.2
15
+ gem 'rack', '~>1.1'
16
+ gem 'rack-cache'
17
+ gem 'rails', '3.0.0.rc', :require => nil
18
+ gem 'rake'
19
+ gem 'rmagick', '2.12.2', :require => nil
20
+ gem 'rspec', '~> 1.3'
21
+ gem 'sqlite3-ruby', '1.3.0' # 1.3.1 segfaults on Ruby 1.9.2
22
+ gem 'yard'
@@ -0,0 +1,13 @@
1
+ source :rubygems
2
+
3
+ gem 'capybara'
4
+ gem 'cucumber', '0.8.5'
5
+ gem 'cucumber-rails'
6
+ gem 'database_cleaner', '>= 0.5.0'
7
+ gem 'gherkin', '2.1.4'
8
+ gem 'nokogiri', '1.5.0.beta.2'
9
+ gem 'rack-cache', :require => nil
10
+ gem 'rails', '2.3.5', :require => nil
11
+ gem 'rmagick', '2.12.2', :require => nil
12
+ gem 'rspec', '~> 1.3'
13
+ gem 'sqlite3-ruby', '1.3.0'
data/History.md CHANGED
@@ -1,3 +1,52 @@
1
+ 0.7.0 (2010-08-25)
2
+ ==================
3
+
4
+ Features
5
+ --------
6
+ - Ability to chain processing, encoding
7
+ - Added Generators for arbitrary content generation
8
+ - 'fetch_file' method for easily getting local files
9
+ - ActiveModel support
10
+ - Mongoid support
11
+ - Better Sinatra, etc. support (using 'to_response')
12
+ - Data stores now store meta, name and format information too
13
+ - Added Mongo Data Store
14
+ - temp_objects maintain name, meta, etc. across processing, encoding, etc.
15
+ - added portrait? and landscape? to RMagick analyser
16
+ - Ability to add single custom processor/encoder/analyser/generator
17
+ - added flip and flop to RMagick processor
18
+ - ability to configure whether it trusts the file extension
19
+ - nice text response for root path
20
+ - ability to configure url host
21
+ - ability to override path_prefix/host when calling url
22
+ - routed endpoints
23
+ - simple endpoints
24
+ - more intelligent working out of Content-Type to send back
25
+
26
+ Fixes
27
+ -----
28
+ - proper use of ETags
29
+ - remove whitespace from file/s3 datastore uids
30
+ - dragonfly/rails/images url-encodes rack-cache config for windows users
31
+
32
+ Changes
33
+ -------
34
+ - Dragonfly::App[:images] -> Dragonfly[:images]
35
+ - Moved text/plasma generation into Generator
36
+ - Use of lazy 'Job' objects
37
+ - simplified shortcuts interface
38
+ - changed interface for attaching to ActiveRecord
39
+ - simplified saved configurations and allow referring to them as symbols
40
+ - Removed need for Base class for datastores, processors, analysers and encoders
41
+ - FileCommandAnalyser included in Rails config, not RMagick
42
+ - better use of logging module for sharing logs between classes
43
+ - mounting the app is down the middleware/elsewhere, not the app itself
44
+ - DOS protection off by default
45
+ - encoded urls
46
+ - got rid of unnecessary configurable sha_length
47
+
48
+
49
+
1
50
  0.6.2 (2010-06-24)
2
51
  ==================
3
52
  Features
data/README.md CHANGED
@@ -1,28 +1,17 @@
1
1
  Dragonfly
2
2
  ===========
3
3
 
4
- Dragonfly is a <a href="http://rack.rubyforge.org">Rack</a> framework for on-the-fly processing and encoding.
5
- It includes an extension for Ruby on Rails to enable easy image handling.
4
+ Dragonfly is a <a href="http://rack.rubyforge.org">Rack</a> framework for on-the-fly image handling.
6
5
 
7
- For the lazy Rails user
8
- -----------------------
9
- To use simply for image thumbnails etc. in Rails...
6
+ Ideal for using with Ruby on Rails (2.3 and 3), Sinatra and all that gubbins.
10
7
 
11
- **environment.rb** (Rails 2.3 only):
12
-
13
- config.gem 'rmagick', :lib => 'RMagick'
14
- config.gem 'rack-cache', :lib => 'rack/cache'
15
- config.gem 'dragonfly'
16
-
17
- **Gemfile** (Rails 3 only):
8
+ For the lazy Rails user...
9
+ --------------------------
10
+ **Gemfile**:
18
11
 
19
12
  gem 'rmagick', :require => 'RMagick'
20
13
  gem 'rack-cache', :require => 'rack/cache'
21
- gem 'dragonfly'
22
-
23
- The above assumes that you have http://gemcutter.org as one of your gem sources.
24
- If not you should add it, e.g. `gem source --add http://gemcutter.org` from the command line,
25
- or add `source http://gemcutter.org` to your Gemfile.
14
+ gem 'dragonfly', '~>0.7.0'
26
15
 
27
16
  **Initializer** (e.g. config/initializers/dragonfly.rb):
28
17
 
@@ -35,7 +24,8 @@ or add `source http://gemcutter.org` to your Gemfile.
35
24
  **Model**:
36
25
 
37
26
  class Album < ActiveRecord::Base
38
- image_accessor :cover_image # Defines reader/writer for cover_image
27
+ image_accessor :cover_image # 'image_accessor' is provided by Dragonfly
28
+ # this defines a reader/writer for cover_image
39
29
  # ...
40
30
  end
41
31
 
@@ -47,24 +37,23 @@ or add `source http://gemcutter.org` to your Gemfile.
47
37
  ...
48
38
  <% end %>
49
39
 
40
+ NB: REMEMBER THE MULTIPART BIT!!!
50
41
 
51
42
  **View** (to display):
52
43
 
53
- <%= image_tag @album.cover_image.url(:gif) %>
54
- <%= image_tag @album.cover_image.url('400x200') %>
55
- <%= image_tag @album.cover_image.url('100x100!', :png) %>
56
- <%= image_tag @album.cover_image.url('100x100#') %>
57
- <%= image_tag @album.cover_image.url('50x50+30+30sw', :tiff) %>
58
- <%= image_tag @album.cover_image.url(:rotate, 15) %>
44
+ <%= image_tag @album.cover_image.url %>
45
+ <%= image_tag @album.cover_image.thumb('400x200#').url %>
46
+ <%= image_tag @album.cover_image.jpg.url %>
47
+ <%= image_tag @album.cover_image.process(:greyscale).encode(:tiff).url %>
59
48
  ...etc.
60
49
 
61
50
  Using outside of rails, custom storage/processing/encoding/analysis, and more...
62
51
  --------------------------------------------------------------------------------
63
- Dragonfly is primarily a Rack app, the Rails part of it being nothing more than a separate layer on top of the main code, which means you can use it as a standalone app, or with Sinatra, Merb, etc.
52
+ Dragonfly is primarily a Rack app, so you can use it as a standalone app, or with Sinatra, Merb, etc.
64
53
 
65
- It is intended to be highly customizable, and is not limited to images, but any data type that could suit on-the-fly processing/encoding.
54
+ It's highly customizable, and works with any data type (not just images).
66
55
 
67
- For more info, consult the <a href="http://markevans.github.com/dragonfly">DOCUMENTATION</a>
56
+ For more info, consult the <a href="http://markevans.github.com/dragonfly"><big><strong>DOCUMENTATION</strong></big></a>
68
57
 
69
58
  Issues
70
59
  ======
@@ -76,7 +65,8 @@ Suggestions/Questions
76
65
 
77
66
  Credits
78
67
  =======
79
- - <a href="http://github.com/markevans">Mark Evans</a> (author)
68
+ - [Mark Evans](http://github.com/markevans) (author)
69
+
80
70
 
81
71
  Copyright
82
72
  ========
data/Rakefile CHANGED
@@ -4,22 +4,13 @@ begin
4
4
  require 'jeweler'
5
5
  Jeweler::Tasks.new do |s|
6
6
  s.name = "dragonfly"
7
- s.summary = %Q{Dragonfly is an on-the-fly Rack processing/encoding framework.
8
- It includes an extension for Ruby on Rails for easy image handling}
7
+ s.summary = %Q{Dragonfly is an on-the-fly Rack-based image handling framework.
8
+ It is suitable for use with Rails, Sinatra and other web frameworks. Although it's mainly used for images,
9
+ it can handle any content type.}
9
10
  s.email = "mark@new-bamboo.co.uk"
10
11
  s.homepage = "http://github.com/markevans/dragonfly"
11
12
  s.authors = ["Mark Evans"]
12
13
  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 'cucumber-rails'
20
- s.add_development_dependency 'activerecord'
21
- s.add_development_dependency 'sqlite3-ruby'
22
- s.add_development_dependency 'ginger'
23
14
  end
24
15
  Jeweler::GemcutterTasks.new
25
16
  rescue LoadError
@@ -49,41 +40,38 @@ rescue LoadError
49
40
  puts "YARD is not available. To run the documentation tasks, install it with: (sudo) gem install yard"
50
41
  end
51
42
 
52
- begin
53
- require 'spec/rake/spectask'
54
- Spec::Rake::SpecTask.new(:spec) do |t|
55
- t.libs << 'lib' << 'spec'
56
- t.spec_files = FileList['spec/**/*_spec.rb']
57
- end
43
+ desc "Run all the specs"
44
+ task :spec do
45
+ system "bundle exec spec -O .specopts spec/dragonfly"
46
+ end
58
47
 
59
- Spec::Rake::SpecTask.new(:rcov) do |t|
60
- t.libs << 'lib' << 'spec'
61
- t.spec_files = FileList['spec/**/*_spec.rb']
62
- t.rcov = true
63
- end
64
- rescue LoadError
65
- puts "RSpec is not available. To run tests, install it with: (sudo) gem install rspec"
48
+ desc "Run the active model specs"
49
+ task :model_spec do
50
+ system "bundle exec spec -O .specopts spec/dragonfly/active_model_extensions"
66
51
  end
67
52
 
68
- begin
69
- require 'cucumber/rake/task'
70
- Cucumber::Rake::Task.new(:features)
71
- rescue LoadError
72
- puts "Cucumber is not available. To run features, install it with: (sudo) gem install cucumber"
53
+ desc "Run the active_record specs (AR 2.3)"
54
+ task :model_spec_235 do
55
+ system "export BUNDLE_GEMFILE=Gemfile.rails.2.3.5 && bundle exec spec -O .specopts spec/dragonfly/active_model_extensions"
73
56
  end
74
57
 
75
- begin
76
- require 'ginger'
77
- rescue LoadError
78
- puts "To run 'rake', to test everything, you need the Ginger gem. Install it with: (sudo) gem install ginger"
58
+ task :features do
59
+ system "bundle exec cucumber"
79
60
  end
61
+
80
62
  task :default do
81
- system 'ginger spec && rake features'
63
+ # Do everything!!!
64
+ puts "*** Running all the specs using the default Gemfile ***"
65
+ Rake::Task['spec'].invoke
66
+ puts "*** Running the model specs with Gemfile.rails.2.3.5 ***"
67
+ Rake::Task['model_spec_235'].invoke
68
+ puts "*** Running the features ***"
69
+ Rake::Task['features'].invoke
82
70
  end
83
71
 
84
72
  desc 'Set up a Rails app ready for testing'
85
73
  namespace :rails do
86
-
74
+
87
75
  task :setup do
88
76
  version = ENV['RAILS_VERSION']
89
77
  raise "Please give a RAILS_VERSION, e.g. RAILS_VERSION=2.3.5" unless version
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.7.0
data/config.ru CHANGED
@@ -1,6 +1,9 @@
1
- require File.dirname(__FILE__) + '/config'
2
1
  require 'rubygems'
3
2
  require 'rack/cache'
3
+ require File.dirname(__FILE__) + '/lib/dragonfly'
4
+
5
+ APP = Dragonfly[:images].configure_with(:rmagick) do |c|
6
+ end
4
7
 
5
8
  use Rack::Cache,
6
9
  :verbose => true,
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.6.2"
8
+ s.version = "0.7.0"
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-06-24}
12
+ s.date = %q{2010-08-25}
13
13
  s.email = %q{mark@new-bamboo.co.uk}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
@@ -17,31 +17,39 @@ Gem::Specification.new do |s|
17
17
  ]
18
18
  s.files = [
19
19
  ".gitignore",
20
+ ".specopts",
20
21
  ".yardopts",
22
+ "Gemfile",
23
+ "Gemfile.rails.2.3.5",
21
24
  "History.md",
22
25
  "LICENSE",
23
26
  "README.md",
24
27
  "Rakefile",
25
28
  "VERSION",
26
- "config.rb",
27
29
  "config.ru",
28
30
  "docs.watchr",
29
31
  "dragonfly.gemspec",
30
- "extra_docs/ActiveRecord.md",
31
32
  "extra_docs/Analysers.md",
33
+ "extra_docs/Caching.md",
34
+ "extra_docs/Configuration.md",
32
35
  "extra_docs/DataStorage.md",
33
36
  "extra_docs/Encoding.md",
34
- "extra_docs/ExampleUseCases.md",
35
- "extra_docs/GettingStarted.md",
37
+ "extra_docs/GeneralUsage.md",
38
+ "extra_docs/Generators.md",
39
+ "extra_docs/Heroku.md",
36
40
  "extra_docs/Index.md",
37
41
  "extra_docs/MimeTypes.md",
42
+ "extra_docs/Models.md",
38
43
  "extra_docs/Processing.md",
39
- "extra_docs/Shortcuts.md",
40
- "extra_docs/UsingWithRails.md",
44
+ "extra_docs/Rack.md",
45
+ "extra_docs/Rails2.md",
46
+ "extra_docs/Rails3.md",
47
+ "extra_docs/Sinatra.md",
48
+ "extra_docs/URLs.md",
41
49
  "features/images.feature",
42
50
  "features/no_processing.feature",
43
51
  "features/rails_2.3.5.feature",
44
- "features/rails_3.0.0.beta3.feature",
52
+ "features/rails_3.0.0.rc.feature",
45
53
  "features/steps/common_steps.rb",
46
54
  "features/steps/dragonfly_steps.rb",
47
55
  "features/steps/rails_steps.rb",
@@ -51,87 +59,91 @@ Gem::Specification.new do |s|
51
59
  "fixtures/files/app/views/albums/show.html.erb",
52
60
  "fixtures/files/config/initializers/dragonfly.rb",
53
61
  "fixtures/files/features/manage_album_images.feature",
54
- "fixtures/files/features/step_definitions/album_steps.rb",
62
+ "fixtures/files/features/step_definitions/image_steps.rb",
55
63
  "fixtures/files/features/support/paths.rb",
64
+ "fixtures/files/features/text_images.feature",
56
65
  "fixtures/rails_2.3.5/template.rb",
57
- "fixtures/rails_3.0.0.beta3/template.rb",
66
+ "fixtures/rails_3.0.0.rc/template.rb",
58
67
  "irbrc.rb",
59
68
  "lib/dragonfly.rb",
60
- "lib/dragonfly/active_record_extensions.rb",
61
- "lib/dragonfly/active_record_extensions/attachment.rb",
62
- "lib/dragonfly/active_record_extensions/class_methods.rb",
63
- "lib/dragonfly/active_record_extensions/instance_methods.rb",
64
- "lib/dragonfly/active_record_extensions/validations.rb",
65
- "lib/dragonfly/analyser_list.rb",
66
- "lib/dragonfly/analysis/base.rb",
69
+ "lib/dragonfly/active_model_extensions.rb",
70
+ "lib/dragonfly/active_model_extensions/attachment.rb",
71
+ "lib/dragonfly/active_model_extensions/class_methods.rb",
72
+ "lib/dragonfly/active_model_extensions/instance_methods.rb",
73
+ "lib/dragonfly/active_model_extensions/validations.rb",
74
+ "lib/dragonfly/analyser.rb",
67
75
  "lib/dragonfly/analysis/file_command_analyser.rb",
68
76
  "lib/dragonfly/analysis/r_magick_analyser.rb",
69
77
  "lib/dragonfly/app.rb",
70
- "lib/dragonfly/belongs_to_app.rb",
71
- "lib/dragonfly/config/heroku_rails_images.rb",
72
- "lib/dragonfly/config/r_magick_images.rb",
73
- "lib/dragonfly/config/r_magick_text.rb",
74
- "lib/dragonfly/config/rails_defaults.rb",
75
- "lib/dragonfly/config/rails_images.rb",
78
+ "lib/dragonfly/config/heroku.rb",
79
+ "lib/dragonfly/config/r_magick.rb",
80
+ "lib/dragonfly/config/rails.rb",
76
81
  "lib/dragonfly/configurable.rb",
77
82
  "lib/dragonfly/core_ext/object.rb",
78
83
  "lib/dragonfly/core_ext/string.rb",
79
84
  "lib/dragonfly/core_ext/symbol.rb",
80
85
  "lib/dragonfly/data_storage.rb",
81
- "lib/dragonfly/data_storage/base.rb",
82
- "lib/dragonfly/data_storage/base64_data_store.rb",
83
86
  "lib/dragonfly/data_storage/file_data_store.rb",
87
+ "lib/dragonfly/data_storage/mongo_data_store.rb",
84
88
  "lib/dragonfly/data_storage/s3data_store.rb",
85
- "lib/dragonfly/data_storage/transparent_data_store.rb",
86
- "lib/dragonfly/delegatable.rb",
87
- "lib/dragonfly/delegator.rb",
88
- "lib/dragonfly/encoder_list.rb",
89
- "lib/dragonfly/encoding/base.rb",
89
+ "lib/dragonfly/encoder.rb",
90
90
  "lib/dragonfly/encoding/r_magick_encoder.rb",
91
- "lib/dragonfly/encoding/transparent_encoder.rb",
92
- "lib/dragonfly/extended_temp_object.rb",
91
+ "lib/dragonfly/endpoint.rb",
92
+ "lib/dragonfly/function_manager.rb",
93
+ "lib/dragonfly/generation/r_magick_generator.rb",
94
+ "lib/dragonfly/generator.rb",
95
+ "lib/dragonfly/job.rb",
96
+ "lib/dragonfly/job_builder.rb",
97
+ "lib/dragonfly/job_definitions.rb",
98
+ "lib/dragonfly/job_endpoint.rb",
99
+ "lib/dragonfly/loggable.rb",
93
100
  "lib/dragonfly/middleware.rb",
94
- "lib/dragonfly/parameters.rb",
95
- "lib/dragonfly/processing/base.rb",
96
101
  "lib/dragonfly/processing/r_magick_processor.rb",
97
- "lib/dragonfly/processing/r_magick_text_processor.rb",
98
- "lib/dragonfly/processor_list.rb",
102
+ "lib/dragonfly/processor.rb",
103
+ "lib/dragonfly/r_magick_utils.rb",
99
104
  "lib/dragonfly/rails/images.rb",
105
+ "lib/dragonfly/routed_endpoint.rb",
106
+ "lib/dragonfly/serializer.rb",
107
+ "lib/dragonfly/simple_cache.rb",
108
+ "lib/dragonfly/simple_endpoint.rb",
100
109
  "lib/dragonfly/temp_object.rb",
101
- "lib/dragonfly/url_handler.rb",
102
110
  "samples/beach.png",
103
111
  "samples/egg.png",
104
112
  "samples/round.gif",
105
113
  "samples/sample.docx",
106
114
  "samples/taj.jpg",
107
115
  "spec/argument_matchers.rb",
108
- "spec/dragonfly/active_record_extensions/attachment_spec.rb",
109
- "spec/dragonfly/active_record_extensions/migration.rb",
110
- "spec/dragonfly/active_record_extensions/model_spec.rb",
111
- "spec/dragonfly/active_record_extensions/models.rb",
112
- "spec/dragonfly/active_record_extensions/spec_helper.rb",
116
+ "spec/dragonfly/active_model_extensions/active_model_setup.rb",
117
+ "spec/dragonfly/active_model_extensions/active_record_setup.rb",
118
+ "spec/dragonfly/active_model_extensions/model_spec.rb",
119
+ "spec/dragonfly/active_model_extensions/spec_helper.rb",
120
+ "spec/dragonfly/analyser_spec.rb",
113
121
  "spec/dragonfly/analysis/file_command_analyser_spec.rb",
114
122
  "spec/dragonfly/analysis/r_magick_analyser_spec.rb",
115
123
  "spec/dragonfly/app_spec.rb",
116
- "spec/dragonfly/belongs_to_app_spec.rb",
117
124
  "spec/dragonfly/configurable_spec.rb",
118
125
  "spec/dragonfly/core_ext/string_spec.rb",
119
126
  "spec/dragonfly/core_ext/symbol_spec.rb",
120
127
  "spec/dragonfly/data_storage/data_store_spec.rb",
121
128
  "spec/dragonfly/data_storage/file_data_store_spec.rb",
129
+ "spec/dragonfly/data_storage/mongo_data_store_spec.rb",
122
130
  "spec/dragonfly/data_storage/s3_data_store_spec.rb",
123
- "spec/dragonfly/delegatable_spec.rb",
124
- "spec/dragonfly/delegator_spec.rb",
131
+ "spec/dragonfly/deprecation_spec.rb",
125
132
  "spec/dragonfly/encoding/r_magick_encoder_spec.rb",
126
- "spec/dragonfly/extended_temp_object_spec.rb",
133
+ "spec/dragonfly/function_manager_spec.rb",
134
+ "spec/dragonfly/generation/r_magick_generator_spec.rb",
135
+ "spec/dragonfly/job_builder_spec.rb",
136
+ "spec/dragonfly/job_definitions_spec.rb",
137
+ "spec/dragonfly/job_endpoint_spec.rb",
138
+ "spec/dragonfly/job_spec.rb",
139
+ "spec/dragonfly/loggable_spec.rb",
127
140
  "spec/dragonfly/middleware_spec.rb",
128
- "spec/dragonfly/parameters_spec.rb",
129
141
  "spec/dragonfly/processing/r_magick_processor_spec.rb",
130
- "spec/dragonfly/processing/r_magick_text_processor_spec.rb",
142
+ "spec/dragonfly/routed_endpoint_spec.rb",
143
+ "spec/dragonfly/serializer_spec.rb",
144
+ "spec/dragonfly/simple_cache_spec.rb",
145
+ "spec/dragonfly/simple_endpoint_spec.rb",
131
146
  "spec/dragonfly/temp_object_spec.rb",
132
- "spec/dragonfly/url_handler_spec.rb",
133
- "spec/dragonfly_spec.rb",
134
- "spec/ginger_scenarios.rb",
135
147
  "spec/image_matchers.rb",
136
148
  "spec/simple_matchers.rb",
137
149
  "spec/spec_helper.rb",
@@ -145,37 +157,41 @@ Gem::Specification.new do |s|
145
157
  s.homepage = %q{http://github.com/markevans/dragonfly}
146
158
  s.rdoc_options = ["--charset=UTF-8"]
147
159
  s.require_paths = ["lib"]
148
- s.rubygems_version = %q{1.3.6}
149
- s.summary = %q{Dragonfly is an on-the-fly Rack processing/encoding framework. It includes an extension for Ruby on Rails for easy image handling}
160
+ s.rubygems_version = %q{1.3.7}
161
+ s.summary = %q{Dragonfly is an on-the-fly Rack-based image handling framework. It is suitable for use with Rails, Sinatra and other web frameworks. Although it's mainly used for images, it can handle any content type.}
150
162
  s.test_files = [
151
163
  "spec/argument_matchers.rb",
152
- "spec/dragonfly/active_record_extensions/attachment_spec.rb",
153
- "spec/dragonfly/active_record_extensions/migration.rb",
154
- "spec/dragonfly/active_record_extensions/model_spec.rb",
155
- "spec/dragonfly/active_record_extensions/models.rb",
156
- "spec/dragonfly/active_record_extensions/spec_helper.rb",
164
+ "spec/dragonfly/active_model_extensions/active_model_setup.rb",
165
+ "spec/dragonfly/active_model_extensions/active_record_setup.rb",
166
+ "spec/dragonfly/active_model_extensions/model_spec.rb",
167
+ "spec/dragonfly/active_model_extensions/spec_helper.rb",
168
+ "spec/dragonfly/analyser_spec.rb",
157
169
  "spec/dragonfly/analysis/file_command_analyser_spec.rb",
158
170
  "spec/dragonfly/analysis/r_magick_analyser_spec.rb",
159
171
  "spec/dragonfly/app_spec.rb",
160
- "spec/dragonfly/belongs_to_app_spec.rb",
161
172
  "spec/dragonfly/configurable_spec.rb",
162
173
  "spec/dragonfly/core_ext/string_spec.rb",
163
174
  "spec/dragonfly/core_ext/symbol_spec.rb",
164
175
  "spec/dragonfly/data_storage/data_store_spec.rb",
165
176
  "spec/dragonfly/data_storage/file_data_store_spec.rb",
177
+ "spec/dragonfly/data_storage/mongo_data_store_spec.rb",
166
178
  "spec/dragonfly/data_storage/s3_data_store_spec.rb",
167
- "spec/dragonfly/delegatable_spec.rb",
168
- "spec/dragonfly/delegator_spec.rb",
179
+ "spec/dragonfly/deprecation_spec.rb",
169
180
  "spec/dragonfly/encoding/r_magick_encoder_spec.rb",
170
- "spec/dragonfly/extended_temp_object_spec.rb",
181
+ "spec/dragonfly/function_manager_spec.rb",
182
+ "spec/dragonfly/generation/r_magick_generator_spec.rb",
183
+ "spec/dragonfly/job_builder_spec.rb",
184
+ "spec/dragonfly/job_definitions_spec.rb",
185
+ "spec/dragonfly/job_endpoint_spec.rb",
186
+ "spec/dragonfly/job_spec.rb",
187
+ "spec/dragonfly/loggable_spec.rb",
171
188
  "spec/dragonfly/middleware_spec.rb",
172
- "spec/dragonfly/parameters_spec.rb",
173
189
  "spec/dragonfly/processing/r_magick_processor_spec.rb",
174
- "spec/dragonfly/processing/r_magick_text_processor_spec.rb",
190
+ "spec/dragonfly/routed_endpoint_spec.rb",
191
+ "spec/dragonfly/serializer_spec.rb",
192
+ "spec/dragonfly/simple_cache_spec.rb",
193
+ "spec/dragonfly/simple_endpoint_spec.rb",
175
194
  "spec/dragonfly/temp_object_spec.rb",
176
- "spec/dragonfly/url_handler_spec.rb",
177
- "spec/dragonfly_spec.rb",
178
- "spec/ginger_scenarios.rb",
179
195
  "spec/image_matchers.rb",
180
196
  "spec/simple_matchers.rb",
181
197
  "spec/spec_helper.rb"
@@ -185,43 +201,13 @@ Gem::Specification.new do |s|
185
201
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
186
202
  s.specification_version = 3
187
203
 
188
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
204
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
189
205
  s.add_runtime_dependency(%q<rack>, [">= 0"])
190
- s.add_development_dependency(%q<jeweler>, [">= 0"])
191
- s.add_development_dependency(%q<yard>, [">= 0"])
192
- s.add_development_dependency(%q<rmagick>, [">= 0"])
193
- s.add_development_dependency(%q<aws-s3>, [">= 0"])
194
- s.add_development_dependency(%q<rspec>, [">= 0"])
195
- s.add_development_dependency(%q<cucumber>, [">= 0"])
196
- s.add_development_dependency(%q<cucumber-rails>, [">= 0"])
197
- s.add_development_dependency(%q<activerecord>, [">= 0"])
198
- s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
199
- s.add_development_dependency(%q<ginger>, [">= 0"])
200
206
  else
201
207
  s.add_dependency(%q<rack>, [">= 0"])
202
- s.add_dependency(%q<jeweler>, [">= 0"])
203
- s.add_dependency(%q<yard>, [">= 0"])
204
- s.add_dependency(%q<rmagick>, [">= 0"])
205
- s.add_dependency(%q<aws-s3>, [">= 0"])
206
- s.add_dependency(%q<rspec>, [">= 0"])
207
- s.add_dependency(%q<cucumber>, [">= 0"])
208
- s.add_dependency(%q<cucumber-rails>, [">= 0"])
209
- s.add_dependency(%q<activerecord>, [">= 0"])
210
- s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
211
- s.add_dependency(%q<ginger>, [">= 0"])
212
208
  end
213
209
  else
214
210
  s.add_dependency(%q<rack>, [">= 0"])
215
- s.add_dependency(%q<jeweler>, [">= 0"])
216
- s.add_dependency(%q<yard>, [">= 0"])
217
- s.add_dependency(%q<rmagick>, [">= 0"])
218
- s.add_dependency(%q<aws-s3>, [">= 0"])
219
- s.add_dependency(%q<rspec>, [">= 0"])
220
- s.add_dependency(%q<cucumber>, [">= 0"])
221
- s.add_dependency(%q<cucumber-rails>, [">= 0"])
222
- s.add_dependency(%q<activerecord>, [">= 0"])
223
- s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
224
- s.add_dependency(%q<ginger>, [">= 0"])
225
211
  end
226
212
  end
227
213