start work on formatted_page

This commit is contained in:
Tom Preston-Werner
2010-04-08 16:20:05 -07:00
parent c8d9b351e2
commit 3ff115048d
7 changed files with 110 additions and 13 deletions
+14 -1
View File
@@ -2,9 +2,22 @@
require 'grit'
# internal
require 'gollum/repo'
require 'gollum/wiki'
require 'gollum/page'
module Gollum
VERSION = '0.0.1'
# Convert a human page name into a canonical page name.
#
# name - The String human page name.
#
# Examples
# Gollum.canonical_name("Bilbo Baggins")
# # => 'Bilbo-Baggins'
#
# Returns the String canonical name.
def self.canonical_name(name)
name.gsub(/ /, '-').sub(/\.(.+?)$/, '')
end
end