Skip to content

Commit

Permalink
Fix for rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
zmbush committed Mar 8, 2015
1 parent ffab29f commit 539e705
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/jekyll/assets_plugin/patches/asset_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ def basename

def resize(dimensions, outdir)
@outfiles ||= {}
if !@outfiles.has_key?(dimensions)
@outfiles[dimensions] = "#{basename}-#{dimensions}#{extname}".gsub(/%/, "P")
unless @outfiles.key?(dimensions)
name = "#{basename}-#{dimensions}#{extname}".gsub(/%/, "P")
img = MiniMagick::Image.read(to_s, extname)
img.resize dimensions
img.write "#{outdir}/#{@outfiles[dimensions]}"
img.write "#{outdir}/#{name}"
@outfiles[dimensions] = name
end

@outfiles[dimensions]
Expand Down

0 comments on commit 539e705

Please sign in to comment.