Page#find_page_in_this_tree is redundant

This commit is contained in:
rick
2010-08-30 16:57:55 -07:00
parent 0500c7e10c
commit 6f077702e1
2 changed files with 34 additions and 38 deletions
+19
View File
@@ -431,6 +431,25 @@ module Gollum
def clear_cache
@ref_map = {}
@tree_map = {}
end # Normalizes a given directory name for searching through tree paths.
# Ensures that a directory begins with a slash, or
#
# normalize_directory("") # => ""
# normalize_directory(".") # => ""
# normalize_directory("foo") # => "/foo"
# normalize_directory("/foo/") # => "/foo"
# normalize_directory("/") # => ""
#
# dir - String directory name.
#
# Returns a normalized String directory name, or nil if no directory
# is given.
def self.normalize_directory(dir)
if dir
dir = ::File.expand_path(dir, '/')
dir = '' if dir == '/'
end
dir
end
end
end