Browse files

Add check_syntax rake task for checking the syntax of .rb files

Hopefully this will allow catching issues similar to the MSSQL
ruby 1.9 incompatibility.  There's probably a better way of
determining the ruby interpreter, but the way I coded it, it
uses ENV['RUBY'] or just 'ruby'. Usage:

  RUBY=ruby19 rake check_syntax
  • Loading branch information...
1 parent b266da5 commit 5fa47bd26ccb1cd32779b6168a048884f5664c0c @jeremyevans committed Oct 6, 2009
Showing with 5 additions and 0 deletions.
  1. +5 −0 Rakefile
@@ -211,3 +211,8 @@ desc "Print Sequel version"
task :version do
+desc "Check syntax of all .rb files"
+task :check_syntax do
+ Dir['**/*.rb'].each{|file| print `#{ENV['RUBY'] || :ruby} -c #{file} | fgrep -v "Syntax OK"`}

0 comments on commit 5fa47bd

Please sign in to comment.