Sha256: 810d6d54bc56640a5abd68a97107c4cda4c9229f9768aab709287483a81c180a

Contents?: true

Size: 723 Bytes

Versions: 1

Compression:

Stored size: 723 Bytes

Contents

require 'sinatra/base'
require 'gollum/frontend/app'
require 'gollum/frontend/indexapp'

rtfm_root = ENV['RTFM_ROOT'] || "/"

Precious::App.set(:roots => {})

ENV['RTFM_REPOS'].split(/[\s,]+/).each do |repo|
  wiki_path, base_path = repo.split(":")
  unless base_path
    base_path = File.basename(wiki_path)
  end

  Precious::App.settings.roots[base_path] = {
    :gollum_path => wiki_path,
    :wiki_options => {
      :base_path => "#{rtfm_root}/#{base_path}/".gsub(/\/{2,}/, "/"),
      :rtfm_root => rtfm_root
    }
  }
end

Precious::App.settings.roots.keys.each do |base_path|
  map "#{rtfm_root}/#{base_path}".gsub(/\/{2,}/, "/") do
    run Precious::App
  end 
end

map rtfm_root do
  run Precious::IndexApp
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
RTFMd-0.10301.15 config/rtfmd.ru