Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 51 lines (40 sloc) 1.235 kb
db8ed6c @kschiess + gem builder tasks (gem this)
authored
1 require "rubygems"
2 require "rake/rdoctask"
5ee96a9 @kschiess + update to rspec2.
authored
3 require 'rspec/core/rake_task'
5aeef79 @kschiess + Adding gem building back in
authored
4 require "rake/gempackagetask"
5
075f148 @kschiess . distinguish unit tests and acceptance tests
authored
6 desc "Run all tests: Exhaustive."
5ee96a9 @kschiess + update to rspec2.
authored
7 RSpec::Core::RakeTask.new
735983d @kschiess . spec setup
authored
8
075f148 @kschiess . distinguish unit tests and acceptance tests
authored
9 namespace :spec do
10 desc "Only run unit tests: Fast. "
11 RSpec::Core::RakeTask.new(:unit) do |task|
12 task.pattern = "spec/parslet/**/*_spec.rb"
13 end
14 end
15
db8ed6c @kschiess + gem builder tasks (gem this)
authored
16 task :default => :spec
17
bc03948 @kschiess + sdoc
authored
18 require 'sdoc'
19
db8ed6c @kschiess + gem builder tasks (gem this)
authored
20 # Generate documentation
bc03948 @kschiess + sdoc
authored
21 Rake::RDocTask.new do |rdoc|
12ef59a @kschiess + documentation cleanup
authored
22 rdoc.title = "parslet - construction of parsers made easy"
64ddb7a @kschiess - no inline source - deprecated option
authored
23 rdoc.options << '--line-numbers'
bc03948 @kschiess + sdoc
authored
24 rdoc.options << '--fmt' << 'shtml' # explictly set shtml generator
25 rdoc.template = 'direct' # lighter template used on railsapi.com
26 rdoc.main = "README"
27 rdoc.rdoc_files.include("README", "lib/**/*.rb")
28 rdoc.rdoc_dir = "rdoc"
db8ed6c @kschiess + gem builder tasks (gem this)
authored
29 end
30
fdbf272 @floere - clobber_package call in Rakefile
floere authored
31 desc 'Clear out RDoc'
5aeef79 @kschiess + Adding gem building back in
authored
32 task :clean => [:clobber_rdoc, :clobber_package]
33
34 # This task actually builds the gem.
075f148 @kschiess . distinguish unit tests and acceptance tests
authored
35 task :gem => :spec
5aeef79 @kschiess + Adding gem building back in
authored
36 spec = eval(File.read('parslet.gemspec'))
075f148 @kschiess . distinguish unit tests and acceptance tests
authored
37
5aeef79 @kschiess + Adding gem building back in
authored
38 desc "Generate the gem package."
39 Rake::GemPackageTask.new(spec) do |pkg|
40 pkg.gem_spec = spec
41 end
42
3fc81f7 @kschiess . rake stat
authored
43 desc "Prints LOC stats"
44 task :stat do
45 %w(lib spec example).each do |dir|
46 loc = %x(find #{dir} -name "*.rb" | xargs wc -l | grep 'total').split.first.to_i
47 printf("%20s %d\n", dir, loc)
48 end
49 end
50
Something went wrong with that request. Please try again.