summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2013-06-20 12:52:30 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2013-06-20 16:38:02 -0700
commit06627ab9f9a08420822eb908cb4c60342a298878 (patch)
tree87eae11899a8df907dab36fabd0af68c66b5239f
parent25dbcb9a37a82bdd732b6ed4c50a8a4ba906b087 (diff)
downloadchef-06627ab9f9a08420822eb908cb4c60342a298878.tar.gz
add rake task for generating docs with YARD
-rw-r--r--Gemfile1
-rw-r--r--Rakefile15
2 files changed, 16 insertions, 0 deletions
diff --git a/Gemfile b/Gemfile
index 24c4b19283..05f1cd44f5 100644
--- a/Gemfile
+++ b/Gemfile
@@ -6,6 +6,7 @@ gem "activesupport", :group => :compat_testing, :platform => "ruby"
group(:docgen) do
gem "ronn"
+ gem "yard"
end
group(:development, :test) do
diff --git a/Rakefile b/Rakefile
index c223a60618..085887fab5 100644
--- a/Rakefile
+++ b/Rakefile
@@ -118,5 +118,20 @@ end
task :docs => "docs:all"
+begin
+ require 'yard'
+ DOC_FILES = [ "README.rdoc", "LICENSE", "spec/tiny_server.rb", "lib/**/*.rb" ]
+ namespace :yard do
+ desc "Create YARD documentation"
+
+ YARD::Rake::YardocTask.new(:html) do |t|
+ t.files = DOC_FILES
+ t.options = ['--format', 'html']
+ end
+ end
+
+rescue LoadError
+ puts "yard is not available. (sudo) gem install yard to generate yard documentation."
+end