/
Rakefile.rb
90 lines (77 loc) · 2.46 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
($:.unshift File.expand_path(File.join( File.dirname(__FILE__), 'lib' ))).uniq!
require 'it'
# =======================
# = Gem packaging tasks =
# =======================
begin
require 'echoe'
task :install => :'package:install'
task :package => :'package:package'
task :manifest => :'package:manifest'
namespace :package do
Echoe.new('it', It::Version) do |g|
g.author = ['elliottcable']
g.email = ['it@elliottcable.com']
g.summary = "Injecting enumerable elements into a block near you!"
g.url = 'http://github.com/elliottcable/it'
g.runtime_dependencies = []
g.development_dependencies = ['echoe >= 3.0.2', 'speck', 'slack', 'spark', 'yard', 'maruku']
g.manifest_name = '.manifest'
g.retain_gemspec = true
g.rakefile_name = 'Rakefile.rb'
g.ignore_pattern = /^\.git\/|^meta\/|\.gemspec/
end
end
rescue LoadError
desc 'You need the `echoe` gem to package Speck'
task :package
end
# ===============
# = Speck tasks =
# ===============
begin
require 'speck'
require 'slack'
require 'spark/rake/speck_task'
task :default => :'speck:run'
task :speck => :'speck:run'
namespace :speck do
Spark::Rake::SpeckTask.new :run
end
rescue LoadError
desc 'You need the `speck`, `slack`, and `spark` gems to run specks'
task :speck
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
task :clobber do
`cd '#{library}' && rm -rf ./meta/ ./pkg/`
%w[. speck slack spark smock].each do |library|
`cd '#{library}' && rm -rf ./meta/ ./pkg/`
end
end
desc 'Check everything over before commiting'
task :aok => [:'documentation:generate', :'documentation:open',
:'package:manifest', :'package:package',
:'speck:run']
task :ci => [:'documentation:generate', :'speck:run']