class Precious::MapGollum

For use with the –base-path option.

Public Class Methods

new(base_path) click to toggle source
# File lib/gollum/app.rb, line 59
def initialize(base_path)
  base_route = "/#{remove_leading_and_trailing_slashes(base_path)}"
  @mg = Rack::Builder.new do

    map base_route do
      run Precious::App
    end
    map '/' do
      run Proc.new { [302, { 'Location' => base_route }, []] }
    end
    map '/*' do
      run Proc.new { [302, { 'Location' => base_route }, []] }
    end

  end
end

Public Instance Methods

call(env) click to toggle source
# File lib/gollum/app.rb, line 76
def call(env)
  @mg.call(env)
end