update travis file
[bootswatch] / 2 / swatchmaker / watcher.rb
1 #!/usr/bin/env ruby
2
3 require 'rubygems'
4 require 'directory_watcher'
5
6 dw = DirectoryWatcher.new 'swatch'
7 dw.interval = 1.0
8 dw.add_observer do |*args|
9   args.each do |event|
10     if /less/ =~ event.path
11      `make bootswatch`
12       puts "#{Time.now.strftime("%I:%M:%S")} make bootswatch (since #{event.path} #{event.type})"
13     end
14   end
15 end
16
17 dw.start
18 gets      # when the user hits "enter" the script will terminate
19 dw.stop