forked from joshbuddy/usher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
84 lines (69 loc) · 1.96 KB
/
Rakefile
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# encoding: utf-8
require 'spec'
require 'spec/rake/spectask'
require 'yard'
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb'] # optional
t.options = ['--markup=markdown'] # optional
end
task :spec => ['spec:private', 'spec:rails2_2:cleanup', 'spec:rails2_3:cleanup']
namespace(:spec) do
Spec::Rake::SpecTask.new(:private) do |t|
t.spec_opts ||= []
t.spec_opts << "-rubygems"
t.spec_opts << "--options" << "spec/spec.opts"
t.spec_files = FileList['spec/private/**/*_spec.rb']
end
namespace(:rails2_2) do
task :unzip do
sh('rm -rf spec/rails2_2/vendor')
sh('unzip -qq spec/rails2_2/vendor.zip -dspec/rails2_2')
end
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts ||= []
t.spec_opts << "-rubygems"
t.spec_opts << "--options" << "spec/spec.opts"
t.spec_files = FileList['spec/rails2_2/**/*_spec.rb']
end
task :cleanup do
sh('rm -rf spec/rails2_2/vendor')
end
task :spec => :unzip
task :cleanup => :spec
end
namespace(:rails2_3) do
task :unzip do
sh('rm -rf spec/rails2_3/vendor')
sh('unzip -qq spec/rails2_3/vendor.zip -dspec/rails2_3')
end
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts ||= []
t.spec_opts << "-rubygems"
t.spec_opts << "--options" << "spec/spec.opts"
t.spec_files = FileList['spec/rails2_3/**/*_spec.rb']
end
task :cleanup do
sh('rm -rf spec/rails2_3/vendor')
end
task :spec => :unzip
task :cleanup => :spec
end
end
desc "Run all examples with RCov"
Spec::Rake::SpecTask.new('spec_with_rcov') do |t|
t.spec_files = FileList['spec/**/*.rb']
t.rcov = true
t.rcov_opts = ['--exclude', 'spec']
end
require 'rake/rdoctask'
desc "Generate documentation"
Rake::RDocTask.new do |rd|
rd.main = "README.rdoc"
rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
rd.rdoc_dir = 'rdoc'
end
begin
require 'code_stats'
CodeStats::Tasks.new
rescue LoadError
end