Class: Ramaze::Dispatcher::File

### Home Classes Methods

### In Files

- lib/thoth/monkeypatch/dispatcher/file.rb

### Parent

Object

### Methods

- ::in_public?
- ::resolve_path

### Files

- robots.txt

### Class/Module Index

Quicksearch

- Thoth
- Thoth::AdminController
- Thoth::ArchiveController
- Thoth::Comment
- Thoth::CommentApiController
- Thoth::CommentController
- Thoth::Config
- Thoth::Error
- Thoth::Importer
- Thoth::MainController
- Thoth::Media
- Thoth::MediaController
- Thoth::MinifyController
- Thoth::Page
- Thoth::PageApiController
- Thoth::PageController
- Thoth::Pager
- Thoth::Plugin
- Thoth::Plugin::Delicious
- Thoth::Plugin::Flickr
- Thoth::Plugin::Tags
- Thoth::Plugin::Twitter
- Thoth::Post
- Thoth::PostApiController
- Thoth::PostController
- Thoth::SchemaError
- Thoth::SearchController
- Thoth::Tag
- Thoth::TagApiController
- Thoth::TagController
- Thoth::TagsPostsMap
- Ramaze
- Ramaze::Dispatcher
- Ramaze::Dispatcher::File
- Ramaze::Helper
- Ramaze::Helper::Admin
- Ramaze::Helper::Cookie
- Ramaze::Helper::Error
- Ramaze::Helper::Pagination
- Ramaze::Helper::Sanitize
- Ramaze::Helper::Wiki
- Ramaze::Helper::Ysearch
- Ramaze::Helper::Ysearch::SearchError
- AddMediaSize
- CreateSchema
- PantsImporter
- PoseidonImporter

No matching classes.

# Ramaze::Dispatcher::File

Monkeypatch to add support for multiple public_roots.

### Public Class Methods

in_public?(path) click to toggle source

    # File lib/thoth/monkeypatch/dispatcher/file.rb, line 34
    def in_public?(path)
      path = expand(path)

      @expanded ||= {
        :default => expand(Ramaze::Global.public_root),
        :custom  => expand(Thoth::Config.theme.public)
      }

      path.start_with?(@expanded[:default]) ||
          path.start_with?(@expanded[:custom])
    end

resolve_path(path) click to toggle source

    # File lib/thoth/monkeypatch/dispatcher/file.rb, line 46
    def resolve_path(path)
      joined = ::File.join(Thoth::Config.theme.public, 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.