Skip to content

Instantly share code, notes, and snippets.

@hamakn
Last active December 15, 2015 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamakn/5253404 to your computer and use it in GitHub Desktop.
Save hamakn/5253404 to your computer and use it in GitHub Desktop.
perl用Guadfile (主にUNIVERSAL::requireでsyntax errorが出てこなくなる対策)
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