Skip to content

Commit

Permalink
Fixed case-when that uses ":" (ruby 1.9 compatibility fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Palm committed Apr 14, 2009
1 parent b2d8060 commit 7457ee3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/rghost/image.rb
Expand Up @@ -13,9 +13,12 @@ def initialize(image_path,options={})
def self.for(path,options={})

clazz=case path
when /gif$/i: RGhost::Gif
when /jpe?g$/i: RGhost::Jpeg
when /(eps|template)$/i : RGhost::Eps
when /gif$/i
RGhost::Gif
when /jpe?g$/i
RGhost::Jpeg
when /(eps|template)$/i
RGhost::Eps
else raise NameError.new("Unsupported format")
end

Expand Down

0 comments on commit 7457ee3

Please sign in to comment.