grip 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 grip_process_file opts
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.3
1
+ 0.4.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{grip}
8
- s.version = "0.4.3"
8
+ s.version = "0.4.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["twoism", "jnunemaker"]
@@ -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
- f.write( grip_process_file(opts))
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"])
@@ -7,7 +7,7 @@ class Foo
7
7
  has_grid_attachment :image, :resize => {:width=>50,:height=>50}
8
8
  has_grid_attachment :pdf
9
9
 
10
- def grip_process_file opts
10
+ def process_image opts
11
11
  opts[:file]
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - twoism