jeremyboles-graffic 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/graffic.rb +6 -3
  2. metadata +2 -2
@@ -86,7 +86,10 @@ class Graffic < ActiveRecord::Base
86
86
 
87
87
  def size(name, size = {})
88
88
  size.assert_valid_keys(:width, :height)
89
- version(name) {|img| img.crop_resized(size[:width], size[:height])}
89
+ version(name) do |img|
90
+ img = img.first if img.respond_to?(:first)
91
+ img.crop_resized(size[:width], size[:height])
92
+ end
90
93
  end
91
94
 
92
95
  # The queue for uploading images
@@ -131,7 +134,7 @@ class Graffic < ActiveRecord::Base
131
134
  FileUtils.cp(@file, tmp_file_path)
132
135
  change_state('moved')
133
136
  elsif @file.is_a?(Magick::Image)
134
- @image = @file.try(:first) || @file
137
+ @image = @file
135
138
  upload_without_queue!
136
139
  change_state('uploaded')
137
140
  end
@@ -280,7 +283,7 @@ protected
280
283
  def run_processors
281
284
  logger.debug("***** Graffic[#{self.id}](#{self.name}): Running processor")
282
285
  unless self.processor.blank?
283
- @image = processor.call(image.try(:first) || image, self)
286
+ @image = processor.call(image, self)
284
287
  raise 'You need to return an image' unless @image.is_a?(Magick::Image)
285
288
  end
286
289
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeremyboles-graffic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Boles
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-18 00:00:00 -07:00
12
+ date: 2009-03-19 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency