Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Guard notify support. Fail resilient

  • Loading branch information...
commit 362b717d1112feecfef6bd36c8d71fedd7492c06 1 parent e04c110
@carlhoerberg carlhoerberg authored
Showing with 12 additions and 5 deletions.
  1. +12 −5 lib/guard/jammit.rb
View
17 lib/guard/jammit.rb
@@ -45,11 +45,18 @@ def run_on_change(paths)
end
def jammit
- ::Jammit.load_configuration @options[:config] || ::Jammit::DEFAULT_CONFIG_PATH
- puts "Jamming"
- ::Jammit.packager.force = true
- ::Jammit.packager.precache_all
- true
+ begin
+ ::Jammit.load_configuration @options[:config] || ::Jammit::DEFAULT_CONFIG_PATH
+ ::Jammit.packager.force = true
+ ::Jammit.packager.precache_all
+ ::Guard::Notifier.info('Jamming')
+ ::Guard::Notifier.notify('Jamming', :title => 'Jammit')
+ true
+ rescue Exception => e
+ ::Guard::Notifier.error("Jammit failed (#{e})")
+ ::Guard::Notifier.notify('Jammit failed', :title => 'Jammit', :image => :failed)
+ false
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.