Skip to content

Commit

Permalink
Adding rake ruby_diff for simpler creation of camping.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed May 24, 2008
1 parent 1b81fa3 commit e235c2b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Rakefile
Expand Up @@ -128,13 +128,24 @@ task :diff do
sh "diff -u .camping-unabridged.pt .camping.pt | less"
end

task :ruby_diff do
require 'ruby2ruby'
c = Ruby2Ruby.translate(File.read("lib/camping.rb"))
n = Ruby2Ruby.translate(File.read("lib/camping-unabridged.rb"))

File.open(".camping-unabridged.rb.rb","w"){|f|f<<c}
File.open(".camping.rb.rb","w"){|f|f<<n}
sh "diff -u .camping-unabridged.rb.rb .camping.rb.rb | less"
end
task :check => ["check:valid", "check:size", "check:lines"]
namespace :check do
desc "Check source code validity"
task :valid do
ruby "-w", "lib/camping-unabridged.rb"
ruby "-w", "lib/camping.rb"
ruby "-rubygems", "-w", "lib/camping-unabridged.rb"
ruby "-rubygems", "-w", "lib/camping.rb"
end
SIZE_LIMIT = 4096
Expand Down

0 comments on commit e235c2b

Please sign in to comment.