lib/lazydoc/document.rb in lazydoc-0.8.0 vs lib/lazydoc/document.rb in lazydoc-0.9.0

- old
+ new

@@ -87,11 +87,11 @@ # # ['Name::Space', 'key', 'value'], # # ['', 'alt', 'alt_value'], # # ['Another', 'key', 'another value']] # # Returns the StringScanner used during scanning. - def scan(str, key) # :yields: const_name, key, value + def scan(str, key='[a-z_]+') # :yields: const_name, key, value scanner = case str when StringScanner then str when String then StringScanner.new(str) else raise TypeError, "can't convert #{str.class} into StringScanner or String" end @@ -203,10 +203,10 @@ str = File.read(source_file) if str == nil lines = Utils.split_lines(str) scanner = Utils.convert_to_scanner(str) - Document.scan(scanner, '[a-z_]+') do |const_name, key, value| + Document.scan(scanner) do |const_name, key, value| # get or initialize the comment that will be parsed comment = (self[const_name][key] ||= Subject.new(nil, self)) # skip non-comment constant attributes next unless comment.kind_of?(Comment)