Class: Lifer::URIStrategy::Pretty
- Inherits:
-
Base
- Object
- Base
- Lifer::URIStrategy::Pretty
show all
- Defined in:
- lib/lifer/uri_strategy/pretty.rb
Instance Attribute Summary
Attributes inherited from Base
#root
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#name ⇒ Object
2
3
4
|
# File 'lib/lifer/uri_strategy/pretty.rb', line 2
def name
"pretty"
end
|
#output_file(entry) ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/lifer/uri_strategy/pretty.rb', line 6
def output_file(entry)
basename = File.basename(entry.file, ".*")
Pathname entry.file.to_s
.gsub(/#{root}[\/]{0,1}/, "")
.gsub(/#{basename}(\..+)/, "#{basename}/index.html")
end
|