lib/gollum-lib/page.rb in gitlab-gollum-lib-4.2.7.1 vs lib/gollum-lib/page.rb in gitlab-gollum-lib-4.2.7.2

- old
+ new

@@ -2,13 +2,13 @@ module Gollum class Page include Pagination Wiki.page_class = self - + SUBPAGENAMES = [:header, :footer, :sidebar] - + # Sets a Boolean determing whether this page is a historical version. # # Returns nothing. attr_writer :historical @@ -472,11 +472,11 @@ # the current directory, starts walking up the directory tree to try and find one # within parent directories. def find_sub_pages(subpagenames = SUBPAGENAMES, map = nil) subpagenames.each{|subpagename| instance_variable_set("@#{subpagename}", nil)} return nil if self.filename =~ /^_/ || ! self.version - + map ||= @wiki.tree_map_for(@wiki.ref, true) valid_names = subpagenames.map(&:capitalize).join("|") # From Ruby 2.2 onwards map.select! could be used map = map.select{|entry| entry.name =~ /^_(#{valid_names})/ } return if map.empty? @@ -488,27 +488,27 @@ filename = "_#{subpagename.to_s.capitalize}" searchpath = dir == Pathname.new('.') ? Pathname.new(filename) : dir + filename entrypath = ::Pathname.new(blob_entry.path) # Ignore extentions - entrypath = entrypath.dirname + entrypath.basename(entrypath.extname) + entrypath = entrypath.dirname + entrypath.basename(entrypath.extname) entrypath == searchpath end - + if subpageblob - subpage = subpageblob.page(@wiki, @version) + subpage = subpageblob.page(@wiki, @version) subpage.parent_page = self instance_variable_set("@#{subpagename}", subpage) break end break if dir == Pathname.new('.') end - end + end end def inspect %(#<#{self.class.name}:#{object_id} #{name} (#{format}) @wiki=#{@wiki.repo.path.inspect}>) end - + end end