File: Rakefile

package info (click to toggle)
ruby-parslet 1.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 908 kB
  • ctags: 473
  • sloc: ruby: 5,220; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (6)
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
require 'rdoc/task'
require 'sdoc'

require 'rspec/core/rake_task'
require "rubygems/package_task"

desc "Run all tests: Exhaustive."
RSpec::Core::RakeTask.new

namespace :spec do
  desc "Only run unit tests: Fast. "
  RSpec::Core::RakeTask.new(:unit) do |task|
    task.pattern = "spec/parslet/**/*_spec.rb"
  end
end

task :default => :spec

# This task actually builds the gem. 
task :gem => :spec
spec = eval(File.read('parslet.gemspec'))

desc "Prints LOC stats"
task :stat do
  %w(lib spec example).each do |dir|
    loc = %x(find #{dir} -name "*.rb" | xargs wc -l | grep 'total').split.first.to_i
    printf("%20s %d\n", dir, loc)
  end
end