Module: CompassGrowl

Extended by:
CompassGrowl
Included in:
CompassGrowl
Defined in:
lib/compass-growl.rb

Constant Summary collapse

ICON =
File.join(File.expand_path('../', __FILE__), '..', 'assets', 'compass_icon.png')
GROWL =
GNTP.new
LOADED =
"Compass Growl Loaded"
STYLESHEET_SAVED =
"Stylesheet Saved"
STYLESHEET_ERROR =
"Stylesheet Error"
SPRITE_SAVED =
"Sprite Saved"

Instance Method Summary collapse

Instance Method Details

#growl(type, message) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/compass-growl.rb', line 20

def growl(type, message)
  GROWL.notify({
  :name => type,
  :title =>  "Compass",
  :text => message,
  :icon => "file://#{ICON}"
  })
end

#initObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/compass-growl.rb', line 29

def init
  CompassGrowl.growl(STYLESHEET_ERROR, "Compass Growl has been initialized")

  config = Compass.configuration

  config.on_stylesheet_saved do |filename|
    CompassGrowl.growl(STYLESHEET_SAVED, "Stylesheet: #{File.basename(filename)} saved")
  end

  config.on_sprite_saved do |filename|
    CompassGrowl.growl(SPRITE_SAVED, "Sprite: #{File.basename(filename)} saved")
  end

  config.on_stylesheet_error do |filename, error|
    CompassGrowl.growl(STYLESHEET_ERROR, "Stylesheet Error: #{File.basename(filename)} \n had the following error:\n #{error}")
  end

end