robinboening-fleximage 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. data/CHANGELOG.rdoc +14 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +257 -0
  4. data/Rakefile +49 -0
  5. data/VERSION +1 -0
  6. data/autotest.rb +5 -0
  7. data/fleximage.gemspec +179 -0
  8. data/init.rb +1 -0
  9. data/lib/dsl_accessor.rb +52 -0
  10. data/lib/fleximage.rb +56 -0
  11. data/lib/fleximage/aviary_controller.rb +75 -0
  12. data/lib/fleximage/blank.rb +70 -0
  13. data/lib/fleximage/helper.rb +41 -0
  14. data/lib/fleximage/image_proxy.rb +69 -0
  15. data/lib/fleximage/legacy_view.rb +63 -0
  16. data/lib/fleximage/model.rb +711 -0
  17. data/lib/fleximage/operator/background.rb +62 -0
  18. data/lib/fleximage/operator/base.rb +189 -0
  19. data/lib/fleximage/operator/border.rb +50 -0
  20. data/lib/fleximage/operator/crop.rb +58 -0
  21. data/lib/fleximage/operator/image_overlay.rb +85 -0
  22. data/lib/fleximage/operator/resize.rb +92 -0
  23. data/lib/fleximage/operator/shadow.rb +87 -0
  24. data/lib/fleximage/operator/text.rb +104 -0
  25. data/lib/fleximage/operator/trim.rb +14 -0
  26. data/lib/fleximage/operator/unsharp_mask.rb +36 -0
  27. data/lib/fleximage/rmagick_image_patch.rb +5 -0
  28. data/lib/fleximage/view.rb +57 -0
  29. data/tasks/fleximage_tasks.rake +154 -0
  30. data/test/fixtures/100x1.jpg +0 -0
  31. data/test/fixtures/100x100.jpg +0 -0
  32. data/test/fixtures/1x1.jpg +0 -0
  33. data/test/fixtures/1x100.jpg +0 -0
  34. data/test/fixtures/cmyk.jpg +0 -0
  35. data/test/fixtures/not_a_photo.xml +1 -0
  36. data/test/fixtures/photo.jpg +0 -0
  37. data/test/mock_file.rb +21 -0
  38. data/test/rails_root/app/controllers/application.rb +10 -0
  39. data/test/rails_root/app/controllers/avatars_controller.rb +85 -0
  40. data/test/rails_root/app/controllers/photo_bares_controller.rb +85 -0
  41. data/test/rails_root/app/controllers/photo_dbs_controller.rb +85 -0
  42. data/test/rails_root/app/controllers/photo_files_controller.rb +85 -0
  43. data/test/rails_root/app/helpers/application_helper.rb +3 -0
  44. data/test/rails_root/app/helpers/avatars_helper.rb +2 -0
  45. data/test/rails_root/app/helpers/photo_bares_helper.rb +2 -0
  46. data/test/rails_root/app/helpers/photo_dbs_helper.rb +2 -0
  47. data/test/rails_root/app/helpers/photo_files_helper.rb +2 -0
  48. data/test/rails_root/app/locales/de.yml +7 -0
  49. data/test/rails_root/app/locales/en.yml +8 -0
  50. data/test/rails_root/app/models/abstract.rb +8 -0
  51. data/test/rails_root/app/models/avatar.rb +4 -0
  52. data/test/rails_root/app/models/photo_bare.rb +7 -0
  53. data/test/rails_root/app/models/photo_custom_error.rb +10 -0
  54. data/test/rails_root/app/models/photo_db.rb +3 -0
  55. data/test/rails_root/app/models/photo_file.rb +3 -0
  56. data/test/rails_root/app/models/photo_s3.rb +5 -0
  57. data/test/rails_root/app/views/avatars/edit.html.erb +17 -0
  58. data/test/rails_root/app/views/avatars/index.html.erb +20 -0
  59. data/test/rails_root/app/views/avatars/new.html.erb +16 -0
  60. data/test/rails_root/app/views/avatars/show.html.erb +8 -0
  61. data/test/rails_root/app/views/layouts/avatars.html.erb +17 -0
  62. data/test/rails_root/app/views/layouts/photo_bares.html.erb +17 -0
  63. data/test/rails_root/app/views/layouts/photo_dbs.html.erb +17 -0
  64. data/test/rails_root/app/views/layouts/photo_files.html.erb +17 -0
  65. data/test/rails_root/app/views/photo_bares/edit.html.erb +12 -0
  66. data/test/rails_root/app/views/photo_bares/index.html.erb +18 -0
  67. data/test/rails_root/app/views/photo_bares/new.html.erb +11 -0
  68. data/test/rails_root/app/views/photo_bares/show.html.erb +3 -0
  69. data/test/rails_root/app/views/photo_dbs/edit.html.erb +32 -0
  70. data/test/rails_root/app/views/photo_dbs/index.html.erb +26 -0
  71. data/test/rails_root/app/views/photo_dbs/new.html.erb +31 -0
  72. data/test/rails_root/app/views/photo_dbs/show.html.erb +23 -0
  73. data/test/rails_root/app/views/photo_files/edit.html.erb +27 -0
  74. data/test/rails_root/app/views/photo_files/index.html.erb +24 -0
  75. data/test/rails_root/app/views/photo_files/new.html.erb +26 -0
  76. data/test/rails_root/app/views/photo_files/show.html.erb +18 -0
  77. data/test/rails_root/config/boot.rb +109 -0
  78. data/test/rails_root/config/database.yml +7 -0
  79. data/test/rails_root/config/environment.rb +66 -0
  80. data/test/rails_root/config/environments/development.rb +18 -0
  81. data/test/rails_root/config/environments/production.rb +19 -0
  82. data/test/rails_root/config/environments/sqlite3.rb +0 -0
  83. data/test/rails_root/config/environments/test.rb +22 -0
  84. data/test/rails_root/config/initializers/inflections.rb +10 -0
  85. data/test/rails_root/config/initializers/load_translations.rb +4 -0
  86. data/test/rails_root/config/initializers/mime_types.rb +5 -0
  87. data/test/rails_root/config/routes.rb +43 -0
  88. data/test/rails_root/db/migrate/001_create_photo_files.rb +16 -0
  89. data/test/rails_root/db/migrate/002_create_photo_dbs.rb +16 -0
  90. data/test/rails_root/db/migrate/003_create_photo_bares.rb +12 -0
  91. data/test/rails_root/db/migrate/004_create_avatars.rb +13 -0
  92. data/test/rails_root/db/migrate/005_create_photo_s3s.rb +12 -0
  93. data/test/rails_root/public/.htaccess +40 -0
  94. data/test/rails_root/public/404.html +30 -0
  95. data/test/rails_root/public/422.html +30 -0
  96. data/test/rails_root/public/500.html +30 -0
  97. data/test/rails_root/public/dispatch.cgi +10 -0
  98. data/test/rails_root/public/dispatch.fcgi +24 -0
  99. data/test/rails_root/public/dispatch.rb +10 -0
  100. data/test/rails_root/public/favicon.ico +0 -0
  101. data/test/rails_root/public/images/rails.png +0 -0
  102. data/test/rails_root/public/index.html +277 -0
  103. data/test/rails_root/public/javascripts/application.js +2 -0
  104. data/test/rails_root/public/javascripts/controls.js +963 -0
  105. data/test/rails_root/public/javascripts/dragdrop.js +972 -0
  106. data/test/rails_root/public/javascripts/effects.js +1120 -0
  107. data/test/rails_root/public/javascripts/prototype.js +4225 -0
  108. data/test/rails_root/public/robots.txt +5 -0
  109. data/test/rails_root/public/stylesheets/scaffold.css +74 -0
  110. data/test/rails_root/vendor/plugins/fleximage/init.rb +2 -0
  111. data/test/s3_stubs.rb +7 -0
  112. data/test/test_helper.rb +82 -0
  113. data/test/unit/abstract_test.rb +20 -0
  114. data/test/unit/basic_model_test.rb +40 -0
  115. data/test/unit/blank_test.rb +23 -0
  116. data/test/unit/default_image_path_option_test.rb +16 -0
  117. data/test/unit/dsl_accessor_test.rb +120 -0
  118. data/test/unit/file_upload_from_local_test.rb +31 -0
  119. data/test/unit/file_upload_from_strings_test.rb +23 -0
  120. data/test/unit/file_upload_from_url_test.rb +35 -0
  121. data/test/unit/file_upload_to_db_test.rb +41 -0
  122. data/test/unit/has_store_test.rb +4 -0
  123. data/test/unit/i18n_messages_test.rb +49 -0
  124. data/test/unit/image_directory_option_test.rb +20 -0
  125. data/test/unit/image_proxy_test.rb +17 -0
  126. data/test/unit/image_storage_format_option_test.rb +31 -0
  127. data/test/unit/magic_columns_test.rb +34 -0
  128. data/test/unit/minimum_image_size_test.rb +56 -0
  129. data/test/unit/operator_base_test.rb +124 -0
  130. data/test/unit/operator_resize_test.rb +18 -0
  131. data/test/unit/preprocess_image_option_test.rb +21 -0
  132. data/test/unit/require_image_option_test.rb +30 -0
  133. data/test/unit/temp_image_test.rb +23 -0
  134. data/test/unit/use_creation_date_based_directories_option_test.rb +16 -0
  135. metadata +258 -0
data/CHANGELOG.rdoc ADDED
@@ -0,0 +1,14 @@
1
+ == fleximage 1.0.2 12-14-2009
2
+
3
+ * Don't prepend RAILS_ROOT to absolute image directory path
4
+ * Added support for an "image_format" magic database column
5
+ * Fixed an issue with saving temp images in Windows
6
+ * Fixed a temp image vulnerability with directory traversal
7
+
8
+ == fleximage 1.0.1 12-13-2009
9
+
10
+ * Now with completely passing tests
11
+
12
+ == fleximage 1.0.0 12-13-2009
13
+
14
+ * Initial gem release.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,257 @@
1
+ == Installation
2
+
3
+ Gem: (Recommended)
4
+
5
+ gem install fleximage
6
+
7
+ # in config/environment.rb
8
+ config.gem 'fleximage'
9
+
10
+ Plugin:
11
+
12
+ ./script/plugin install git://github.com/Squeegy/fleximage.git
13
+
14
+
15
+ = Fleximage
16
+
17
+ == Overview
18
+
19
+ Fleximage is a Rails plugin that tries to make image uploading and rendering super easy.
20
+
21
+ There are 2 pieces involved in making Rails image handling easy.
22
+
23
+ === 1. Image Uploads
24
+
25
+ In this post Rails 2, resource-driven world, Fleximage believes that images should belong directly to a record. So you simply tell your model class to act as Fleximage, and your model effortlessly gains the ability to handle file uploads.
26
+
27
+ * Your model gains the ability to interface directly with a +file_field+ form, allowing uploads with zero extra controller or model code.
28
+ * Accept uploads from a web address, pulling in the image from the internet and saving it locally.
29
+ * Image presence validation with customizable form field error messages.
30
+ * Image format validation that will not allow the file to be uploaded unless RMagick can parse it into useable image data.
31
+ * Image pre-processing to keep uploaded images under a certain size, or other on-upload image processing tasks.
32
+
33
+
34
+ === 2. Image Rendering
35
+
36
+ The other half of the problem comes from the need to send the uploaded images back to the web browser. Most of the time, you need to display the image in different sizes or formats in different places on your site. For example, a product image in a store may need a square thumbnail image, a medium image for its focus page, and a large image for an "enlarge this photo" popup.
37
+
38
+ Fleximage uses a simple templating engine that allows you to re-render images exactly how you need them. Using the same "master image," many images can be rendered from the same source. You can even go beyond resizing; there is support for image overlays, text drawing, drop shadows, borders and more. The rendering engine is flexible and extensible to whatever your dynamic image needs are.
39
+
40
+ * Renderer implemented as template engine, which fits in perfectly with Rails 2 RESTful style format-sensitive views.
41
+ * Does not need to have everything resized on upload allowing your site layout the change later on, and all images will re-render themselves just right with your new rendering templates.
42
+ * Support for special effects like text, image or logo overlays, borders and shadows.
43
+ * Extensible by adding image operator classes which allow for reusable snippets of direct RMagick code.
44
+ * Requires absolutely zero controller code.
45
+
46
+
47
+ = Getting Started
48
+
49
+ == 1. Installation
50
+
51
+ Gem: (Recommended)
52
+
53
+ gem install fleximage
54
+
55
+ # in config/environment.rb
56
+ config.gem 'fleximage'
57
+
58
+ Plugin:
59
+
60
+ ./script/plugin install git://github.com/Squeegy/fleximage.git
61
+
62
+
63
+ == 2. Activating your model
64
+
65
+ You need to let your model know it should be Fleximage-friendly. Lets say you have a model for photos.
66
+
67
+ # app/models/photo.rb
68
+ class Photo < ActiveRecord::Base
69
+ acts_as_fleximage :image_directory => 'public/images/uploaded_photos'
70
+ end
71
+
72
+ The :+image_directory+ option tells the plugin where to store your master images. This value is relative to your application root, and doesn't need to be in your public directory if you don't want it to be. This is where the source images will be that all your templates start with.
73
+
74
+ There are many other options for your model. Refer to the <tt>Fleximage::Model::ClassMethods</tt> class in the +rdoc+ for more information on these.
75
+
76
+
77
+ == 3. The upload form
78
+
79
+ Your users need a way to upload their images into your site. Here is how we might render a form to create a photo record.
80
+
81
+ # app/views/photos/new.html.erb
82
+
83
+ <% form_for @photo, :html => { :multipart => true } do |f| %>
84
+ <p>
85
+ <b>Name</b><br />
86
+ <%= f.text_field :name %>
87
+ </p>
88
+
89
+ <p>
90
+ <b>Author</b><br />
91
+ <%= f.text_field :author %>
92
+ </p>
93
+
94
+ <p>
95
+ <b>Upload Image</b><br />
96
+ <%= f.file_field :image_file %><br />
97
+ or URL: <%= f.text_field :image_file_url %>
98
+ </p>
99
+
100
+ <p>
101
+ <%= f.submit "Create" %>
102
+ </p>
103
+ <% end %>
104
+
105
+ *NOTE*: The ":html => { :multipart => true }" is *VERY* *IMPORTANT*. Without this snippet your browser will not send binary data to the server. If things aren't working, check to make sure you have this in your form declaration.
106
+
107
+ The relevant bit of our form code is:
108
+
109
+ <p>
110
+ <b>Upload Image</b><br />
111
+ <%= f.file_field :image_file %><br />
112
+ or URL: <%= f.text_field :image_file_url %>
113
+ </p>
114
+
115
+ First there is a file upload field, mapping the the "image_file" attribute of our model. When the user browses to a local file and uploads it, the model is waiting to accept an uploaded file on this attribute and will automatically open it and save it to disk for you.
116
+
117
+ Right along side the upload field is a simple text field, which maps to the "image_file_url" property. Your model also listens for assignment to this attribute to automatically fetch the contents of a URL and save it locally as the master image.
118
+
119
+ You can have just one of these fields, or both. The model will know how to do the right thing either way.
120
+
121
+ When the user submits the form, all you have to do is assign the form contents to your object in standard Rails fashion, and the image is uploaded and saved for you. Creating a new photo may look like this in your controller:
122
+
123
+ # app/controllers/photos_controller.rb
124
+ def create
125
+ @photo = Photo.new(params[:photo])
126
+ if @photo.save
127
+ redirect_to photo_url(@photo)
128
+ else
129
+ flash[:notice] = 'Your photo did not pass validation!'
130
+ render :action => 'new'
131
+ end
132
+ end
133
+
134
+
135
+ == 4. Linking to the generated images
136
+
137
+ Rails 2 has amazing support for format driven responses. Given a photo object, by default it would have an HTML view that describes information about that photo. With Fleximage, the JPG or (GIF or PNG) view can be the image data itself.
138
+
139
+ A photo HTML view may look like this:
140
+
141
+ # app/views/photos/show.html.erb
142
+ # http://mysite.com/photos/123
143
+
144
+ <p>
145
+ <%= image_tag formatted_photo_path(@photo, :jpg) %>
146
+ </p>
147
+ <p>
148
+ <b>Name:</b>
149
+ <%=h @photo.name %>
150
+ </p>
151
+ <p>
152
+ <b>Author:</b>
153
+ <%=h @photo.author %>
154
+ </p>
155
+
156
+ That image tag uses a Rails route as its +src+. In this case, that route corresponds to the <tt>.jpg</tt> format of the +photo+ resource, which would give us a URL like:
157
+
158
+ http://mysite.com/photos/123.jpg
159
+
160
+ This is the URL where the image will be.
161
+
162
+
163
+ == 5. Rendering the image
164
+
165
+ Now it's time to actually create a template to render the image. This happens through a special view with a .+flexi+ extension. This view template will pull out the master image for you, and send it to the browser as binary data after your processing of it done.
166
+
167
+ The filename of the template should look like this: <tt>action_name.jpg.flexi</tt>, where +action_name+ is the controller action that will render this view. The +jpg+ tells the controller to render this view when the +jpg+ format is asked for. The +flexi+ tells Rails to render this view with the Fleximage template engine, rather than +erb+, +builder+ or other template types.
168
+
169
+ The syntax of the view is pure ruby, but to process the image the view needs to call +operate+ on the instance of your model.
170
+
171
+ Here is the view to render a photo record at 320x240:
172
+
173
+ # app/views/photos/show.jpg.flexi
174
+ # http://mysite.com/photos/123.jpg
175
+ @photo.operate do |image|
176
+ image.resize '320x240'
177
+ end
178
+
179
+ Calling <tt>@photo.operate { |image| .. }</tt> prepares the model object for image processing and provides a ruby object that will allow you to perform image transformations. This example just resizes the image to 320x240, however many other operators are included.
180
+
181
+ Here is a .+flexi+ template that will do much more:
182
+
183
+ # app/views/show.jpg.flexi
184
+ @photo.operate do |image|
185
+ image.resize '640x480', :crop => true
186
+ image.image_overlay 'public/images/logo.png',
187
+ :alignment => :bottom_right,
188
+ :offset => '20x20'
189
+ image.border :size => 10, :color => 'green'
190
+ image.text 'I like Cheese'
191
+ image.unsharp_mask
192
+ image.shadow
193
+ end
194
+
195
+ This template will:
196
+
197
+ * Resize the image to exactly 640x480, cropping off any extra.
198
+ * Add a logo 20 pixels form the lower right corner
199
+ * Add a green 10 pixel border
200
+ * Write "I like Cheese" in the upper left corder
201
+ * Sharpen the image
202
+ * Add a black drop shadow on a white background
203
+
204
+ For more information on image operators, open up <tt>vendor/plugins/fleximage/rdoc/index.html</tt> in your installed plugin and check out the full for details about each operator:
205
+
206
+ * Fleximage::Operator::Border
207
+ * Fleximage::Operator::Crop
208
+ * Fleximage::Operator::ImageOverlay
209
+ * Fleximage::Operator::Resize
210
+ * Fleximage::Operator::Shadow
211
+ * Fleximage::Operator::Text
212
+ * Fleximage::Operator::Trim
213
+ * Fleximage::Operator::UnsharpMask
214
+
215
+
216
+ = Other Useful Information
217
+
218
+ == Image output format
219
+
220
+ You don't want to render JPGs? That's fine. Just link to the format you want (:+jpg+, :+gif+ or :+png+) and declare the your template name to match and the image will be rendered properly. For instance, this will render a +gif+.
221
+
222
+ # app/views/photos/show.html.erb
223
+ <%= image_tag photo_path(@photo, :gif) %>
224
+
225
+ # app/views/photos/show.gif.flexi
226
+ @photo.operate do |image|
227
+ @photo.resize '150x150', :crop => true
228
+ end
229
+
230
+ The Fleximage template engine will automatically detect the format that is being asked for, and render the right type of image.
231
+
232
+ == Converting/Upgrading your master image store
233
+
234
+ Are you upgrading your live app to the new file store creation date based format? Did you start out with PNG image storage, and later realize you need to store with the more space economic JPG instead? Not problem, Fleximage provides some rake tasks to help you out.
235
+
236
+ Each conversion rake task requires that you tell it the class for which that you are changing the file store. For example, if you want to change to the new creation date based storage structure, for the class +Photo+, you can run a rake task like this:
237
+
238
+ rake fleximage:convert:to_nested FLEXIMAGE_CLASS=Photo
239
+
240
+ Or if you want to run this on your production database
241
+
242
+ rake fleximage:convert:to_nested FLEXIMAGE_CLASS=Photo RAILS_ENV=production
243
+
244
+ *IMPORTANT*: These tasks manipulate the source files that make up your images. I take no responsibility if these rake tasks delete all your images. <b>It is highly advised you back up you master image directory before running any of these tasks on your production site.</b>
245
+
246
+ Here are all the conversion tasks:
247
+
248
+ * fleximage:convert:to_nested : Converts your master image store from the flat based path/to/images/123.png format to the creation date based format path/to/images/2008/11/12/123.png based format. Use this task if you are upgrading from an older version of Fleximage.
249
+ * fleximage:convert:to_flat : Converts your master image store from the creation date based path/to/images/2008/11/12/123.png format to the flat format path/to/images/123.png format. Note this will leave the date based directories in place, but they will be empty and can be easily manually deleted.
250
+ * fleximage:convert:to_jpg : Converts all your stored master images from PNG format to JPG format. This will compress your previously lossless master images.
251
+ * fleximage:convert:to_png : Converts all your stored master images from JPG format to PNG format.
252
+
253
+ After you run any of these tasks, make sure to update your model's class accessors +use_creation_date_based_directories+ and +image_storage_format+ to reflect the state of your image store. Otherwise, the plugin will not find you master images for rendering.
254
+
255
+ ------
256
+ Copyright (c) 2008 Alex Wayne beautifulpixel.com, released under the MIT license.
257
+ Special Thanks to Chris Vannoy for intelligent code review, suggestions and contributions to making this plugin awesome.
data/Rakefile ADDED
@@ -0,0 +1,49 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
4
+ require 'rubygems'
5
+
6
+ desc 'Default: run unit tests.'
7
+ task :default => :test
8
+
9
+ desc 'Test the fleximage plugin.'
10
+ Rake::TestTask.new(:test) do |t|
11
+ t.libs << 'lib'
12
+ t.pattern = 'test/unit/**/*_test.rb'
13
+ t.verbose = true
14
+ end
15
+
16
+
17
+ desc 'Generate documentation for the fleximage plugin.'
18
+ Rake::RDocTask.new(:rdoc) do |rdoc|
19
+ rdoc.rdoc_dir = 'rdoc'
20
+ rdoc.title = 'Fleximage'
21
+ rdoc.options << '--line-numbers' << '--inline-source'
22
+ rdoc.rdoc_files.include('README.rdoc')
23
+ rdoc.rdoc_files.include('lib/**/*.rb')
24
+ end
25
+
26
+ begin
27
+ require 'jeweler'
28
+ Jeweler::Tasks.new do |gem|
29
+ gem.name = "robinboening-fleximage"
30
+ gem.summary = <<EOF
31
+ Rails plugin for uploading images as resources, with support for resizing, text
32
+ stamping, and other special effects.
33
+ EOF
34
+ gem.description = <<EOF
35
+ Fleximage is a Rails plugin that tries to make image uploading and rendering
36
+ super easy.
37
+ EOF
38
+ gem.email = "robin.boening@nethosting4you.de"
39
+ gem.homepage = "http://github.com/robinboening/fleximage"
40
+ gem.authors = `git log --pretty=format:"%an"`.split("\n").uniq.sort
41
+ gem.add_dependency "rmagick"
42
+ gem.add_dependency "aws-s3"
43
+ gem.add_development_dependency "rails", "=2.2.2"
44
+ end
45
+ Jeweler::GemcutterTasks.new
46
+ rescue LoadError
47
+ puts "Jeweler (or a dependency) not available."
48
+ puts "Install it with: gem install jeweler"
49
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.4
data/autotest.rb ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby -wKU
2
+ $stdout.sync = true
3
+ IO.popen('rstakeout "rake test" lib/fleximage/* lib/fleximage/**/* test/unit/*') do |f|
4
+ puts f.gets until f.eof?
5
+ end
data/fleximage.gemspec ADDED
@@ -0,0 +1,179 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{fleximage}
8
+ s.version = "1.0.4"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = [%q{Ahmed Adam}, %q{Alex Wayne}, %q{Andrew White}, %q{JJ Buckley}, %q{Jason Lee}, %q{Joshua Abbott}, %q{Koji Ando}, %q{Kouhei Sutou}, %q{Lasse Jansen}, %q{Loïc Guitaut}, %q{Martin Vielsmaier}, %q{Robin Böning}, %q{Squeegy}, %q{Vannoy}, %q{ralph}]
12
+ s.date = %q{2011-05-29}
13
+ s.description = %q{Fleximage is a Rails plugin that tries to make image uploading and rendering
14
+ super easy.
15
+ }
16
+ s.email = %q{ruby@beautifulpixel.com}
17
+ s.extra_rdoc_files = [
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ "CHANGELOG.rdoc",
22
+ "MIT-LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "autotest.rb",
27
+ "fleximage.gemspec",
28
+ "init.rb",
29
+ "lib/dsl_accessor.rb",
30
+ "lib/fleximage.rb",
31
+ "lib/fleximage/aviary_controller.rb",
32
+ "lib/fleximage/blank.rb",
33
+ "lib/fleximage/helper.rb",
34
+ "lib/fleximage/image_proxy.rb",
35
+ "lib/fleximage/legacy_view.rb",
36
+ "lib/fleximage/model.rb",
37
+ "lib/fleximage/operator/background.rb",
38
+ "lib/fleximage/operator/base.rb",
39
+ "lib/fleximage/operator/border.rb",
40
+ "lib/fleximage/operator/crop.rb",
41
+ "lib/fleximage/operator/image_overlay.rb",
42
+ "lib/fleximage/operator/resize.rb",
43
+ "lib/fleximage/operator/shadow.rb",
44
+ "lib/fleximage/operator/text.rb",
45
+ "lib/fleximage/operator/trim.rb",
46
+ "lib/fleximage/operator/unsharp_mask.rb",
47
+ "lib/fleximage/rmagick_image_patch.rb",
48
+ "lib/fleximage/view.rb",
49
+ "tasks/fleximage_tasks.rake",
50
+ "test/fixtures/100x1.jpg",
51
+ "test/fixtures/100x100.jpg",
52
+ "test/fixtures/1x1.jpg",
53
+ "test/fixtures/1x100.jpg",
54
+ "test/fixtures/cmyk.jpg",
55
+ "test/fixtures/not_a_photo.xml",
56
+ "test/fixtures/photo.jpg",
57
+ "test/mock_file.rb",
58
+ "test/rails_root/app/controllers/application.rb",
59
+ "test/rails_root/app/controllers/avatars_controller.rb",
60
+ "test/rails_root/app/controllers/photo_bares_controller.rb",
61
+ "test/rails_root/app/controllers/photo_dbs_controller.rb",
62
+ "test/rails_root/app/controllers/photo_files_controller.rb",
63
+ "test/rails_root/app/helpers/application_helper.rb",
64
+ "test/rails_root/app/helpers/avatars_helper.rb",
65
+ "test/rails_root/app/helpers/photo_bares_helper.rb",
66
+ "test/rails_root/app/helpers/photo_dbs_helper.rb",
67
+ "test/rails_root/app/helpers/photo_files_helper.rb",
68
+ "test/rails_root/app/locales/de.yml",
69
+ "test/rails_root/app/locales/en.yml",
70
+ "test/rails_root/app/models/abstract.rb",
71
+ "test/rails_root/app/models/avatar.rb",
72
+ "test/rails_root/app/models/photo_bare.rb",
73
+ "test/rails_root/app/models/photo_custom_error.rb",
74
+ "test/rails_root/app/models/photo_db.rb",
75
+ "test/rails_root/app/models/photo_file.rb",
76
+ "test/rails_root/app/models/photo_s3.rb",
77
+ "test/rails_root/app/views/avatars/edit.html.erb",
78
+ "test/rails_root/app/views/avatars/index.html.erb",
79
+ "test/rails_root/app/views/avatars/new.html.erb",
80
+ "test/rails_root/app/views/avatars/show.html.erb",
81
+ "test/rails_root/app/views/layouts/avatars.html.erb",
82
+ "test/rails_root/app/views/layouts/photo_bares.html.erb",
83
+ "test/rails_root/app/views/layouts/photo_dbs.html.erb",
84
+ "test/rails_root/app/views/layouts/photo_files.html.erb",
85
+ "test/rails_root/app/views/photo_bares/edit.html.erb",
86
+ "test/rails_root/app/views/photo_bares/index.html.erb",
87
+ "test/rails_root/app/views/photo_bares/new.html.erb",
88
+ "test/rails_root/app/views/photo_bares/show.html.erb",
89
+ "test/rails_root/app/views/photo_dbs/edit.html.erb",
90
+ "test/rails_root/app/views/photo_dbs/index.html.erb",
91
+ "test/rails_root/app/views/photo_dbs/new.html.erb",
92
+ "test/rails_root/app/views/photo_dbs/show.html.erb",
93
+ "test/rails_root/app/views/photo_files/edit.html.erb",
94
+ "test/rails_root/app/views/photo_files/index.html.erb",
95
+ "test/rails_root/app/views/photo_files/new.html.erb",
96
+ "test/rails_root/app/views/photo_files/show.html.erb",
97
+ "test/rails_root/config/boot.rb",
98
+ "test/rails_root/config/database.yml",
99
+ "test/rails_root/config/environment.rb",
100
+ "test/rails_root/config/environments/development.rb",
101
+ "test/rails_root/config/environments/production.rb",
102
+ "test/rails_root/config/environments/sqlite3.rb",
103
+ "test/rails_root/config/environments/test.rb",
104
+ "test/rails_root/config/initializers/inflections.rb",
105
+ "test/rails_root/config/initializers/load_translations.rb",
106
+ "test/rails_root/config/initializers/mime_types.rb",
107
+ "test/rails_root/config/routes.rb",
108
+ "test/rails_root/db/migrate/001_create_photo_files.rb",
109
+ "test/rails_root/db/migrate/002_create_photo_dbs.rb",
110
+ "test/rails_root/db/migrate/003_create_photo_bares.rb",
111
+ "test/rails_root/db/migrate/004_create_avatars.rb",
112
+ "test/rails_root/db/migrate/005_create_photo_s3s.rb",
113
+ "test/rails_root/public/.htaccess",
114
+ "test/rails_root/public/404.html",
115
+ "test/rails_root/public/422.html",
116
+ "test/rails_root/public/500.html",
117
+ "test/rails_root/public/dispatch.cgi",
118
+ "test/rails_root/public/dispatch.fcgi",
119
+ "test/rails_root/public/dispatch.rb",
120
+ "test/rails_root/public/favicon.ico",
121
+ "test/rails_root/public/images/rails.png",
122
+ "test/rails_root/public/index.html",
123
+ "test/rails_root/public/javascripts/application.js",
124
+ "test/rails_root/public/javascripts/controls.js",
125
+ "test/rails_root/public/javascripts/dragdrop.js",
126
+ "test/rails_root/public/javascripts/effects.js",
127
+ "test/rails_root/public/javascripts/prototype.js",
128
+ "test/rails_root/public/robots.txt",
129
+ "test/rails_root/public/stylesheets/scaffold.css",
130
+ "test/rails_root/vendor/plugins/fleximage/init.rb",
131
+ "test/s3_stubs.rb",
132
+ "test/test_helper.rb",
133
+ "test/unit/abstract_test.rb",
134
+ "test/unit/basic_model_test.rb",
135
+ "test/unit/blank_test.rb",
136
+ "test/unit/default_image_path_option_test.rb",
137
+ "test/unit/dsl_accessor_test.rb",
138
+ "test/unit/file_upload_from_local_test.rb",
139
+ "test/unit/file_upload_from_strings_test.rb",
140
+ "test/unit/file_upload_from_url_test.rb",
141
+ "test/unit/file_upload_to_db_test.rb",
142
+ "test/unit/has_store_test.rb",
143
+ "test/unit/i18n_messages_test.rb",
144
+ "test/unit/image_directory_option_test.rb",
145
+ "test/unit/image_proxy_test.rb",
146
+ "test/unit/image_storage_format_option_test.rb",
147
+ "test/unit/magic_columns_test.rb",
148
+ "test/unit/minimum_image_size_test.rb",
149
+ "test/unit/operator_base_test.rb",
150
+ "test/unit/operator_resize_test.rb",
151
+ "test/unit/preprocess_image_option_test.rb",
152
+ "test/unit/require_image_option_test.rb",
153
+ "test/unit/temp_image_test.rb",
154
+ "test/unit/use_creation_date_based_directories_option_test.rb"
155
+ ]
156
+ s.homepage = %q{http://github.com/Squeegy/fleximage}
157
+ s.require_paths = [%q{lib}]
158
+ s.rubygems_version = %q{1.8.4}
159
+ s.summary = %q{Rails plugin for uploading images as resources, with support for resizing, text stamping, and other special effects.}
160
+
161
+ if s.respond_to? :specification_version then
162
+ s.specification_version = 3
163
+
164
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
165
+ s.add_runtime_dependency(%q<rmagick>, [">= 0"])
166
+ s.add_runtime_dependency(%q<aws-s3>, [">= 0"])
167
+ s.add_development_dependency(%q<rails>, ["= 2.2.2"])
168
+ else
169
+ s.add_dependency(%q<rmagick>, [">= 0"])
170
+ s.add_dependency(%q<aws-s3>, [">= 0"])
171
+ s.add_dependency(%q<rails>, ["= 2.2.2"])
172
+ end
173
+ else
174
+ s.add_dependency(%q<rmagick>, [">= 0"])
175
+ s.add_dependency(%q<aws-s3>, [">= 0"])
176
+ s.add_dependency(%q<rails>, ["= 2.2.2"])
177
+ end
178
+ end
179
+