Permalink
Browse files

Revamped debug rake task

[git-p4: depot-paths = "//src/flog/dev/": change = 8406]
  • Loading branch information...
1 parent 96a6393 commit a7c16de3a119550850a4652bba6ab17453bb82b1 @zenspider zenspider committed Apr 15, 2013
Showing with 17 additions and 6 deletions.
  1. +17 −6 Rakefile
View
@@ -25,14 +25,25 @@ Hoe.spec 'flog' do
end
task :debug do
- require "flog"
+ require "flog_cli"
- file = ENV["F"] || "-"
- ruby = file == "-" ? ENV["R"] : File.read(file)
+ class FlogCLI
+ def_delegators :@flog, :flog_ruby
+ end
- @flog = Flog.new :parser => RubyParser
- @flog.flog_ruby ruby, file
- @flog.report
+ file = ENV["F"]
+ ruby = ENV["R"]
+
+ flog = FlogCLI.new :parser => RubyParser
+
+ if file then
+ flog.flog file
+ else
+ flog.flog_ruby ruby, "-"
+ flog.calculate_total_scores
+ end
+
+ flog.report
end
# vim: syntax=ruby

0 comments on commit a7c16de

Please sign in to comment.