Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/sanitized_filename.rb
Overview
The String class
Instance Method Summary collapse
-
#sanitized ⇒ Object
Sanitizes a filename.
Instance Method Details
#sanitized ⇒ Object
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 |