From f152181c0671fcd9c87e70ecd9344efa7103960b Mon Sep 17 00:00:00 2001 From: Scott Rohde Date: Wed, 6 Sep 2017 20:54:31 -0500 Subject: [PATCH] Fix to task file so that tasks don't croak in production environment. --- lib/tasks/document_betydb.rake | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/tasks/document_betydb.rake b/lib/tasks/document_betydb.rake index 106689dd5..06de1bb7c 100644 --- a/lib/tasks/document_betydb.rake +++ b/lib/tasks/document_betydb.rake @@ -1,10 +1,13 @@ -# Define the "yard" task: -YARD::Rake::YardocTask.new do |t| - # Most options are set in the .yardopts file under the Rails root - # directory rather than here. - - # Uncomment this to get a report of all undocumented methods: - # t.stats_options = ['--list-undoc'] +# This test is needed because we don't load YARD in all environments: +if defined? YARD + # Define the "yard" task: + YARD::Rake::YardocTask.new do |t| + # Most options are set in the .yardopts file under the Rails root + # directory rather than here. + + # Uncomment this to get a report of all undocumented methods: + # t.stats_options = ['--list-undoc'] + end end # Make the doc:app task run yardoc instead of RDoc: