Sha256: 58c786500fb309f2c08b1312c9b635da069b55cf926dd7a210b071649efab7c4
Contents?: true
Size: 920 Bytes
Versions: 6
Compression:
Stored size: 920 Bytes
Contents
module Ramaze class Dispatcher # Monkeypatch to add support for multiple public_roots. # Stolen from Thoth :) class File class << self def in_public?(path) path = expand(path) @expanded ||= { :default => expand(Ramaze::Global.public_root), :custom => expand(CortexReaver.config[:public_root]) } path.start_with?(@expanded[:default]) || path.start_with?(@expanded[:custom]) end def resolve_path(path) joined = ::File.join(CortexReaver.config[:public_root], path) unless ::File.exist?(joined) joined = ::File.join(Ramaze::Global.public_root, path) end if ::File.directory?(joined) Dir[joined/"{#{INDICES.join(',')}}"].first || joined else joined end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems