Sha256: 4d57112749dae66f810b3ef385661b65ee2798898e468ca7055acd784461646b

Contents?: true

Size: 634 Bytes

Versions: 161

Compression:

Stored size: 634 Bytes

Contents

# frozen_string_literal: true

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

161 entries across 148 versions & 19 rubygems

Version Path
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/addressable-2.8.5/tasks/metrics.rake
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/addressable-2.8.5/tasks/metrics.rake
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/addressable-2.8.5/tasks/metrics.rake
cloudsmith-api-2.0.15 vendor/bundle/ruby/2.6.0/gems/addressable-2.8.7/tasks/metrics.rake
cloudsmith-api-2.0.14 vendor/bundle/ruby/2.6.0/gems/addressable-2.8.7/tasks/metrics.rake
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/addressable-2.8.7/tasks/metrics.rake
addressable-2.8.7 tasks/metrics.rake
cloudsmith-api-2.0.13 vendor/bundle/ruby/2.6.0/gems/addressable-2.8.6/tasks/metrics.rake
cloudsmith-api-2.0.12 vendor/bundle/ruby/2.6.0/gems/addressable-2.8.6/tasks/metrics.rake
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/addressable-2.8.5/tasks/metrics.rake
cloudsmith-api-2.0.11 vendor/bundle/ruby/2.6.0/gems/addressable-2.8.6/tasks/metrics.rake
cloudsmith-api-2.0.10 vendor/bundle/ruby/2.6.0/gems/addressable-2.8.6/tasks/metrics.rake
cloudsmith-api-2.0.9 vendor/bundle/ruby/2.6.0/gems/addressable-2.8.6/tasks/metrics.rake
cloudsmith-api-2.0.8 vendor/bundle/ruby/2.6.0/gems/addressable-2.8.6/tasks/metrics.rake
postfinancecheckout-ruby-sdk-4.5.0 vendor/bundle/ruby/3.3.0/gems/addressable-2.8.6/tasks/metrics.rake
wallee-ruby-sdk-4.5.0 vendor/bundle/ruby/3.3.0/gems/addressable-2.8.6/tasks/metrics.rake
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/addressable-2.8.5/tasks/metrics.rake
wallee-ruby-sdk-4.4.0 vendor/bundle/ruby/3.1.0/gems/addressable-2.8.6/tasks/metrics.rake
postfinancecheckout-ruby-sdk-4.4.0 vendor/bundle/ruby/3.1.0/gems/addressable-2.8.6/tasks/metrics.rake
postfinancecheckout-ruby-sdk-4.2.0 vendor/bundle/ruby/3.0.0/gems/addressable-2.8.6/tasks/metrics.rake