-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
63 lines (52 loc) · 1.24 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
desc 'Run specs'
task :spec do
sh 'rspec -c'
end
desc 'Run specs verbosely'
task 'spec:verbose' do
sh 'rspec -cfd'
end
desc 'Run specs verbosely, view w/ less'
task 'spec:less' do
sh 'rspec -cfd --tty | less -R'
end
desc 'Run specs w/ coverage'
task :coverage do
ENV['COVERAGE'] = 'yes'; Rake::Task['spec'].execute
end
desc 'Check for warnings'
task :warn do
sh 'ruby -w -I lib -r obfusk -e ""' # TODO
end
desc 'Check for warnings in specs'
task 'warn:spec' do
reqs = Dir['spec/**/*.rb'].sort.map { |x| "-r ./#{x}" } * ' '
sh "ruby -w -I lib -r rspec #{reqs} -e ''"
end
desc 'Check for warnings in specs (but not void context)'
task 'warn:spec:novoid' do
sh 'rake warn:spec 2>&1 | grep -v "void context"'
end
desc 'Generate docs'
task :docs do
sh 'yardoc | cat'
end
desc 'List undocumented objects'
task 'docs:undoc' do
sh 'yard stats --list-undoc'
end
desc 'Cleanup'
task :clean do
sh 'rm -rf .yardoc/ coverage/ doc/ *.gem Gemfile.lock'
end
desc 'Build SNAPSHOT gem'
task :snapshot do
v = Time.new.strftime '%Y%m%d%H%M%S'
f = 'lib/obfusk/version.rb'
sh "sed -ri~ 's!(SNAPSHOT)!\\1.#{v}!' #{f}"
sh 'gem build obfusk.gemspec'
end
desc 'Undo SNAPSHOT gem'
task 'snapshot:undo' do
sh 'git checkout -- lib/obfusk/version.rb'
end