Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 51 lines (40 sloc) 1.235 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 40 41 42 43 44 45 46 47 48 49 50
require "rubygems"
require "rake/rdoctask"
require 'rspec/core/rake_task'
require "rake/gempackagetask"

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

require 'sdoc'

# Generate documentation
Rake::RDocTask.new do |rdoc|
  rdoc.title = "parslet - construction of parsers made easy"
  rdoc.options << '--line-numbers'
  rdoc.options << '--fmt' << 'shtml' # explictly set shtml generator
  rdoc.template = 'direct' # lighter template used on railsapi.com
  rdoc.main = "README"
  rdoc.rdoc_files.include("README", "lib/**/*.rb")
  rdoc.rdoc_dir = "rdoc"
end

desc 'Clear out RDoc'
task :clean => [:clobber_rdoc, :clobber_package]

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

desc "Generate the gem package."
Rake::GemPackageTask.new(spec) do |pkg|
  pkg.gem_spec = spec
end

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

Something went wrong with that request. Please try again.