citrusbyte-milton 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +2 -6
- data/lib/milton/derivatives/derivative.rb +12 -1
- metadata +1 -1
data/README.markdown
CHANGED
@@ -220,13 +220,13 @@ Installation
|
|
220
220
|
|
221
221
|
### Gem
|
222
222
|
|
223
|
-
$ gem install citrusbyte-milton --source
|
223
|
+
$ gem install citrusbyte-milton --source=http://gems.github.com
|
224
224
|
|
225
225
|
### Ruby on Rails gem plugin:
|
226
226
|
|
227
227
|
Add to your environment.rb:
|
228
228
|
|
229
|
-
config.gem "citrusbyte-milton", :source =>
|
229
|
+
config.gem "citrusbyte-milton", :lib => 'milton', :source => 'http://gems.github.com'
|
230
230
|
|
231
231
|
Then run:
|
232
232
|
|
@@ -318,14 +318,10 @@ User's profile snippet (in Haml)
|
|
318
318
|
Contributors
|
319
319
|
------------
|
320
320
|
|
321
|
-
<<<<<<< HEAD:README.markdown
|
322
|
-
Milton is based on AttachmentPow by Ari Lerner (auser)
|
323
|
-
=======
|
324
321
|
* Upload and file handling based on AttachmentPow by Ari Lerner (auser)
|
325
322
|
* Cropping and thumbnailing calculations based on code by Nicolás Sanguinetti (foca)
|
326
323
|
* Damian Janowski (djanowski)
|
327
324
|
* Michel Martens (soveran)
|
328
|
-
>>>>>>> s3:README.markdown
|
329
325
|
|
330
326
|
License
|
331
327
|
-------
|
@@ -41,7 +41,18 @@ module Milton
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def factory(type, source, options={}, settings={})
|
44
|
-
|
44
|
+
begin
|
45
|
+
klass = "Milton::#{type.to_s.classify}".constantize
|
46
|
+
rescue NameError
|
47
|
+
begin
|
48
|
+
require "milton/derivatives/#{type.to_s}"
|
49
|
+
rescue MissingSourceFile => e
|
50
|
+
raise MissingSourceFile.new("#{e.message} (milton: couldn't find the processor '#{type}' you were trying to load)", e.path)
|
51
|
+
end
|
52
|
+
klass = "Milton::#{type.to_s.classify}".constantize
|
53
|
+
end
|
54
|
+
|
55
|
+
klass.new(source, options, settings)
|
45
56
|
end
|
46
57
|
end
|
47
58
|
|