Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/sanitized_filename.rb

Overview

The String class

Instance Method Summary collapse

Instance Method Details

#sanitizedObject

Sanitizes a filename



6
7
8
9
10
11
# 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