Permalink
Browse files

Fix yardoc source file parsing bug when no arguments are specified

  • Loading branch information...
1 parent eb287b9 commit fa89cb6167cc309a20c42f2527faa30e797707ef @lsegal lsegal committed Jul 8, 2009
Showing with 7 additions and 2 deletions.
  1. +2 −2 lib/yard/cli/yardoc.rb
  2. +5 −0 spec/cli/yardoc_spec.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
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

0 comments on commit fa89cb6

Please sign in to comment.