Module: Ciridiri::Paths

Included in:
Page
Defined in:
lib/ciridiri/paths.rb

Instance Method Summary collapse

Instance Method Details

#path_from_uri(uri) ⇒ Object

Convert ‘uri` to `path` in a file system including `content_dir` and a source file extension `/team/pro/chuck-norris` -> `content_dir/team/pro/chuck-norris.text`



5
6
7
8
9
# File 'lib/ciridiri/paths.rb', line 5

def path_from_uri(uri)
  path = uri.split("/")
  filename = path.pop
  File.join(content_dir, path, "#{filename}#{Page::SOURCE_FILE_EXT}")
end