grip 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -1
- data/VERSION +1 -1
- data/grip.gemspec +1 -1
- data/lib/grip.rb +2 -5
- data/test/test_grip.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -22,7 +22,8 @@ The grip gem is hosted on gemcutter.org:
|
|
22
22
|
# any specified options are passed back to you
|
23
23
|
# at this point.
|
24
24
|
# Just return the file when you're done.
|
25
|
-
def
|
25
|
+
def process_image opts
|
26
|
+
puts "processing"
|
26
27
|
opts[:file]
|
27
28
|
end
|
28
29
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/grip.gemspec
CHANGED
data/lib/grip.rb
CHANGED
@@ -65,16 +65,13 @@ module Grip
|
|
65
65
|
|
66
66
|
if (opts[:file].is_a?(File) || opts[:file].is_a?(Tempfile))
|
67
67
|
GridFS::GridStore.open(self.class.database, self["#{name}_path"], 'w', :content_type => self["#{name}_content_type"]) do |f|
|
68
|
-
|
68
|
+
processed_or_not = self.respond_to?("process_#{name}") ? send("process_#{name}",opts) : opts[:file]
|
69
|
+
f.write(processed_or_not)
|
69
70
|
end
|
70
71
|
end
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
74
|
-
def grip_process_file opts
|
75
|
-
opts[:file]
|
76
|
-
end
|
77
|
-
|
78
75
|
def destroy_attached_files
|
79
76
|
self.class.attachment_definitions.each do |name, attachment|
|
80
77
|
GridFS::GridStore.unlink(self.class.database, self["#{name}_path"])
|
data/test/test_grip.rb
CHANGED