Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix yardoc source file parsing bug when no arguments are specified

  • Loading branch information...
commit fa89cb6167cc309a20c42f2527faa30e797707ef 1 parent eb287b9
Loren Segal lsegal authored
Showing with 7 additions and 2 deletions.
  1. +2 −2 lib/yard/cli/yardoc.rb
  2. +5 −0 spec/cli/yardoc_spec.rb
4 lib/yard/cli/yardoc.rb
View
@@ -21,6 +21,7 @@ def initialize
return false if gen.respond_to?(:visibility) && !visibilities.include?(gen.visibility)
end
]
+ @files = []
@visibilities = [:public]
@reload = true
@generate = true
@@ -80,8 +81,6 @@ def parse_files(*files)
self.files << file
end
end
-
- self.files = ['lib/**/*.rb'] if self.files.empty?
end
def optparse(*args)
@@ -208,6 +207,7 @@ def optparse(*args)
# Last minute modifications
parse_files(*args) unless args.empty?
+ self.files = ['lib/**/*.rb'] if self.files.empty?
self.visibilities.uniq!
options[:serializer] ||= Serializers::FileSystemSerializer.new(serialopts)
end
5 spec/cli/yardoc_spec.rb
View
@@ -68,4 +68,9 @@ class YARD::CLI::Yardoc; public :optparse end
@yardoc.files.should == %w( file1 file2 )
@yardoc.options[:files].should == %w( a.txt b.txt )
end
+
+ it "should accept no params and parse lib/**/*.rb" do
+ @yardoc.optparse
+ @yardoc.files.should == %w( lib/**/*.rb )
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.