Skip to content

Commit

Permalink
Add a rake docs task (mongodb#4520)
Browse files Browse the repository at this point in the history
* Add a `rake docs` task

* Exclude specs from documentation

* ci
  • Loading branch information
p-mongo authored Aug 16, 2018
1 parent 601fa9b commit af4da4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- CHANGELOG*
-o yard-docs
--exclude spec
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ group :test do
end

group :development, :testing do
gem 'yard'
platforms :mri do
if RUBY_VERSION >= '2.0.0'
gem 'byebug'
Expand Down
12 changes: 12 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ RSpec::Core::RakeTask.new('spec:progress') do |spec|
end

task :default => :spec

desc "Generate all documentation"
task :docs => 'docs:yard'

namespace :docs do
desc "Generate yard documention"
task :yard do
out = File.join('yard-docs', Mongoid::VERSION)
FileUtils.rm_rf(out)
system "yardoc -o #{out} --title mongoid-#{Mongoid::VERSION}"
end
end

0 comments on commit af4da4b

Please sign in to comment.