Skip to content

Commit af4da4b

Browse files
authored
Add a rake docs task (#4520)
* Add a `rake docs` task * Exclude specs from documentation * ci
1 parent 601fa9b commit af4da4b

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

.yardopts

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
- CHANGELOG*
22
-o yard-docs
3+
--exclude spec

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ group :test do
1212
end
1313

1414
group :development, :testing do
15+
gem 'yard'
1516
platforms :mri do
1617
if RUBY_VERSION >= '2.0.0'
1718
gem 'byebug'

Rakefile

+12
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,15 @@ RSpec::Core::RakeTask.new('spec:progress') do |spec|
3535
end
3636

3737
task :default => :spec
38+
39+
desc "Generate all documentation"
40+
task :docs => 'docs:yard'
41+
42+
namespace :docs do
43+
desc "Generate yard documention"
44+
task :yard do
45+
out = File.join('yard-docs', Mongoid::VERSION)
46+
FileUtils.rm_rf(out)
47+
system "yardoc -o #{out} --title mongoid-#{Mongoid::VERSION}"
48+
end
49+
end

0 commit comments

Comments
 (0)