Module: CompassNotify

Extended by:
CompassNotify
Included in:
CompassNotify
Defined in:
lib/compass-notify.rb

Instance Method Summary collapse

Instance Method Details

#initObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/compass-notify.rb', line 14

def init
  config = Compass.configuration

  config.on_stylesheet_saved do |filename|
    CompassNotify.notify('Stylesheet', "#{File.basename(filename)} saved…")
  end

  config.on_sprite_saved do |filename|
    CompassNotify.notify('Sprite', "#{File.basename(filename)} saved…")
  end

  config.on_stylesheet_error do |filename, error|
    CompassNotify.notify('Stylesheet Error', "#{File.basename(filename)} had the following error: #{error}")
  end
end

#notify(title, message) ⇒ Object



10
11
12
# File 'lib/compass-notify.rb', line 10

def notify(title, message)
  TerminalNotifier.notify(message, :title => title)
end