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