Skip to content

Instantly share code, notes, and snippets.

@connorjclark
Created April 25, 2015 02:14
Show Gist options
  • Save connorjclark/8e4fd6ef238df5a722df to your computer and use it in GitHub Desktop.
Save connorjclark/8e4fd6ef238df5a722df to your computer and use it in GitHub Desktop.
ruby code watcher
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