Skip to content
Browse files

Let watchr script run on init

  • Loading branch information...
1 parent e14fb06 commit 35f4e787253e314a1e55bf62852d710344219f5e @avdgaag committed Jul 6, 2011
Showing with 10 additions and 5 deletions.
  1. +10 −5 watch.rb
View
15 watch.rb
@@ -38,10 +38,15 @@ def document(file)
abort 'Neither docco or uglify are available.'
end
-# The actual watchr instructions
-watch('src/mutil.js') do |m|
- document(m[0]) if respond_to?(:document)
- minify(m[0]) if respond_to?(:minify)
- puts 'Waiting for changes in ' + m[0] + '...'
+# Method that does the actual work for Watchr
+def update(f)
+ document(f) if respond_to?(:document)
+ minify(f) if respond_to?(:minify)
+ puts 'Waiting for changes in ' + f + '...'
end
+# The actual watchr instructions
+watch('src/mutil.js') { |m| update(m[0]) }
+
+update('src/mutil.js')
+

0 comments on commit 35f4e78

Please sign in to comment.
Something went wrong with that request. Please try again.