Last active
December 15, 2015 11:29
-
-
Save hamakn/5253404 to your computer and use it in GitHub Desktop.
perl用Guadfile
(主にUNIVERSAL::requireでsyntax errorが出てこなくなる対策)
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 "open3" | |
require "colorize" | |
guard 'shell' do | |
watch(/(.*).pm/) do |m| | |
arr = Open3.capture3("perl -c #{m[0]}") | |
line = arr.first.split("\n").first | |
unless line =~ /syntax OK/ | |
puts line.red | |
else | |
puts line.green | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment