mymedia-wiki 0.3.1 → 0.4.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 +49 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- 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: 81fac9c285e97ffd22bc008d834ab169c5a124bec8197070f7afde531159cac1
|
4
|
+
data.tar.gz: 1c28af4dfe8098e6d0cf321f2ef9f22397b7f93ef8ab467930ae843ae84d5d5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb6fbb12dec7a46d580ee9a1cdc295cc6bd0c2fc11bc7e564ca35ae2eea0b3f90680fe0c3ec2d2694340a7a289f0935cc0296631ca1952790fd8737f48e6d7b6
|
7
|
+
data.tar.gz: 6562512cc0dcfd51427bb1b1d293092027dd560c6685cba772bcc388d0ced71335741bea280aea833944dc5e3d89a03e4eab04a1bda47bc93967e0d902cc5fca
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-wiki.rb
CHANGED
@@ -8,7 +8,7 @@ require 'mymedia-pages'
|
|
8
8
|
class MyMediaWikiError < Exception
|
9
9
|
end
|
10
10
|
|
11
|
-
class
|
11
|
+
class MyMediaWikiBase < MyMediaPages
|
12
12
|
include RXFileIOModule
|
13
13
|
|
14
14
|
def initialize(media_type: media_type='wiki',
|
@@ -126,4 +126,52 @@ class MyMediaWiki < MyMediaPages
|
|
126
126
|
copy_publish filename
|
127
127
|
end
|
128
128
|
|
129
|
+
|
130
|
+
end
|
131
|
+
|
132
|
+
class MyMediaWiki < MyMediaWikiBase
|
133
|
+
|
134
|
+
def initialize(config: nil, newpg_url: '', log: nil, debug: false)
|
135
|
+
|
136
|
+
@url4new = newpg_url
|
137
|
+
super(config: config, log: log, debug: debug)
|
138
|
+
end
|
139
|
+
|
140
|
+
def writecopy_publish(raws)
|
141
|
+
|
142
|
+
# The content to be published might contain 1 or more wiki link
|
143
|
+
# e.g. [[topic2022]] or [[topic2022url|topic2022
|
144
|
+
# Here, the link will be transformed to an actual hyperlink which points
|
145
|
+
# to a valid wiki page
|
146
|
+
|
147
|
+
s = raws.gsub(/\[\[([^\]]+)\]\]/) do |x|
|
148
|
+
|
149
|
+
puts 'x: ' + x.inspect if @debug
|
150
|
+
title = $1
|
151
|
+
puts 'searching for title ' + title.inspect if @debug
|
152
|
+
|
153
|
+
# does the title exist?
|
154
|
+
r = find_title(title)
|
155
|
+
|
156
|
+
puts 'r: ' + r.inspect if @debug
|
157
|
+
|
158
|
+
if r then
|
159
|
+
'<a href="' + '/wiki/' + r.title[/^#{title}/i] + '">' + title +'</a>'
|
160
|
+
else
|
161
|
+
'<a href="' + url4new + escape(title) + '" class="new" title="' \
|
162
|
+
+ title + ' (page does not exist)">' + title + '</a>'
|
163
|
+
end
|
164
|
+
|
165
|
+
end
|
166
|
+
|
167
|
+
super(s)
|
168
|
+
|
169
|
+
end
|
170
|
+
|
171
|
+
private
|
172
|
+
|
173
|
+
def find_title(s)
|
174
|
+
find /^#{s} (?=#)/i
|
175
|
+
end
|
176
|
+
|
129
177
|
end
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
y9Yuu5WqjuJZ3NtesI/X2BMzO5Pq/vyXzvVcAv1v2VnVoWoodKFBNGzwA+Lgs+aV
|
36
36
|
5FkMbZJFlcCYg1dUZxGwV5OV
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-04-07 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: mymedia-pages
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
version: '0.5'
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.5.
|
49
|
+
version: 0.5.4
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
version: '0.5'
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.5.
|
59
|
+
version: 0.5.4
|
60
60
|
description:
|
61
61
|
email: digital.robertson@gmail.com
|
62
62
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|