Wiki2Go 1.15.0 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/Web2Go/MockResponse.rb +1 -1
- data/lib/Wiki2Go/Install/make_site.rb +4 -1
- data/lib/Wiki2Go/Web.rb +5 -2
- data/lib/Wiki2Go/Wiki2Go.rb +4 -9
- data/lib/Wiki2Go/Wiki2GoConfig.rb +5 -3
- data/lib/Wiki2Go/Wiki2GoServlet.rb +9 -11
- data/lib/Wiki2Go/WikiFormatter.rb +11 -3
- metadata +2 -2
data/lib/Web2Go/MockResponse.rb
CHANGED
|
@@ -299,9 +299,12 @@ module Wiki2Go
|
|
|
299
299
|
if !owner.group.nil? then
|
|
300
300
|
group_id = Etc.getgrnam(owner.group).gid
|
|
301
301
|
end
|
|
302
|
+
mode = File.stat(dir).mode | 02775
|
|
303
|
+
File.chmod(mode,dir)
|
|
304
|
+
File.chown(user_id,group_id,dir)
|
|
302
305
|
Dir.glob(File.join(dir,'**/*')).each do |file|
|
|
303
306
|
if file[0] != '.' then
|
|
304
|
-
mode = File.stat(file).mode |
|
|
307
|
+
mode = File.stat(file).mode | 02775
|
|
305
308
|
File.chmod(mode,file)
|
|
306
309
|
File.chown(user_id,group_id,file)
|
|
307
310
|
end
|
data/lib/Wiki2Go/Web.rb
CHANGED
|
@@ -23,7 +23,7 @@ module Wiki2Go
|
|
|
23
23
|
# directory containing scripts
|
|
24
24
|
attr_accessor :script_prefix
|
|
25
25
|
# CGI/Webrick request
|
|
26
|
-
|
|
26
|
+
attr_accessor :request
|
|
27
27
|
# subdirectory where to find the wiki
|
|
28
28
|
attr_accessor :subsite
|
|
29
29
|
|
|
@@ -46,7 +46,10 @@ module Wiki2Go
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def clone
|
|
49
|
-
|
|
49
|
+
copy = Web.new(@server,@port,@subsite,@script_prefix,@verb,@name,@current_page,@request)
|
|
50
|
+
copy.alias = @alias
|
|
51
|
+
copy.title = @title
|
|
52
|
+
return copy
|
|
50
53
|
end
|
|
51
54
|
|
|
52
55
|
def user
|
data/lib/Wiki2Go/Wiki2Go.rb
CHANGED
|
@@ -13,7 +13,7 @@ module Wiki2Go
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def view(web)
|
|
16
|
-
@config.log("Wiki2Go view #{web.inspect}")
|
|
16
|
+
# @config.log("Wiki2Go view #{web.inspect}")
|
|
17
17
|
html = @config.redirect_to_html?(web)
|
|
18
18
|
formatter = Wiki2Go::Formatter.new(web,@config.storage,@config,html,@config.editable?(web))
|
|
19
19
|
|
|
@@ -178,7 +178,6 @@ module Wiki2Go
|
|
|
178
178
|
report = ["Generating HTML\r\n" , "<ul>"]
|
|
179
179
|
files = @config.storage.all_pages_in(web.name)
|
|
180
180
|
files.each do |file|
|
|
181
|
-
@config.log("Generating file #{file}")
|
|
182
181
|
report << "<li>#{file}</li>\r\n"
|
|
183
182
|
pageweb = @config.static_web(web)
|
|
184
183
|
pageweb.current_page = file
|
|
@@ -216,8 +215,6 @@ module Wiki2Go
|
|
|
216
215
|
|
|
217
216
|
def perform(web,request)
|
|
218
217
|
|
|
219
|
-
@config.log("Wiki2Go perform #{web.inspect}")
|
|
220
|
-
|
|
221
218
|
if @config.allow_dynamic_pages then
|
|
222
219
|
html = @config.redirect_to_html?(web)
|
|
223
220
|
formatter = Wiki2Go::Formatter.new(web,@config.storage,@config,html,@config.editable?(web))
|
|
@@ -251,6 +248,7 @@ module Wiki2Go
|
|
|
251
248
|
|
|
252
249
|
def save_changes(web,changes)
|
|
253
250
|
if @config.generate_html then
|
|
251
|
+
web = @config.static_web(web)
|
|
254
252
|
html = true
|
|
255
253
|
formatter = Wiki2Go::Formatter.new(web,@config.storage,@config,html,@config.editable?(web))
|
|
256
254
|
|
|
@@ -262,7 +260,6 @@ module Wiki2Go
|
|
|
262
260
|
end
|
|
263
261
|
|
|
264
262
|
def save_html(web)
|
|
265
|
-
@config.log("Save html for #{web.inspect}")
|
|
266
263
|
if @config.generate_html then
|
|
267
264
|
static_web = @config.static_web(web)
|
|
268
265
|
@config.storage.save_html(static_web.name,static_web.current_page, view_html(static_web))
|
|
@@ -275,10 +272,8 @@ module Wiki2Go
|
|
|
275
272
|
files = @config.storage.search(web.name,pagename)
|
|
276
273
|
files << @config.storage.load_page(web.name,pagename)
|
|
277
274
|
files.each do |file|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
static_web = @config.static_web(pageweb)
|
|
281
|
-
@config.log("Generating HTML for #{file.title}, web = #{static_web.inspect}")
|
|
275
|
+
static_web = @config.static_web(web)
|
|
276
|
+
static_web.current_page = file.title
|
|
282
277
|
@config.storage.save_html(static_web.name,static_web.current_page, view_html_of_page(static_web,file))
|
|
283
278
|
end
|
|
284
279
|
end
|
|
@@ -86,9 +86,11 @@ module Wiki2Go
|
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
def static_web(web)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
copy = web.clone
|
|
90
|
+
copy.server = web.server.gsub(/^edit\./,"www.")
|
|
91
|
+
copy.script_prefix = web.script_prefix.gsub(/\/secure/,"")
|
|
92
|
+
copy.request = nil
|
|
93
|
+
return copy
|
|
92
94
|
end
|
|
93
95
|
|
|
94
96
|
def accept_page?(web,content)
|
|
@@ -15,10 +15,9 @@ module Wiki2Go
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def execute(request,response)
|
|
18
|
-
@config.log("Request cookies = #{request.cookies}")
|
|
19
|
-
response.add_cookies(request.cookies)
|
|
18
|
+
@config.log("Request cookies = #{request.cookies.inspect}")
|
|
20
19
|
result = execute_command(request,response)
|
|
21
|
-
@config.log("Response cookies = #{response.cookies}")
|
|
20
|
+
@config.log("Response cookies = #{response.cookies.inspect}")
|
|
22
21
|
result
|
|
23
22
|
end
|
|
24
23
|
|
|
@@ -48,13 +47,13 @@ module Wiki2Go
|
|
|
48
47
|
name = req.parameter('title',wikiweb.current_page)
|
|
49
48
|
author = req.parameter('author')
|
|
50
49
|
remember_me = req.parameter('remember_me')
|
|
51
|
-
|
|
50
|
+
@config.log("Author = #{author}, remember = #{remember_me}")
|
|
52
51
|
|
|
53
52
|
|
|
54
53
|
if !author.nil? && author.length > 0 then # !wikiweb.secure &&
|
|
55
54
|
wikiweb.alias = author
|
|
56
55
|
timeout = Time.now + 7 * 24 * 3600
|
|
57
|
-
res.add_cookie(USER_COOKIE,author,nil,
|
|
56
|
+
res.add_cookie(USER_COOKIE,author,nil,'/',timeout) unless remember_me.nil?
|
|
58
57
|
end
|
|
59
58
|
|
|
60
59
|
wiki = Wiki2Go::Wiki.new(@config)
|
|
@@ -162,7 +161,7 @@ module Wiki2Go
|
|
|
162
161
|
|
|
163
162
|
def execute_command(req,res)
|
|
164
163
|
wikiweb = Wiki2Go::Web.from_request(req,@config)
|
|
165
|
-
@config.log("WIKI Web = #{wikiweb.inspect}")
|
|
164
|
+
# @config.log("WIKI Web = #{wikiweb.inspect}")
|
|
166
165
|
command = wikiweb.verb
|
|
167
166
|
if command =~ /^([^\.]+)\./ then
|
|
168
167
|
command = $1
|
|
@@ -182,18 +181,17 @@ module Wiki2Go
|
|
|
182
181
|
|
|
183
182
|
def perform(method,req,res,wikiweb)
|
|
184
183
|
begin
|
|
185
|
-
@config.log("==> Cookies for #{method}: #{req.cookies.inspect}")
|
|
184
|
+
# @config.log("==> Cookies for #{method}: #{req.cookies.inspect}")
|
|
186
185
|
cookie = req.cookie(USER_COOKIE)
|
|
187
|
-
@config.log("User Cookie = #{cookie.inspect}") unless cookie.nil?
|
|
186
|
+
# @config.log("User Cookie = #{cookie.inspect}") unless cookie.nil?
|
|
188
187
|
|
|
189
|
-
author = cookie.value unless cookie.nil?
|
|
188
|
+
author = cookie.value.to_s unless cookie.nil?
|
|
190
189
|
|
|
191
190
|
if !author.nil? && author.length > 0 then # !wikiweb.secure &&
|
|
192
|
-
wikiweb.alias = author
|
|
191
|
+
wikiweb.alias = author
|
|
193
192
|
end
|
|
194
193
|
|
|
195
194
|
result = self.send(method,req,res,wikiweb)
|
|
196
|
-
@config.log("<== Cookies for #{method}: #{res.cookies.inspect}")
|
|
197
195
|
return result
|
|
198
196
|
rescue WEBrick::HTTPStatus::Redirect => redirect then
|
|
199
197
|
raise redirect
|
|
@@ -131,11 +131,11 @@ module Wiki2Go
|
|
|
131
131
|
end
|
|
132
132
|
|
|
133
133
|
def absolute_url
|
|
134
|
-
return @web.base_url +
|
|
134
|
+
return @web.base_url + view_page_url(@web.name,@web.current_page)
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
def absolute_url_of_topic(topic)
|
|
138
|
-
return @web.base_url +
|
|
138
|
+
return @web.base_url + view_page_url(@web.name,topic)
|
|
139
139
|
end
|
|
140
140
|
|
|
141
141
|
def edit_link(subwiki,page,name)
|
|
@@ -202,7 +202,7 @@ module Wiki2Go
|
|
|
202
202
|
return "<a href=\"#{changes_url}\">#{desc}</a>"
|
|
203
203
|
end
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
def view_page_url(subwiki,page)
|
|
206
206
|
if @generate_html then
|
|
207
207
|
return join(subwiki,page + ".html")
|
|
208
208
|
else
|
|
@@ -210,6 +210,14 @@ module Wiki2Go
|
|
|
210
210
|
end
|
|
211
211
|
end
|
|
212
212
|
|
|
213
|
+
def view_url(subwiki,page)
|
|
214
|
+
if @absolute_urls then
|
|
215
|
+
return File.join(@web.base_url,view_page_url(subwiki,page))
|
|
216
|
+
else
|
|
217
|
+
return view_page_url(subwiki,page)
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
213
221
|
|
|
214
222
|
|
|
215
223
|
def view_link(subwiki,page,name)
|
metadata
CHANGED
|
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
|
3
3
|
specification_version: 1
|
|
4
4
|
name: Wiki2Go
|
|
5
5
|
version: !ruby/object:Gem::Version
|
|
6
|
-
version: 1.15.
|
|
7
|
-
date: 2005-07-
|
|
6
|
+
version: 1.15.1
|
|
7
|
+
date: 2005-07-24 00:00:00 +02:00
|
|
8
8
|
summary: Wiki2Go is a Ruby Wiki
|
|
9
9
|
require_paths:
|
|
10
10
|
- lib
|