Skip to content

Commit

Permalink
Better namespace handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Wagenet committed Feb 18, 2012
1 parent ed63c18 commit 2044005
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/parsejs/docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,8 @@ def build_namespace(namespace)
elsif ns = YARD::Registry.at(namespace)
ns
else
parts = namespace.split("::")
parent = parts[0...-1].join("::")

if parent.empty?
YARD::CodeObjects::NamespaceObject.new(YARD::Registry.root, parts[-1])
else
build_namespace parent
YARD::CodeObjects::NamespaceObject.new(parent, parts[-1])
end
name = namespace.gsub('::', '.')
YARD::CodeObjects::NamespaceObject.new(:root, name)
end
end

Expand Down

0 comments on commit 2044005

Please sign in to comment.