Skip to content
This repository
tag: v0.12.3
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 39 lines (32 sloc) 0.911 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
require 'rake'
require 'rake/gempackagetask' # TODO Remove.

task :default => :spec

# Specs.
#
require 'spec'
require 'spec/rake/spectask'

spec_root = File.join(File.dirname(__FILE__), 'spec')

desc "Run specs"
Spec::Rake::SpecTask.new(:spec) do |t|
  t.spec_opts = ['--options', "\"#{File.join(spec_root, 'spec.opts')}\""]
  t.spec_files = FileList[File.join(spec_root, '**', '*_spec.rb')]
end

task :simplecov do
  ENV['COV'] = 'yes'
end

task :cov do
  Rake::Task['simplecov'].invoke
  Rake::Task['spec'].invoke
end

# TODO Very pedestrian cloc.
#
task :stats do
  %w|project_prototype lib spec test_project|.each do |dir|
    original_dir = dir
    dir = "#{dir}/*.rb"
    dirs = 5.times.inject([dir]) do |dirs, _|
      dirs << dirs.last.gsub(%r{/*.rb}, '/**/*.rb')
    end
    puts original_dir << ': ' << `wc -l #{dirs.join(' ')} 2>/dev/null`.chop.split("\n").last.gsub(/(\d+)\stotal$/, '\1')
  end
end
Something went wrong with that request. Please try again.