Skip to content

Commit

Permalink
Added :diff task to the Rakefile. This is the first step in camping.r…
Browse files Browse the repository at this point in the history
…b and

camping-unabridged.rb sync. It shows a diff of the parse trees.

Depends on the ParseTree gem.

If you experience some problems with ParseTree 2.0.1, there is a fix here :
http://rubyforge.org/tracker/?func=detail&atid=1778&aid=8022&group_id=439
  • Loading branch information
Jonas Pfenniger committed Sep 19, 2007
1 parent 50ac52a commit ea45075
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include FileUtils
NAME = "camping"
REV = File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
VERS = ENV['VERSION'] || ("1.5" + (REV ? ".#{REV}" : ""))
CLEAN.include ['**/.*.sw?', '*.gem', '.config', 'test/test.log']
CLEAN.include ['**/.*.sw?', '*.gem', '.config', 'test/test.log', '.*.pt']
RDOC_OPTS = ['--quiet', '--title', "Camping, the Documentation",
"--opname", "index.html",
"--line-numbers",
Expand Down Expand Up @@ -115,3 +115,16 @@ Rake::TestTask.new(:test) do |t|
# t.warning = true
# t.verbose = true
end

desc "Compare camping and camping-unabridged parse trees"
task :diff do
if `which parse_tree_show`.strip.empty?
STDERR.puts "ERROR: parse_tree_show missing : `gem install ParseTree`"
exit 1
end

sh "parse_tree_show lib/camping.rb > .camping.pt"
sh "parse_tree_show lib/camping-unabridged.rb > .camping-unabridged.pt"
sh "diff -u .camping-unabridged.pt .camping.pt | less"
end

0 comments on commit ea45075

Please sign in to comment.