/
Rakefile.rb
64 lines (52 loc) · 1.68 KB
/
Rakefile.rb
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
($:.unshift File.expand_path(File.join( File.dirname(__FILE__), 'lib' ))).uniq!
require 'speck'
# ===============
# = Speck tasks =
# ===============
begin
task :default => :'speck:run'
task :speck => :'speck:run'
namespace :speck do
task :run do
Dir['./specifications/**/*_specs.rb'].each {|f| require f }
playback = lambda do |speck|
p speck.target
speck.execute
speck.checks.each &:execute
speck.children.each &playback
end
Speck::unbound.each &playback
end
end
end
# =======================
# = Documentation tasks =
# =======================
begin
require 'yard'
require 'yard/rake/yardoc_task'
task :documentation => :'documentation:generate'
namespace :documentation do
YARD::Rake::YardocTask.new :generate do |t|
t.files = ['lib/**/*.rb']
t.options = ['--output-dir', File.join('meta', 'documentation'),
'--readme', 'README.markdown',
'--markup', 'markdown', '--markup-provider', 'maruku']
end
task :open do
system 'open ' + File.join('meta', 'documentation', 'index.html') if RUBY_PLATFORM['darwin']
end
end
rescue LoadError
desc 'You need the `yard` and `maruku` gems to generate documentation'
task :documentation
end
namespace :package do
task :package do; system "gem build " + Dir['*.gemspec'].first; end
task :install => :package do; system "gem install " + Dir['*.gem'].first; end
end
desc 'Check everything over before commiting'
task :aok => [:'documentation:generate', :'documentation:open',
:'package:package',
:'speck:run']
task :ci => [:'documentation:generate', :'speck:run']