Permalink
Browse files

guard

  • Loading branch information...
1 parent 9169fad commit 29fb4af8eb5a689e3b0479db5818d2daf79d1147 @jasonm committed Sep 5, 2011
Showing with 58 additions and 0 deletions.
  1. +8 −0 Gemfile
  2. +16 −0 Gemfile.lock
  3. +34 −0 Guardfile
View
@@ -0,0 +1,8 @@
+source 'http://rubygems.org'
+
+gem 'guard'
+
+if RUBY_PLATFORM.downcase.include?("darwin")
+ gem 'rb-fsevent'
+ gem 'growl'
+end
View
@@ -0,0 +1,16 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ growl (1.0.3)
+ guard (0.6.3)
+ thor (~> 0.14.6)
+ rb-fsevent (0.4.1)
+ thor (0.14.6)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ growl
+ guard
+ rb-fsevent
View
@@ -0,0 +1,34 @@
+require 'guard/guard'
+
+module ::Guard
+ class Landslide < Guard
+ def start
+ UI.info "landslide is waiting for slide changes..."
+ end
+
+ def run_all
+ true
+ end
+
+ def run_on_change(paths)
+ UI.info "landslide is generating a new presentation..."
+ output = `landslide landslide.cfg`
+
+ command_failure = ($?.to_i != 0)
+
+ if command_failure
+ UI.error output
+
+ UI.error "*"*80
+ UI.error "Errors in generation listed above!"
+ UI.error "*"*80
+ else
+ UI.info "Done."
+ end
+ end
+ end
+end
+
+guard 'landslide' do
+ watch (%r{landslide\.cfg|slides/})
+end

0 comments on commit 29fb4af

Please sign in to comment.