Created
April 25, 2015 02:14
-
-
Save connorjclark/8e4fd6ef238df5a722df to your computer and use it in GitHub Desktop.
ruby code watcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'filewatcher' | |
system('clear') | |
puts 'and now my watch begins ...' | |
FileWatcher.new('.').watch() do |filename, event| | |
if filename.include? '.rb' and filename != 'watch.rb' | |
system('clear') | |
puts "time is #{Time.now.strftime('%I:%M:%S %P')}" | |
puts `ruby #{filename}` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment