-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
57 lines (45 loc) · 1.08 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
require 'rspec/core/rake_task'
require 'yard'
task :default => [:test, :check_docs]
desc "Run tests"
RSpec::Core::RakeTask.new :test
desc "Skip long running tests."
task :test_fast do
ENV["SKIP_LONG_TESTS"] = "true"
Rake::Task[:test].execute
end
desc "Build the gem"
task :build => [:doc] do
Dir['*.gem'].each { |file| File.delete file }
system 'gem build *.gemspec'
end
desc "Rebuild and [re]install the gem"
task :install => [:build] do
system 'gem install *.gem'
end
desc "Generate documentation"
YARD::Rake::YardocTask.new :doc do |t|
t.options = %w(- README.md LICENSE)
end
desc "List undocumented objects"
YARD::Rake::YardocTask.new :undoc do |t|
t.stats_options = %w(--list-undoc)
end
desc "Check for 100% documentation"
task :check_docs do
output = ""
puts "Generating documentation..."
IO.popen("rake doc") do |f|
f.each do |line|
output += line
puts line
end
end
message = "\nChecking for 100% documentation..."
if output =~ /\b100\.00% documented\b/
puts "#{message} PASSED"
else
puts "#{message} FAIL"
exit 1
end
end