mymedia-wiki 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mymedia-wiki.rb +83 -30
- data.tar.gz.sig +0 -0
- metadata +30 -29
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33e0a0bee92a17d69e4f8767c451ead3af64e1241c529408e8508716cf532694
|
4
|
+
data.tar.gz: ca7f0ee37dd5330553612085864ced39b60eec62bf9218a94092f4854447143a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a76d8a5362a14c9a369813e4ce7bb3c10e5d500cda0b031a40b567c7a85d14b55b8e73ffdfa3fcc5425655d8d746b949601d7c266c905273348b6861ef3ab97
|
7
|
+
data.tar.gz: e6856cb4dfc0f40b1a4e562707fe55bd2d63c1825cae27882f508a64f723660e4867873f2edcf5de210a8dd2db975aa512fbd41d93a7b4a6080500ecd5456354
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-wiki.rb
CHANGED
@@ -17,15 +17,15 @@ class MyMediaWikiBase < MyMediaPages
|
|
17
17
|
|
18
18
|
super(media_type: media_type, public_type: @public_type=media_type,
|
19
19
|
ext: '.(html|md|txt)', config: config, log: log, debug: debug)
|
20
|
-
|
21
|
-
end
|
22
|
-
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
23
|
def copy_publish(filename, raw_msg='')
|
24
24
|
|
25
25
|
@log.info 'MyMediaWiki inside copy_publish' if @log
|
26
26
|
@filename = filename
|
27
|
-
src_path = File.join(@media_src, filename)
|
28
|
-
|
27
|
+
#jr 2011-10-09 src_path = File.join(@media_src, filename)
|
28
|
+
src_path = filename
|
29
29
|
|
30
30
|
html_filename = basename(@media_src, src_path).sub(/(?:md|txt)$/,'html')
|
31
31
|
|
@@ -35,11 +35,11 @@ class MyMediaWikiBase < MyMediaPages
|
|
35
35
|
|
36
36
|
ext = File.extname(src_path)
|
37
37
|
|
38
|
-
raw_destination =
|
38
|
+
raw_destination = [@home, @www, 'r', public_path].join('/')
|
39
39
|
FileX.mkdir_p File.dirname(raw_destination)
|
40
40
|
raw_dest_xml = raw_destination.sub(/html$/,'xml')
|
41
41
|
|
42
|
-
destination = File.join(@home, public_path)
|
42
|
+
destination = File.join(@home, @www, public_path)
|
43
43
|
|
44
44
|
puts 'raw_destination: ' + raw_destination.inspect if @debug
|
45
45
|
|
@@ -71,13 +71,14 @@ class MyMediaWikiBase < MyMediaPages
|
|
71
71
|
|
72
72
|
@log.info 'mymedia-wiki/copy_publish: after modify_xml' if @log
|
73
73
|
|
74
|
-
FileX.write destination,
|
75
|
-
|
74
|
+
FileX.write destination,
|
75
|
+
xsltproc(File.join(@home, @www, 'xsl', @public_type + '.xsl'),
|
76
|
+
raw_dest_xml)
|
76
77
|
|
77
78
|
target_url = [@website, @public_type, html_filename].join('/')
|
78
79
|
target_url.sub!(/\.html$/,'') if @omit_html_ext
|
79
80
|
|
80
|
-
json_filepath =
|
81
|
+
json_filepath = [@home, @www, @public_type, 'dynarex.json'].join('/')
|
81
82
|
publish_dxlite(json_filepath, {title: raw_msg, url: target_url})
|
82
83
|
=begin
|
83
84
|
msg = "%s %s" % [target_url, raw_msg ]
|
@@ -92,7 +93,9 @@ class MyMediaWikiBase < MyMediaPages
|
|
92
93
|
|
93
94
|
def delete(id)
|
94
95
|
|
95
|
-
|
96
|
+
puts 'inside delete ' if @debug
|
97
|
+
|
98
|
+
dx = DxLite.new(File.join(@home, @www, @public_type, 'dynarex.json'),
|
96
99
|
autosave: true)
|
97
100
|
|
98
101
|
# Use the id to identify the entry in the dynarex.json file
|
@@ -104,37 +107,28 @@ class MyMediaWikiBase < MyMediaPages
|
|
104
107
|
filename = File.basename(rx.url).sub(/\.html$/,'')
|
105
108
|
|
106
109
|
# Within r/wiki delete the 2 files: .txt and .xml
|
107
|
-
FileX.rm File.join(@home, 'r',
|
108
|
-
FileX.rm File.join(@home, 'r', @public_type, filename + '.xml')
|
110
|
+
FileX.rm File.join(@home, @www,'r', @public_type, filename + '.txt')
|
111
|
+
FileX.rm File.join(@home, @www,'r', @public_type, filename + '.xml')
|
109
112
|
|
110
113
|
# Within wiki, delete the .html file
|
111
|
-
FileX.rm File.join(@home, @public_type, filename + '.html')
|
114
|
+
FileX.rm File.join(@home, @www, @public_type, filename + '.html')
|
112
115
|
|
113
116
|
# Delete the entry from the dynarex.json file.
|
114
117
|
dx.delete id
|
115
118
|
|
116
119
|
end
|
117
|
-
|
118
|
-
def writecopy_publish(raws)
|
119
|
-
|
120
|
-
s = raws.strip.gsub(/\r/,'')
|
121
|
-
|
122
|
-
title = escape(s.lines[0].chomp)
|
123
|
-
filename = title + '.txt'
|
124
|
-
FileX.write File.join(@media_src, filename), s
|
125
|
-
|
126
|
-
copy_publish filename
|
127
|
-
end
|
128
|
-
|
120
|
+
|
129
121
|
|
130
122
|
end
|
131
123
|
|
132
124
|
class MyMediaWiki < MyMediaWikiBase
|
133
125
|
|
134
|
-
def initialize(config: nil, newpg_url: '', log: nil,
|
135
|
-
|
126
|
+
def initialize(media_type: 'wiki', config: nil, newpg_url: '', log: nil,
|
127
|
+
debug: false)
|
128
|
+
|
129
|
+
puts 'inside MyMediaWik initialize' if debug
|
136
130
|
@url4new = newpg_url
|
137
|
-
super(config: config, log: log, debug: debug)
|
131
|
+
super(media_type: media_type, config: config, log: log, debug: debug)
|
138
132
|
end
|
139
133
|
|
140
134
|
def writecopy_publish(raws)
|
@@ -158,7 +152,7 @@ class MyMediaWiki < MyMediaWikiBase
|
|
158
152
|
if r then
|
159
153
|
'<a href="' + '/wiki/' + r.title[/^#{title}/i] + '">' + title +'</a>'
|
160
154
|
else
|
161
|
-
'<a href="' + url4new + escape(title) + '" class="new" title="' \
|
155
|
+
'<a href="' + @url4new + escape(title) + '" class="new" title="' \
|
162
156
|
+ title + ' (page does not exist)">' + title + '</a>'
|
163
157
|
end
|
164
158
|
|
@@ -175,3 +169,62 @@ class MyMediaWiki < MyMediaWikiBase
|
|
175
169
|
end
|
176
170
|
|
177
171
|
end
|
172
|
+
|
173
|
+
|
174
|
+
class WikiTester23 < MyMediaWiki
|
175
|
+
|
176
|
+
# it is assumed this class will be executed from a test directory
|
177
|
+
# containing the following auxillary files:
|
178
|
+
# - wiki.xsl
|
179
|
+
# - index-template.html
|
180
|
+
|
181
|
+
def initialize(config: '', cur_dir: '', debug: false)
|
182
|
+
|
183
|
+
@cur_dir = cur_dir
|
184
|
+
super(config: config, debug: debug)
|
185
|
+
@parent_dir = '/tmp/media'
|
186
|
+
@dir = 'wiki'
|
187
|
+
|
188
|
+
end
|
189
|
+
|
190
|
+
def cleanup()
|
191
|
+
|
192
|
+
# remove the previous test files
|
193
|
+
#
|
194
|
+
FileX.rm_r '/tmp/www/*', force: true
|
195
|
+
puts 'Previous /tmp/www files now removed!'
|
196
|
+
end
|
197
|
+
|
198
|
+
def prep()
|
199
|
+
|
200
|
+
#return
|
201
|
+
# create the template files and directories
|
202
|
+
#
|
203
|
+
xsl_src = File.join(@cur_dir, 'wiki.xsl')
|
204
|
+
www_dest = '/tmp/www/xsl/wiki.xsl'
|
205
|
+
r_dest = '/tmp/www/r/xsl/wiki.xsl'
|
206
|
+
index_dest = '/tmp/www/wiki/index-template.html'
|
207
|
+
|
208
|
+
FileX.mkdir_p File.dirname(www_dest)
|
209
|
+
FileX.cp xsl_src, www_dest
|
210
|
+
|
211
|
+
FileX.mkdir_p File.dirname(r_dest)
|
212
|
+
FileX.cp xsl_src, r_dest
|
213
|
+
|
214
|
+
FileX.mkdir_p File.dirname(index_dest)
|
215
|
+
FileX.cp File.join(@cur_dir, 'index-template.html'), '/tmp/www/wiki/index-template.html'
|
216
|
+
|
217
|
+
filepath = File.join(@parent_dir, @dir)
|
218
|
+
FileUtils.mkdir_p filepath
|
219
|
+
end
|
220
|
+
|
221
|
+
# create the input file
|
222
|
+
#
|
223
|
+
def write(filename: '', content: '')
|
224
|
+
|
225
|
+
File.write File.join(@parent_dir, @dir, filename), content
|
226
|
+
puts 'debug: filename: ' + filename.inspect
|
227
|
+
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mymedia-wiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,32 +10,33 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
13
|
+
MIIEljCCAv6gAwIBAgIBATANBgkqhkiG9w0BAQsFADBIMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
+
8ixkARkWAmV1MB4XDTIzMDIyMjE5MDQxNloXDTI0MDIyMjE5MDQxNlowSDESMBAG
|
16
|
+
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
|
+
EjAQBgoJkiaJk/IsZAEZFgJldTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoC
|
18
|
+
ggGBALnwNOn1D0D30UL6FQBCVuCrZWCWXsZlg/ITS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CR0zp+SDoB4dCEHxodl7WvQ/6tnvo3Wm86Wh+DAbUCeoPG4kRDNNM2k4JwX8JWH
|
34
|
+
jPzEaQXqsZ04CYgBniLmnzqqeO3U9eAsRPVb0xNW3ZqSeNxiQS7ZoxnNx1mNdTWS
|
35
|
+
badKerIRQ+aTaTzR9KVZ01QlerkbtVZL6TbNPlE/uuz2xoI3GRd2Ix8issdB8cCn
|
36
|
+
oieYuM8pF85DLjFpVCyuRfmjN9NT+eGZU72IfIAEOwJ2gRfCQBorLdrKWTBk9jpd
|
37
|
+
034gd1EDuJQgprCLmdjGpAhud/laq9IhN4o=
|
37
38
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
39
|
+
date: 2023-02-22 00:00:00.000000000 Z
|
39
40
|
dependencies:
|
40
41
|
- !ruby/object:Gem::Dependency
|
41
42
|
name: mymedia-pages
|
@@ -46,7 +47,7 @@ dependencies:
|
|
46
47
|
version: '0.5'
|
47
48
|
- - ">="
|
48
49
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.5.
|
50
|
+
version: 0.5.6
|
50
51
|
type: :runtime
|
51
52
|
prerelease: false
|
52
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -56,7 +57,7 @@ dependencies:
|
|
56
57
|
version: '0.5'
|
57
58
|
- - ">="
|
58
59
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.5.
|
60
|
+
version: 0.5.6
|
60
61
|
description:
|
61
62
|
email: digital.robertson@gmail.com
|
62
63
|
executables: []
|
@@ -83,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
84
|
- !ruby/object:Gem::Version
|
84
85
|
version: '0'
|
85
86
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
87
|
+
rubygems_version: 3.4.4
|
87
88
|
signing_key:
|
88
89
|
specification_version: 4
|
89
90
|
summary: Transforms a kind of Markdown document using Kramdown and XSLT.
|
metadata.gz.sig
CHANGED
Binary file
|