class String

The String class

Public Instance Methods

sanitized() click to toggle source

Sanitizes a filename

# File lib/sanitized_filename.rb, line 6
def sanitized
  match = match(/(?m)(?<=\b_site).*$/)
  sanitized_filename = match ? match[0] : self
  sanitized_filename = sanitized_filename.gsub('index.html', '')
  sanitized_filename.gsub('.html', '')
end