Sha256: 4889d6211389b144d4ad396e2920e8d7e4cd408dc2cf11ed1f1a9c0a264f4fb4
Contents?: true
Size: 767 Bytes
Versions: 1
Compression:
Stored size: 767 Bytes
Contents
#!/usr/bin/env watchr #!/usr/bin/env watchr def run(cmd) puts(cmd) system cmd end def run_test_file(file) clear run "ruby -rubygems -Ilib:test #{file}" end def run_tests clear run "rake" end def clear system "clear" end def underscore(file) file.gsub('/', '_') end @interrupted = false Signal.trap 'QUIT' do run_tests end Signal.trap 'INT' do if @interrupted then abort("\n") else puts "Interrupt a second time to quit" @interrupted = true Kernel.sleep 1.5 # raise Interrupt, nil # let the run loop catch it run_tests end end run_tests watch('test/test_.*\.rb') {|md| run_test_file md[0] } watch('lib/(.*)\.rb') {|md| run_test_file "test/test_#{underscore(md[1])}.rb" } watch('test/helper.rb') { run_tests }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
libnotify-0.5.0 | test.watchr |