module Nanoc::Helpers::ChildParent
Public Instance Methods
Source
# File lib/nanoc/helpers/child_parent.rb, line 15 def children_of(item) if item.identifier.legacy? item.children else pattern = item.identifier.without_ext + '/*' @items.find_all(pattern) end end
Source
# File lib/nanoc/helpers/child_parent.rb, line 6 def parent_of(item) if item.identifier.legacy? item.parent else path_without_last_component = item.identifier.to_s.sub(/[^\/]+$/, '').chop @items[path_without_last_component + '.*'] end end