Sha256: 020d0584b574b0423586379b4145c9f6014d1349f5b6482c7be63bd831d7fcdf
Contents?: true
Size: 1.28 KB
Versions: 4
Compression:
Stored size: 1.28 KB
Contents
#!/usr/bin/env rake begin require 'bundler/setup' rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' end begin require 'rdoc/task' rescue LoadError require 'rdoc/rdoc' require 'rake/rdoctask' RDoc::Task = Rake::RDocTask end RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' rdoc.title = 'ViewAssets' rdoc.options << '--line-numbers' rdoc.rdoc_files.include('README.rdoc') rdoc.rdoc_files.include('lib/**/*.rb') end Bundler::GemHelper.install_tasks require 'rake/testtask' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = false end task :default => :test task :lines do lines, codelines, total_lines, total_codelines = 0, 0, 0, 0 FileList["#{ ENV['PWD'] }/**/*.rb"].each do |file_name| next if file_name =~ /vendor/ File.open(file_name, 'r') do |f| while line = f.gets lines += 1 next if line =~ /^\s*$/ next if line =~ /^\s*#/ codelines += 1 end 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
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
view_assets-1.1.1 | Rakefile |
view_assets-1.0.4 | Rakefile |
view_assets-1.0.3 | Rakefile |
view_assets-1.0.0 | Rakefile |