Rantfile in rant-0.5.4 vs Rantfile in rant-0.5.6

- old
+ new

@@ -234,10 +234,11 @@ puts "Bad files:" bad.each { |b| puts " #{b}" } puts "#{ok.size} of #{rbfiles.size} are OK" end +desc "Create local backup of svn repos on berlios." task "fetch-svn-dump" do require 'net/http' require 'uri' url = URI.parse("http://svn.berlios.de/svndumps/rant-repos.gz") req = Net::HTTP::Get.new(url.path) @@ -245,9 +246,25 @@ puts "Starting download from: #{url}" res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) } sys.write_to_file "../rant-repos_#{ds}.gz", res.body +end + +task "stats" do + require 'scriptlines' + files = sys["lib/**/*.rb"] + puts ScriptLines.headline + sum = ScriptLines.new("TOTAL (#{files.size} scripts)") + files.each { |fn| + File.open(fn) do |file| + script_lines = ScriptLines.new(fn) + script_lines.read(file) + sum += script_lines + puts script_lines + end + } + puts sum end task "rb-stats" do files = sys["lib/**/*.rb"] lines = 0