RTFMd 0.10301.11 → 0.10301.12
Sign up to get free protection for your applications and to get access to all the features.
- data/RTFMd.gemspec +1 -1
- data/config/rtfmd.ru +15 -7
- data/lib/gollum/frontend/app.rb +3 -3
- metadata +3 -3
data/RTFMd.gemspec
CHANGED
data/config/rtfmd.ru
CHANGED
@@ -2,12 +2,20 @@ require 'sinatra/base'
|
|
2
2
|
require 'gollum'
|
3
3
|
require 'gollum/frontend/app'
|
4
4
|
|
5
|
-
Precious::App.set(:
|
6
|
-
Precious::App.set(:wiki_options, {
|
7
|
-
:base_path => ENV['RTFMd_BASE_PATH'] == "/" ? "/" : "#{ENV['RTFMd_BASE_PATH']}/"
|
8
|
-
})
|
5
|
+
Precious::App.set(:roots => {})
|
9
6
|
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
ENV['RTFMd_WIKI'].split(/\s*,\s*/).zip(ENV['RTFMd_BASE_PATH'].split(/\s*,\s*/)).each do |wiki_path, base_path|
|
8
|
+
Precious::App.settings.roots[base_path] = {
|
9
|
+
:gollum_path => wiki_path,
|
10
|
+
:wiki_options => {
|
11
|
+
:base_path => base_path == "/" ? "/" : "#{base_path}/"
|
12
|
+
}
|
13
|
+
}
|
13
14
|
|
15
|
+
require 'pp'
|
16
|
+
pp Precious::App.settings.roots[base_path]
|
17
|
+
|
18
|
+
map base_path do
|
19
|
+
run Precious::App
|
20
|
+
end
|
21
|
+
end
|
data/lib/gollum/frontend/app.rb
CHANGED
@@ -46,7 +46,7 @@ module Precious
|
|
46
46
|
|
47
47
|
get %r{/(.+?)/([0-9a-f]{40})} do
|
48
48
|
name = params[:captures][0]
|
49
|
-
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
49
|
+
wiki = Gollum::Wiki.new(settings.roots[request.script_name][:gollum_path], settings.roots[request.script_name][:wiki_options])
|
50
50
|
if page = wiki.page(name, params[:captures][1])
|
51
51
|
@page = page
|
52
52
|
@name = name
|
@@ -59,7 +59,7 @@ module Precious
|
|
59
59
|
end
|
60
60
|
|
61
61
|
get '/pages' do
|
62
|
-
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
62
|
+
wiki = Gollum::Wiki.new(settings.roots[request.script_name][:gollum_path], settings.roots[request.script_name][:wiki_options])
|
63
63
|
@results = wiki.pages
|
64
64
|
@ref = wiki.ref
|
65
65
|
@base_path = wiki.base_path
|
@@ -72,7 +72,7 @@ module Precious
|
|
72
72
|
|
73
73
|
def show_page_or_file(*names)
|
74
74
|
ps = names.collect do |name|
|
75
|
-
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
75
|
+
wiki = Gollum::Wiki.new(settings.roots[request.script_name][:gollum_path], settings.roots[request.script_name][:wiki_options])
|
76
76
|
if page = wiki.page(name)
|
77
77
|
@page = page
|
78
78
|
@name = name
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RTFMd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 41203
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 10301
|
9
|
-
-
|
10
|
-
version: 0.10301.
|
9
|
+
- 12
|
10
|
+
version: 0.10301.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tom Bombadil
|