Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only parse_arguments one time in YardocTask

Closes #559
  • Loading branch information...
commit 02db880c03dfec154e8a6bd5d6b5ecc987d62cc7 1 parent bc27497
@lsegal authored
Showing with 10 additions and 2 deletions.
  1. +1 −2  lib/yard/rake/yardoc_task.rb
  2. +9 −0 spec/rake/yardoc_task_spec.rb
View
3  lib/yard/rake/yardoc_task.rb
@@ -64,9 +64,8 @@ def define
task(name) do
before.call if before.is_a?(Proc)
yardoc = YARD::CLI::Yardoc.new
- yardoc.parse_arguments *(options + files)
yardoc.options[:verifier] = verifier if verifier
- yardoc.run
+ yardoc.run *(options + files)
after.call if after.is_a?(Proc)
end
end
View
9 spec/rake/yardoc_task_spec.rb
@@ -45,6 +45,15 @@ def run
run
@yardoc.visibilities.should == [:public, :private, :protected]
end
+
+ it "should allow --api and --no-api" do
+ YARD::Rake::YardocTask.new do |t|
+ t.options = %w(--api public --no-api)
+ end
+ run
+ @yardoc.options.verifier.expressions.
+ should include('["public"].include?(@api.text) || !@api')
+ end
end
describe '#before' do
Please sign in to comment.
Something went wrong with that request. Please try again.