Sha256: c73539001ffd505d4c18dc3e01c6c4be1516f24dc89b133beea18a6bd3287ebb

Contents?: true

Size: 603 Bytes

Versions: 189

Compression:

Stored size: 603 Bytes

Contents

namespace :metrics do
  task :lines do
    lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
    for file_name in FileList["lib/**/*.rb"]
      f = File.open(file_name)
      while line = f.gets
        lines += 1
        next if line =~ /^\s*$/
        next if line =~ /^\s*#/
        codelines += 1
      end
      puts "L: #{sprintf("%4d", lines)}, " +
        "LOC #{sprintf("%4d", codelines)} | #{file_name}"
      total_lines     += lines
      total_codelines += codelines

      lines, codelines = 0, 0
    end

    puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
  end
end

Version data entries

189 entries across 162 versions & 37 rubygems

Version Path
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/addressable-2.3.6/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/addressable-2.3.5/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/uuidtools-2.1.4/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/addressable-2.3.6/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/addressable-2.3.5/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/addressable-2.3.6/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/addressable-2.3.5/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/uuidtools-2.1.4/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/uuidtools-2.1.4/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/addressable-2.3.5/tasks/metrics.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/addressable-2.3.6/tasks/metrics.rake
uuidtools-2.1.5 tasks/metrics.rake
mislav-addressable-2.1.1 tasks/metrics.rake
sr-couchy-0.0.2 vendor/addressable/tasks/metrics.rake
sr-couchy-0.0.3 vendor/addressable/tasks/metrics.rake
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/uuidtools-2.1.4/tasks/metrics.rake
whos_dated_who-0.1.0 vendor/bundle/gems/addressable-2.3.6/tasks/metrics.rake
whos_dated_who-0.0.1 vendor/bundle/gems/addressable-2.3.6/tasks/metrics.rake
addressable-2.3.6 tasks/metrics.rake
addressable-2.3.5 tasks/metrics.rake