lib/gollum/page.rb
# Find a page in a given tree.
#
# map         - The Array tree map from Wiki#tree_map.
# name        - The canonical String page name.
# checked_dir - Optional String of the directory a matching page needs
#               to be in.  The string should
#
# Returns a Gollum::Page or nil if the page could not be found.
Find a page in a given tree.
map         - The Array tree map from Wiki#tree_map.
name        - The canonical String page name.
checked_dir - Optional String of the directory a matching page needs
to be in.  The string should

Returns a Gollum::Page or nil if the page could not be found.
Find a page in a given tree . map - The Array tree map from Wiki#tree_map . name - The canonical String page name . checked_dir - Optional String of the directory a matching page needs to be in . The string should Returns a Gollum :: Page or nil if the page could not be found .
def find_page_in_tree(map, name, checked_dir = '')
      return nil if !map || name.to_s.empty?
      if checked_dir = BlobEntry.normalize_dir(@wiki.page_file_dir || checked_dir)
        checked_dir.downcase!
      end
      map.each do |entry|
        next if entry.name.to_s.empty?
        next unless entry.dir.downcase == checked_dir
        next unless page_match(name, entry.name)
        return entry.page(@wiki, @version)
      end
      return nil 
    end
def find_page_in_tree ( map , name , checked_dir = '' ) return nil if ! map || name . to_s . empty? if checked_dir = BlobEntry . normalize_dir ( @wiki . page_file_dir || checked_dir ) checked_dir . downcase! end map . each do | entry | next if entry . name . to_s . empty? next unless entry . dir . downcase == checked_dir next unless page_match ( name , entry . name ) return entry . page ( @wiki , @version ) end return nil end
Find a page in a given tree.
Find a page in a given tree .
# nothing was found
map
name
checked_dir