Sha256: 29dedccb3d7055c1a443a3f5026c47717ad6d6e30225373db2de75cc78ff5d1d

Contents?: true

Size: 492 Bytes

Versions: 14

Compression:

Stored size: 492 Bytes

Contents

namespace :metric do

  desc "project statistics"
  task 'stat' do
    puts "All:"
    stat_files Dir.glob('**/*.{rb,slim,coffee,scss}')
    puts "\nRuby:"
    stat_files Dir.glob('**/*.rb') - Dir.glob('test/**/*.rb')
  end
end

private

def stat_files fs
  c = 0
  fc = 0
  total_size = 0.0
  fs.each do |f|
    fc += 1
    data = File.binread f
    c += data.count "\n"
    total_size += data.bytesize
  end
  puts "files: #{fc}"
  puts "lines: #{c}"
  puts "chars: #{total_size.to_i}"
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
apimaster-0.1.4 lib/apimaster/generators/templates/app/tasks/stat.rake.erb
apimaster-0.1.3 lib/apimaster/generators/templates/app/tasks/stat.rake.erb
apimaster-0.1.2 lib/apimaster/generators/templates/app/tasks/stat.rake.erb
apimaster-0.1.1 lib/apimaster/generators/templates/app/tasks/stat.rake.erb
apimaster-0.0.7 lib/apimaster/generators/templates/app/tasks/stat.rake.erb
apimaster-0.0.6 lib/apimaster/generators/templates/app/tasks/stat.rake.erb
apimaster-0.0.5 lib/apimaster/generators/templates/app/tasks/stat.rake.erb
apimaster-0.0.4 lib/apimaster/generators/templates/app/tasks/stat.rake.erb
apimaster-0.0.3 lib/apimaster/generators/templates/app/tasks/stat.rake.erb
simba-0.0.5 lib/simba/base_app/lib/tasks/stat.rake
simba-0.0.4 lib/simba/base_app/lib/tasks/stat.rake
simba-0.0.3 lib/simba/base_app/lib/tasks/stat.rake
simba-0.0.2 lib/simba/base_app/lib/tasks/stat.rake
simba-0.0.1 lib/simba/base_app/lib/tasks/stat.rake