mymedia-wiki 0.2.1 → 0.3.0
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mymedia-wiki.rb +27 -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: df6ddf015f7d8f8a2477ef4a05dc8ee0871a8e7bbee2a4fc38c420e015cc719b
|
4
|
+
data.tar.gz: 2380e1044c72c48212a0f36c2d9c6cdba661f9d55db308236878e65abfa108ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0906a8e67b1898df4cbb77bde420e334b22d06a708a3b62d5e580fcb7690363770141d19dbde030750177400d700708022f411b39875acafbbfbdc5334ffa7f
|
7
|
+
data.tar.gz: 28541b18e5fc8911628b889966ee5e7bbfc13aceb5919a95f6ea06a20635d31d895273a055fc85a799f8bdc9ddb6f5b5b0f90fb1f4f3df4dc9965f39e3a4d26d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-wiki.rb
CHANGED
@@ -26,6 +26,7 @@ class MyMediaWiki < MyMediaPages
|
|
26
26
|
@filename = filename
|
27
27
|
src_path = File.join(@media_src, filename)
|
28
28
|
|
29
|
+
|
29
30
|
html_filename = basename(@media_src, src_path).sub(/(?:md|txt)$/,'html')
|
30
31
|
|
31
32
|
FileX.mkdir_p File.dirname(@home + "/#{@public_type}/" + html_filename)
|
@@ -74,6 +75,7 @@ class MyMediaWiki < MyMediaPages
|
|
74
75
|
raw_dest_xml)
|
75
76
|
|
76
77
|
target_url = [@website, @public_type, html_filename].join('/')
|
78
|
+
target_url.sub!(/\.html$/,'') if @omit_html_ext
|
77
79
|
|
78
80
|
json_filepath = "%s/%s/dynarex.json" % [@home, @public_type]
|
79
81
|
publish_dxlite(json_filepath, {title: raw_msg, url: target_url})
|
@@ -88,6 +90,31 @@ class MyMediaWiki < MyMediaPages
|
|
88
90
|
|
89
91
|
end
|
90
92
|
|
93
|
+
def delete(id)
|
94
|
+
|
95
|
+
dx = DxLite.new(File.join(@home, @public_type, 'dynarex.json'),
|
96
|
+
autosave: true)
|
97
|
+
|
98
|
+
# Use the id to identify the entry in the dynarex.json file
|
99
|
+
rx = dx.find_by_id id
|
100
|
+
return unless rx
|
101
|
+
|
102
|
+
# Use the File.basename(url) to identify the file name.
|
103
|
+
# Note: Strip out the extension before adding the target ext.
|
104
|
+
filename = File.basename(rx.url).sub(/\.html$/,'')
|
105
|
+
|
106
|
+
# Within r/wiki delete the 2 files: .txt and .xml
|
107
|
+
FileX.rm File.join(@home, 'r', @public_type, filename + '.txt')
|
108
|
+
FileX.rm File.join(@home, 'r', @public_type, filename + '.xml')
|
109
|
+
|
110
|
+
# Within wiki, delete the .html file
|
111
|
+
FileX.rm File.join(@home, @public_type, filename + '.html')
|
112
|
+
|
113
|
+
# Delete the entry from the dynarex.json file.
|
114
|
+
dx.delete id
|
115
|
+
|
116
|
+
end
|
117
|
+
|
91
118
|
def writecopy_publish(raws)
|
92
119
|
|
93
120
|
s = raws.strip.gsub(/\r/,'')
|
@@ -105,5 +132,4 @@ class MyMediaWiki < MyMediaPages
|
|
105
132
|
s.gsub(/ +/,'_')#.gsub(/'/,'%27')
|
106
133
|
end
|
107
134
|
|
108
|
-
|
109
135
|
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.3.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-03-
|
38
|
+
date: 2022-03-19 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.2
|
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.2
|
60
60
|
description:
|
61
61
|
email: digital.robertson@gmail.com
|
62
62
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|