Skip to content

Commit

Permalink
be more specific about error messages on the layout interface
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdavis committed Jun 4, 2012
1 parent d85f7fe commit 5f267a2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/compass/sass_extensions/sprites/layout.rb
Expand Up @@ -13,18 +13,22 @@ def initialize(images, kwargs={})
@options = kwargs
@height = 0
@width = 0

layout!
@images
end

def layout!
raise Compass::SpriteException, "You must impliment layout!"
end

def properties
if [@width, @height].any?(&:zero?)
raise Compass::SpriteException, "You must set the width and height before fetching the properties"
if @width.zero?
raise Compass::SpriteException, "You must set the width fetching the properties"
end
if @height.zero?
raise Compass::SpriteException, "You must set the height fetching the properties"
end

[@images, @width, @height]
end

Expand Down

0 comments on commit 5f267a2

Please sign in to comment.