Class: Precious::MapGollum

Inherits:
Object
  • Object
show all
Defined in:
lib/gollum/app.rb

Overview

For use with the –base-path option.

Instance Method Summary collapse

Constructor Details

#initialize(base_path) ⇒ MapGollum

Returns a new instance of MapGollum.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/gollum/app.rb', line 50

def initialize(base_path)
  @mg = Rack::Builder.new do

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

  end
end

Instance Method Details

#call(env) ⇒ Object



66
67
68
# File 'lib/gollum/app.rb', line 66

def call(env)
  @mg.call(env)
end