Module: Basename
- Defined in:
- basename.rb
Overview
Jekyll filters for working with paths.
Instance Method Summary collapse
-
#basename(filepath) ⇒ String
Filters a string containing a path.
-
#basename_without_extension(filepath) ⇒ Object
Filters a string containing a path.
-
#dirname(filepath) ⇒ String
Filters a string containing a path.
Instance Method Details
#basename(filepath) ⇒ String
Filters a string containing a path.
12 13 14 |
# File 'basename.rb', line 12 def basename(filepath) File.basename(filepath) end |
#basename_without_extension(filepath) ⇒ Object
Filters a string containing a path.
28 29 30 |
# File 'basename.rb', line 28 def basename_without_extension(filepath) File.basename(filepath).split('.')[0...-1].join('.') end |
#dirname(filepath) ⇒ String
Filters a string containing a path.
20 21 22 |
# File 'basename.rb', line 20 def dirname(filepath) File.dirname(filepath) end |