lib/yard/handlers/base.rb in yard-0.2.3 vs lib/yard/handlers/base.rb in yard-0.2.3.2
- old
+ new
@@ -293,10 +293,11 @@
object.add_file(parser.file, statement.line, statement.comments)
# Add docstring if there is one.
object.docstring = statement.comments if statement.comments
+ object.docstring.line_range = statement.comments_range
# Add source only to non-class non-module objects
unless object.is_a?(NamespaceObject)
object.source ||= statement
end
@@ -307,10 +308,11 @@
end
objects.size == 1 ? objects.first : objects
end
def ensure_loaded!(object, max_retries = 1)
+ return if object == Registry.root
unless parser.load_order_errors
if object.is_a?(Proxy)
raise NamespaceMissingError, object
else
nil
@@ -320,23 +322,22 @@
if RUBY_PLATFORM =~ /java/
log.warn "JRuby does not implement Kernel#callcc and cannot load files in order. You must specify the correct order manually."
raise NamespaceMissingError, object
end
- retries, context = 0, nil
- callcc {|c| context = c }
-
+ retries = 0
+ context = callcc {|c| c }
retries += 1
if object.is_a?(Proxy)
if retries <= max_retries
- log.debug "Missing object #{object.parent} in file `#{parser.file}', moving it to the back of the line."
+ log.debug "Missing object #{object} in file `#{parser.file}', moving it to the back of the line."
raise Parser::LoadOrderError, context
else
raise NamespaceMissingError, object
end
else
- log.debug "Object #{object} successfully resolved. Adding item to #{object.parent}'s children"
+ log.debug "Object #{object} successfully resolved. Adding children."
end
object
end
end
end
\ No newline at end of file