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.

Files changed (203) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -8
  3. data/.travis.yml +11 -0
  4. data/Gemfile +1 -0
  5. data/History.md +52 -2
  6. data/LICENSE +1 -1
  7. data/README.md +38 -95
  8. data/dev/grid.jpg +0 -0
  9. data/dev/irbrc.rb +27 -0
  10. data/dev/rails_template.rb +38 -0
  11. data/dev/test.ru +56 -0
  12. data/dev/test_rails +19 -0
  13. data/dragonfly.gemspec +3 -21
  14. data/lib/dragonfly.rb +45 -44
  15. data/lib/dragonfly/app.rb +175 -96
  16. data/lib/dragonfly/configurable.rb +71 -170
  17. data/lib/dragonfly/content.rb +211 -0
  18. data/lib/dragonfly/core_ext/object.rb +1 -6
  19. data/lib/dragonfly/file_data_store.rb +197 -0
  20. data/lib/dragonfly/image_magick/analysers/image_properties.rb +23 -0
  21. data/lib/dragonfly/image_magick/generators/convert.rb +19 -0
  22. data/lib/dragonfly/image_magick/generators/plain.rb +26 -0
  23. data/lib/dragonfly/image_magick/generators/plasma.rb +25 -0
  24. data/lib/dragonfly/image_magick/generators/text.rb +127 -0
  25. data/lib/dragonfly/image_magick/plugin.rb +83 -0
  26. data/lib/dragonfly/image_magick/processors/convert.rb +29 -0
  27. data/lib/dragonfly/image_magick/processors/encode.rb +18 -0
  28. data/lib/dragonfly/image_magick/processors/thumb.rb +76 -0
  29. data/lib/dragonfly/job.rb +118 -134
  30. data/lib/dragonfly/job_endpoint.rb +2 -0
  31. data/lib/dragonfly/memory_data_store.rb +34 -0
  32. data/lib/dragonfly/middleware.rb +5 -3
  33. data/lib/dragonfly/{active_model_extensions.rb → model.rb} +5 -3
  34. data/lib/dragonfly/{active_model_extensions → model}/attachment.rb +40 -35
  35. data/lib/dragonfly/{active_model_extensions → model}/attachment_class_methods.rb +36 -40
  36. data/lib/dragonfly/model/class_methods.rb +109 -0
  37. data/lib/dragonfly/{active_model_extensions → model}/instance_methods.rb +2 -2
  38. data/lib/dragonfly/{active_model_extensions → model}/validations.rb +17 -12
  39. data/lib/dragonfly/railtie.rb +8 -6
  40. data/lib/dragonfly/register.rb +27 -0
  41. data/lib/dragonfly/response.rb +47 -52
  42. data/lib/dragonfly/routed_endpoint.rb +4 -0
  43. data/lib/dragonfly/serializer.rb +15 -5
  44. data/lib/dragonfly/server.rb +56 -29
  45. data/lib/dragonfly/shell.rb +12 -23
  46. data/lib/dragonfly/spec/data_store_examples.rb +64 -0
  47. data/lib/dragonfly/temp_object.rb +32 -47
  48. data/lib/dragonfly/url_attributes.rb +19 -22
  49. data/lib/dragonfly/url_mapper.rb +3 -0
  50. data/lib/dragonfly/utils.rb +12 -0
  51. data/lib/dragonfly/version.rb +1 -1
  52. data/lib/dragonfly/whitelist.rb +19 -0
  53. data/lib/rails/generators/dragonfly/USAGE +8 -0
  54. data/lib/rails/generators/dragonfly/dragonfly_generator.rb +24 -0
  55. data/lib/rails/generators/dragonfly/templates/initializer.rb.erb +27 -0
  56. data/samples/gif.gif +0 -0
  57. data/spec/dragonfly/app_spec.rb +270 -64
  58. data/spec/dragonfly/configurable_spec.rb +142 -418
  59. data/spec/dragonfly/content_spec.rb +353 -0
  60. data/spec/dragonfly/cookie_monster_spec.rb +2 -1
  61. data/spec/dragonfly/file_data_store_spec.rb +301 -0
  62. data/spec/dragonfly/image_magick/analysers/image_properties_spec.rb +20 -0
  63. data/spec/dragonfly/image_magick/generators/convert_spec.rb +19 -0
  64. data/spec/dragonfly/image_magick/generators/plain_spec.rb +50 -0
  65. data/spec/dragonfly/image_magick/generators/plasma_spec.rb +32 -0
  66. data/spec/dragonfly/image_magick/generators/text_spec.rb +77 -0
  67. data/spec/dragonfly/image_magick/plugin_spec.rb +131 -0
  68. data/spec/dragonfly/image_magick/processors/convert_spec.rb +56 -0
  69. data/spec/dragonfly/image_magick/processors/thumb_spec.rb +173 -0
  70. data/spec/dragonfly/job_endpoint_spec.rb +30 -73
  71. data/spec/dragonfly/job_spec.rb +280 -608
  72. data/spec/dragonfly/memory_data_store_spec.rb +20 -0
  73. data/spec/dragonfly/middleware_spec.rb +47 -27
  74. data/spec/dragonfly/{active_model_extensions → model}/model_spec.rb +331 -555
  75. data/spec/dragonfly/model/validations_spec.rb +196 -0
  76. data/spec/dragonfly/register_spec.rb +35 -0
  77. data/spec/dragonfly/routed_endpoint_spec.rb +6 -6
  78. data/spec/dragonfly/serializer_spec.rb +13 -15
  79. data/spec/dragonfly/server_spec.rb +122 -46
  80. data/spec/dragonfly/shell_spec.rb +43 -24
  81. data/spec/dragonfly/temp_object_spec.rb +69 -94
  82. data/spec/dragonfly/url_attributes_spec.rb +49 -0
  83. data/spec/dragonfly/utils_spec.rb +32 -0
  84. data/spec/dragonfly/whitelist_spec.rb +30 -0
  85. data/spec/dragonfly_spec.rb +43 -0
  86. data/spec/fixtures/deprecated_stored_content/eggs.bonus +1 -0
  87. data/spec/fixtures/deprecated_stored_content/eggs.bonus.meta +1 -0
  88. data/spec/functional/configuration_spec.rb +19 -0
  89. data/spec/functional/model_urls_spec.rb +43 -41
  90. data/spec/functional/remote_on_the_fly_spec.rb +14 -16
  91. data/spec/functional/shell_commands_spec.rb +24 -14
  92. data/spec/functional/to_response_spec.rb +10 -10
  93. data/spec/functional/urls_spec.rb +5 -3
  94. data/spec/spec_helper.rb +23 -28
  95. data/spec/support/argument_matchers.rb +7 -8
  96. data/spec/support/image_matchers.rb +14 -36
  97. data/spec/support/model_helpers.rb +97 -0
  98. data/spec/support/simple_matchers.rb +12 -0
  99. metadata +92 -393
  100. data/.yardopts +0 -29
  101. data/Rakefile +0 -36
  102. data/config.ru +0 -14
  103. data/docs.watchr +0 -1
  104. data/extra_docs/Analysers.md +0 -68
  105. data/extra_docs/Caching.md +0 -23
  106. data/extra_docs/Configuration.md +0 -149
  107. data/extra_docs/Couch.md +0 -49
  108. data/extra_docs/DataStorage.md +0 -226
  109. data/extra_docs/Encoding.md +0 -67
  110. data/extra_docs/ExampleUseCases.md +0 -116
  111. data/extra_docs/GeneralUsage.md +0 -105
  112. data/extra_docs/Generators.md +0 -68
  113. data/extra_docs/Heroku.md +0 -50
  114. data/extra_docs/ImageMagick.md +0 -136
  115. data/extra_docs/Index.md +0 -33
  116. data/extra_docs/MimeTypes.md +0 -40
  117. data/extra_docs/Models.md +0 -441
  118. data/extra_docs/Mongo.md +0 -42
  119. data/extra_docs/Processing.md +0 -77
  120. data/extra_docs/Rack.md +0 -52
  121. data/extra_docs/Rails2.md +0 -57
  122. data/extra_docs/Rails3.md +0 -56
  123. data/extra_docs/ServingRemotely.md +0 -104
  124. data/extra_docs/Sinatra.md +0 -25
  125. data/extra_docs/URLs.md +0 -203
  126. data/features/images.feature +0 -47
  127. data/features/no_processing.feature +0 -14
  128. data/features/rails.feature +0 -8
  129. data/features/steps/common_steps.rb +0 -8
  130. data/features/steps/dragonfly_steps.rb +0 -66
  131. data/features/steps/rails_steps.rb +0 -40
  132. data/features/support/env.rb +0 -13
  133. data/features/support/setup.rb +0 -41
  134. data/fixtures/rails/files/app/models/album.rb +0 -6
  135. data/fixtures/rails/files/app/views/albums/new.html.erb +0 -7
  136. data/fixtures/rails/files/app/views/albums/show.html.erb +0 -6
  137. data/fixtures/rails/files/config/initializers/dragonfly.rb +0 -4
  138. data/fixtures/rails/files/features/manage_album_images.feature +0 -38
  139. data/fixtures/rails/files/features/step_definitions/helper_steps.rb +0 -7
  140. data/fixtures/rails/files/features/step_definitions/image_steps.rb +0 -25
  141. data/fixtures/rails/files/features/step_definitions/web_steps.rb +0 -189
  142. data/fixtures/rails/files/features/support/paths.rb +0 -17
  143. data/fixtures/rails/files/features/text_images.feature +0 -7
  144. data/fixtures/rails/template.rb +0 -20
  145. data/irbrc.rb +0 -19
  146. data/lib/dragonfly/active_model_extensions/class_methods.rb +0 -98
  147. data/lib/dragonfly/analyser.rb +0 -58
  148. data/lib/dragonfly/analysis/file_command_analyser.rb +0 -33
  149. data/lib/dragonfly/analysis/image_magick_analyser.rb +0 -6
  150. data/lib/dragonfly/config/heroku.rb +0 -26
  151. data/lib/dragonfly/config/image_magick.rb +0 -6
  152. data/lib/dragonfly/config/rails.rb +0 -20
  153. data/lib/dragonfly/data_storage.rb +0 -11
  154. data/lib/dragonfly/data_storage/couch_data_store.rb +0 -83
  155. data/lib/dragonfly/data_storage/file_data_store.rb +0 -144
  156. data/lib/dragonfly/data_storage/mongo_data_store.rb +0 -96
  157. data/lib/dragonfly/data_storage/s3data_store.rb +0 -168
  158. data/lib/dragonfly/encoder.rb +0 -13
  159. data/lib/dragonfly/encoding/image_magick_encoder.rb +0 -6
  160. data/lib/dragonfly/function_manager.rb +0 -67
  161. data/lib/dragonfly/generation/image_magick_generator.rb +0 -6
  162. data/lib/dragonfly/generator.rb +0 -9
  163. data/lib/dragonfly/image_magick/analyser.rb +0 -53
  164. data/lib/dragonfly/image_magick/config.rb +0 -44
  165. data/lib/dragonfly/image_magick/encoder.rb +0 -57
  166. data/lib/dragonfly/image_magick/generator.rb +0 -147
  167. data/lib/dragonfly/image_magick/processor.rb +0 -114
  168. data/lib/dragonfly/image_magick/utils.rb +0 -46
  169. data/lib/dragonfly/image_magick_utils.rb +0 -4
  170. data/lib/dragonfly/job_builder.rb +0 -39
  171. data/lib/dragonfly/job_definitions.rb +0 -30
  172. data/lib/dragonfly/loggable.rb +0 -28
  173. data/lib/dragonfly/processing/image_magick_processor.rb +0 -6
  174. data/lib/dragonfly/processor.rb +0 -9
  175. data/lib/dragonfly/rails/images.rb +0 -32
  176. data/lib/dragonfly/simple_cache.rb +0 -23
  177. data/spec/dragonfly/active_model_extensions/spec_helper.rb +0 -95
  178. data/spec/dragonfly/analyser_spec.rb +0 -123
  179. data/spec/dragonfly/analysis/file_command_analyser_spec.rb +0 -49
  180. data/spec/dragonfly/data_storage/couch_data_store_spec.rb +0 -84
  181. data/spec/dragonfly/data_storage/file_data_store_spec.rb +0 -308
  182. data/spec/dragonfly/data_storage/mongo_data_store_spec.rb +0 -81
  183. data/spec/dragonfly/data_storage/s3_data_store_spec.rb +0 -277
  184. data/spec/dragonfly/data_storage/shared_data_store_examples.rb +0 -77
  185. data/spec/dragonfly/function_manager_spec.rb +0 -154
  186. data/spec/dragonfly/image_magick/analyser_spec.rb +0 -73
  187. data/spec/dragonfly/image_magick/encoder_spec.rb +0 -46
  188. data/spec/dragonfly/image_magick/generator_spec.rb +0 -178
  189. data/spec/dragonfly/image_magick/processor_spec.rb +0 -293
  190. data/spec/dragonfly/job_builder_spec.rb +0 -37
  191. data/spec/dragonfly/job_definitions_spec.rb +0 -57
  192. data/spec/dragonfly/loggable_spec.rb +0 -80
  193. data/spec/dragonfly/simple_cache_spec.rb +0 -27
  194. data/spec/dragonfly/url_attributes.rb +0 -47
  195. data/spec/functional/deprecations_spec.rb +0 -51
  196. data/spec/functional/image_magick_app_spec.rb +0 -27
  197. data/spec/test_imagemagick.ru +0 -49
  198. data/yard/handlers/configurable_attr_handler.rb +0 -38
  199. data/yard/setup.rb +0 -15
  200. data/yard/templates/default/fulldoc/html/css/common.css +0 -109
  201. data/yard/templates/default/layout/html/layout.erb +0 -93
  202. data/yard/templates/default/module/html/configuration_summary.erb +0 -31
  203. data/yard/templates/default/module/setup.rb +0 -17
@@ -1,37 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Dragonfly::JobBuilder do
4
-
5
- describe "a multi-step job" do
6
-
7
- before(:each) do
8
- @job_builder = Dragonfly::JobBuilder.new do |size, format|
9
- process :thumb, size
10
- encode format unless format.nil?
11
- end
12
- end
13
-
14
- it "should correctly call job steps" do
15
- job = mock
16
- job.should_receive(:process).with(:thumb, '30x30#').and_return(job2=mock)
17
- job2.should_receive(:encode).with(:jpg).and_return(job3=mock)
18
- @job_builder.build(job, '30x30#', :jpg).should == job3
19
- end
20
-
21
- it "should work consistently with bang methods" do
22
- job = mock
23
- job.should_receive(:process!).with(:thumb, '30x30#').and_return(job)
24
- job.should_receive(:encode!).with(:jpg).and_return(job)
25
- @job_builder.build!(job, '30x30#', :jpg).should == job
26
- end
27
-
28
- it "should yield nil if the arg isn't passed in" do
29
- job = mock
30
- job.should_receive(:process).with(:thumb, '30x30#').and_return(job2=mock)
31
- job2.should_not_receive(:encode)
32
- @job_builder.build(job, '30x30#').should == job2
33
- end
34
-
35
- end
36
-
37
- end
@@ -1,57 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Dragonfly::JobDefinitions do
4
-
5
- describe "defining jobs" do
6
-
7
- before(:each) do
8
- @job_definitions = Dragonfly::JobDefinitions.new
9
- @object = Object.new
10
- @object.extend @job_definitions
11
- end
12
-
13
- describe "a simple job" do
14
-
15
- before(:each) do
16
- @job_definitions.add :thumb do |size|
17
- process :thumb, size
18
- end
19
- end
20
-
21
- it "correctly call job steps" do
22
- @object.should_receive(:process).with(:thumb, '30x30#').and_return(job=mock)
23
- @object.thumb('30x30#').should == job
24
- end
25
-
26
- it "should correctly call job steps when bang is given" do
27
- @object.should_receive(:process!).with(:thumb, '30x30#').and_return(@object)
28
- @object.thumb!('30x30#').should == @object
29
- end
30
-
31
- end
32
-
33
- end
34
-
35
-
36
- describe "#definition_names" do
37
-
38
- before(:each) do
39
- @job_definitions = Dragonfly::JobDefinitions.new
40
- @object = Object.new
41
- @object.extend @job_definitions
42
- end
43
-
44
- it "should provide an empty list when no jobs have been defined" do
45
- @job_definitions.definition_names.should == []
46
- end
47
-
48
- it "should contain the job name when one is defined" do
49
- @job_definitions.add :foo do |size|
50
- process :thumb, size
51
- end
52
- @job_definitions.definition_names.should eq [:foo]
53
- end
54
-
55
- end
56
-
57
- end
@@ -1,80 +0,0 @@
1
- require 'spec_helper'
2
-
3
- class Testoast
4
- include Dragonfly::Loggable
5
- end
6
-
7
- describe Dragonfly::Loggable do
8
-
9
- before(:each) do
10
- @object = Testoast.new
11
- end
12
-
13
- shared_examples_for "common" do
14
- it "should return a log" do
15
- @object.log.should be_a(Logger)
16
- end
17
- it "should cache the log" do
18
- @object.log.should == @object.log
19
- end
20
- end
21
-
22
- describe "without being set" do
23
- it "should return the log object as nil" do
24
- @object.log_object.should be_nil
25
- end
26
- it_should_behave_like 'common'
27
- end
28
-
29
- describe "when set" do
30
- before(:each) do
31
- @log = Logger.new($stdout)
32
- @object.log = @log
33
- end
34
- it "should return the new log" do
35
- @object.log.should == @log
36
- end
37
- it "should return the log object" do
38
- @object.log_object.should == @log
39
- end
40
- it_should_behave_like 'common'
41
- end
42
-
43
- describe "when set as a proc" do
44
- before(:each) do
45
- @log = Logger.new($stdout)
46
- @object.log = proc{ @log }
47
- end
48
- it "should return the new log" do
49
- @object.log.should == @log
50
- end
51
- it "should return the log object" do
52
- @object.log_object.should be_a(Proc)
53
- end
54
- it "should allow for changing logs" do
55
- logs = [@log]
56
- @object.log = proc{ logs[0] }
57
- @object.log.should == @log
58
-
59
- new_log = Logger.new($stdout)
60
- logs[0] = new_log
61
-
62
- @object.log.should == new_log
63
- end
64
- it_should_behave_like 'common'
65
- end
66
-
67
- describe "sharing logs" do
68
- before(:each) do
69
- @log = Logger.new($stdout)
70
- @obj1 = Testoast.new
71
- @obj2 = Testoast.new
72
- end
73
- it "should enable sharing logs" do
74
- @obj1.log = proc{ @log }
75
- @obj2.use_same_log_as(@obj1)
76
- @obj2.log.should == @log
77
- end
78
- end
79
-
80
- end
@@ -1,27 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Dragonfly::SimpleCache do
4
-
5
- before(:each) do
6
- @cache = Dragonfly::SimpleCache.new(2)
7
- end
8
-
9
- it "should act as a normal hash" do
10
- @cache[:egg] = 'four'
11
- @cache[:egg].should == 'four'
12
- end
13
-
14
- it "should allow filling up to the limit" do
15
- @cache[:a] = 1
16
- @cache[:b] = 2
17
- @cache.should == {:a => 1, :b => 2}
18
- end
19
-
20
- it "should get rid of the first added when full" do
21
- @cache[:a] = 1
22
- @cache[:b] = 2
23
- @cache[:c] = 3
24
- @cache.should == {:b => 2, :c => 3}
25
- end
26
-
27
- end
@@ -1,47 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Dragonfly::UrlAttributes do
4
-
5
- before(:each) do
6
- @hash = Dragonfly::UrlAttributes.new
7
- end
8
-
9
- describe "name" do
10
- it "should default to nil" do
11
- @hash.name.should be_nil
12
- end
13
- it "should return the name if set" do
14
- @hash[:name] = 'long.pigs'
15
- @hash.name.should == 'long.pigs'
16
- end
17
- it "should allow setting via an accessor" do
18
- @hash.name = 'john.doe'
19
- @hash[:name].should == 'john.doe'
20
- end
21
- end
22
-
23
- describe "sanity check for use of HasFilename" do
24
- it "should provide ext and basename" do
25
- @hash.name = 'dog.leg'
26
- @hash.basename.should == 'dog'
27
- @hash.ext.should == 'leg'
28
- end
29
- end
30
-
31
- describe "slice" do
32
- it "should return a subset of the params" do
33
- hash = Dragonfly::UrlAttributes[:a => 1, :b => 2, :c => 3]
34
- hash.slice(:a, :b).should == {:a => 1, :b => 2}
35
- end
36
- it "should use the method instead of the param for basename" do
37
- Dragonfly::UrlAttributes[:name => 'hello.ted'].slice(:basename).should == {:basename => 'hello'}
38
- end
39
- it "should use the method instead of the param for ext" do
40
- Dragonfly::UrlAttributes[:name => 'hello.ted'].slice(:ext).should == {:ext => 'ted'}
41
- end
42
- it "should treat strings like symbols" do
43
- Dragonfly::UrlAttributes[:yog => 'gurt', :john => 'doe'].slice('yog').should == {:yog => 'gurt'}
44
- end
45
- end
46
-
47
- end
@@ -1,51 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'deprecations' do
4
-
5
- before(:each) do
6
- @app = test_app
7
- end
8
-
9
- describe "url_suffix" do
10
- it "should give an appropriate error" do
11
- @app.configure do |c|
12
- expect{
13
- c.url_suffix = 'darble'
14
- }.to raise_error(NoMethodError, /deprecated.*please use url_format/)
15
- end
16
- end
17
- end
18
-
19
- describe "url_path_prefix" do
20
- it "should give an appropriate error" do
21
- @app.configure do |c|
22
- expect{
23
- c.url_path_prefix = '/darble'
24
- }.to raise_error(NoMethodError, /deprecated.*please use url_format/)
25
- end
26
- end
27
- end
28
-
29
- describe "middleware" do
30
- it "should give an appropriate error" do
31
- app = Rack::Builder.new do
32
- use Dragonfly::Middleware, :images, '/media'
33
- run proc{[200, {}, []]}
34
- end
35
- expect{
36
- app.call({})
37
- }.to raise_error(ArgumentError, /deprecated/)
38
- end
39
- end
40
-
41
- describe "infer_mime_type_from_file_ext" do
42
- it "should give an appropriate error" do
43
- @app.configure do |c|
44
- expect{
45
- c.infer_mime_type_from_file_ext = false
46
- }.to raise_error(NoMethodError, /deprecated.*please use trust_file_extensions = false/)
47
- end
48
- end
49
- end
50
-
51
- end
@@ -1,27 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "a configured imagemagick app" do
4
-
5
- before(:each) do
6
- @app = test_app.configure_with(:imagemagick)
7
- end
8
-
9
- describe "convert command path" do
10
- before(:each) do
11
- @processor = @app.processor.get_registered(Dragonfly::ImageMagick::Processor)
12
- end
13
-
14
- it "should default to 'convert'" do
15
- @processor.convert_command.should == 'convert'
16
- end
17
-
18
- it "should change when configured through the app" do
19
- @app.configure do |c|
20
- c.convert_command = '/usr/eggs'
21
- end
22
- @processor.convert_command.should == '/usr/eggs'
23
- end
24
-
25
- end
26
-
27
- end
@@ -1,49 +0,0 @@
1
- require "rubygems"
2
- require "bundler/setup"
3
- $:.unshift(File.expand_path('../../lib', __FILE__))
4
- require 'dragonfly'
5
-
6
- ROOT = (File.expand_path('../..', __FILE__))
7
- APP = Dragonfly[:images].configure_with(:imagemagick).configure do |c|
8
- c.url_format = '/images/:job'
9
- c.allow_fetch_file = true
10
- end
11
-
12
- def row(geometry)
13
- image = APP.fetch_file(ROOT + '/samples/beach.png').thumb('100x100#')
14
- %(<tr>
15
- <th>#{geometry}</th>
16
- <th><img src="#{image.url}" /></th>
17
- <th><img src="#{image.thumb(geometry).url}" /></th>
18
- </tr>)
19
- end
20
-
21
- use Dragonfly::Middleware, :images
22
- run proc{[
23
- 200,
24
- {'Content-Type' => 'text/html'},
25
- [%(
26
- <table>
27
- <tr>
28
- <th>Geometry</th>
29
- <th>Original(100x100)</th>
30
- <th>Thumb</th>
31
- </tr>
32
- #{[
33
- row('80x60'),
34
- row('80x60!'),
35
- row('80x'),
36
- row('x60'),
37
- row('80x60>'),
38
- row('80x60<'),
39
- row('50x50%'),
40
- row('80x60^'),
41
- row('2000@'),
42
- row('80x60#'),
43
- row('80x60#ne'),
44
- row('80x60se'),
45
- row('80x60+5+35')
46
- ].join}
47
- </table>
48
- )]
49
- ]}
@@ -1,38 +0,0 @@
1
- class ConfigurableAttrHandler < YARD::Handlers::Ruby::Legacy::Base
2
- handles(/^\s*configurable_attr/)
3
-
4
- def process
5
- namespace[: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
- namespace[: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
-
@@ -1,15 +0,0 @@
1
- this_dir = File.dirname(__FILE__)
2
-
3
- YARD::Templates::Engine.register_template_path(this_dir + '/templates')
4
- Dir[this_dir + '/handlers/*.rb'].each do |file|
5
- require File.expand_path(file)
6
- end
7
- YARD::Parser::SourceParser.parser_type = :ruby18
8
-
9
- version = ENV['DRAGONFLY_VERSION']
10
- DRAGONFLY_VERSION = if version
11
- puts "Setting the version in the docs to #{version}"
12
- version
13
- else
14
- File.read(this_dir + '/../VERSION').strip
15
- end
@@ -1,109 +0,0 @@
1
- /* Overrides for yard documentation */
2
-
3
- /* Clearfix */
4
- .clearfix:after {
5
- content: ".";
6
- display: block;
7
- clear: both;
8
- visibility: hidden;
9
- line-height: 0;
10
- height: 0;
11
- }
12
-
13
- .clearfix {
14
- display: inline-block;
15
- }
16
-
17
- html[xmlns] .clearfix {
18
- display: block;
19
- }
20
-
21
- * html .clearfix {
22
- height: 1%;
23
- }
24
- /************/
25
-
26
- body {
27
- font-family: "PT Sans",Verdana,Arial,sans-serif;
28
- font-size: 14px;
29
- }
30
-
31
- pre, code, .code,
32
- #filecontents pre.code,
33
- .docstring pre.code,
34
- .source_code pre {
35
- font-family: Inconsolata,Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;
36
- }
37
-
38
- pre.code, code {
39
- background:#F5F5FF;
40
- overflow-x: auto;
41
- }
42
- #filecontents pre.code {
43
- margin:10px 0;
44
- padding:5px 12px;
45
- border-radius:5px;
46
- -webkit-border-radius:5px;
47
- -moz-border-radius:5px;
48
- border: 1px dotted #CCC;
49
- }
50
-
51
- code .val {
52
- color:#036A07;
53
- }
54
- code .kw {
55
- color:#0000FF;
56
- }
57
- code .symbol {
58
- color:#C5060B;
59
- }
60
-
61
- ul.main_files {
62
- list-style-type:none;
63
- margin:0;
64
- padding:0;
65
- font-size:14px;
66
- }
67
- ul.main_files li {
68
- margin:0;
69
- padding:0;
70
- }
71
-
72
- ul.main_files li a {
73
- margin: 0;
74
- padding:3px 12px;
75
- display:block;
76
- cursor:pointer;
77
- }
78
- #content ul.main_files li a:hover {
79
- background-color:#F4F9E4;
80
- }
81
- /* Layout */
82
- #header,
83
- #content,
84
- #footer {
85
- margin:0 auto;
86
- width:1000px;
87
- }
88
- #header #logo {
89
- float:left;
90
- width:50%;
91
- font-size: 32px;
92
- letter-spacing: -1px;
93
- margin-top: 20px;
94
- }
95
- #header #search {
96
- position:static;
97
- float:right;
98
- }
99
- #content .col1 {
100
- float:left;
101
- width: 750px;
102
- }
103
- #content .col2 {
104
- float:left;
105
- margin: 0 0 0 20px;
106
- padding: 0 0 0 20px;
107
- width: 200px;
108
- border-left: 1px dotted #D5D5D5;
109
- }