mymedia-pages 0.5.2 → 0.5.5
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-pages.rb +37 -13
- data.tar.gz.sig +3 -1
- metadata +6 -6
- 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: af918e4dae17e35a6a4c9576e81070f6f26ab5f7820a9bcf273fe4e31a0795b8
|
4
|
+
data.tar.gz: e12380cea62d949ad9c0a31b7d1fb3df23ac4a253bb5eb5f8eeb2c5e03b78941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3302c9c4f33b356a242f668b110778f434ee3fb7f12f0dea3bce3958a0b30f7129c02904bed193208e2d02384f115966e075cffd5765523e09af1212aa221596
|
7
|
+
data.tar.gz: cd97a612da7945a8523d61ef5cc60b163f9893a742567d607950fa00cc0eea89772a9ef7dd22c57dfe53ba841e1510f281a3708afa351f83b54e9dc4fb0508d4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-pages.rb
CHANGED
@@ -14,14 +14,30 @@ module PageReader
|
|
14
14
|
|
15
15
|
# read the source file
|
16
16
|
#
|
17
|
-
def read(
|
18
|
-
|
17
|
+
def read(raw_filename)
|
18
|
+
|
19
|
+
filename = escape(raw_filename)
|
20
|
+
FileX.read File.join(@media_src, filename)
|
21
|
+
|
19
22
|
end
|
20
23
|
|
21
24
|
# view the published file
|
22
25
|
#
|
23
|
-
def view(
|
24
|
-
|
26
|
+
def view(s)
|
27
|
+
|
28
|
+
filepath = if s.count('/') > 1 then
|
29
|
+
# archived file
|
30
|
+
File.join(@home, @www, @public_type, s.sub(/\.html$/,'') + '.html')
|
31
|
+
else
|
32
|
+
# static file
|
33
|
+
File.join(@home, @public_type, s.sub(/\.html$/,'') + '.html')
|
34
|
+
end
|
35
|
+
|
36
|
+
FileX.read(filepath)
|
37
|
+
end
|
38
|
+
|
39
|
+
def escape(s)
|
40
|
+
s.gsub(/ +/,'_')#.gsub(/'/,'%27')
|
25
41
|
end
|
26
42
|
|
27
43
|
end
|
@@ -50,7 +66,7 @@ class MyMediaPages < MyMedia::Base
|
|
50
66
|
|
51
67
|
@log.info 'MyMediaPagesinside copy_publish' if @log
|
52
68
|
@filename = filename
|
53
|
-
src_path = File.join(
|
69
|
+
src_path = File.join(filename)
|
54
70
|
|
55
71
|
if File.basename(src_path)[/[a-z]\d{6}T\d{4}\.(?:html)/] then
|
56
72
|
return file_publish(src_path, raw_msg)
|
@@ -66,7 +82,7 @@ class MyMediaPages < MyMedia::Base
|
|
66
82
|
dest_xml = destination.sub(/html$/,'xml')
|
67
83
|
x_destination = raw_destination.sub(/\.html$/,ext)
|
68
84
|
|
69
|
-
|
85
|
+
puts "src: %s dest: %s" % [src_path, x_destination] if @debug
|
70
86
|
FileX.cp src_path, x_destination
|
71
87
|
|
72
88
|
source = x_destination[/\/r\/#{@public_type}.*/]
|
@@ -84,13 +100,13 @@ class MyMediaPages < MyMedia::Base
|
|
84
100
|
@log.info 'mymedia_pages/copy_publish: after modify_xml' if @log
|
85
101
|
|
86
102
|
FileX.write raw_destination,
|
87
|
-
xsltproc(
|
88
|
-
|
103
|
+
xsltproc(File.join(@home, 'r', 'xsl', @public_type + '.xsl'),
|
104
|
+
raw_dest_xml)
|
89
105
|
FileX.write destination,
|
90
|
-
xsltproc(
|
106
|
+
xsltproc(File.join(@home, @www, 'xsl', @public_type + '.xsl'),
|
107
|
+
dest_xml)
|
91
108
|
|
92
|
-
html_filename = basename(@media_src, src_path)
|
93
|
-
.sub(/(?:md|txt)$/,'html')
|
109
|
+
html_filename = basename(@media_src, src_path).sub(/(?:md|txt)$/,'html')
|
94
110
|
|
95
111
|
|
96
112
|
xml_filename = html_filename.sub(/html$/,'xml')
|
@@ -114,7 +130,7 @@ class MyMediaPages < MyMedia::Base
|
|
114
130
|
|
115
131
|
else
|
116
132
|
|
117
|
-
html_filename = basename(
|
133
|
+
html_filename = basename(src_path)
|
118
134
|
|
119
135
|
if html_filename =~ /\// then
|
120
136
|
FileX.mkdir_p File.dirname(html_filename)
|
@@ -145,6 +161,7 @@ class MyMediaPages < MyMedia::Base
|
|
145
161
|
'before publish_dynarex'
|
146
162
|
end
|
147
163
|
|
164
|
+
target_url.sub!(/\.html$/,'') if @omit_html_ext
|
148
165
|
publish_dynarex(static_filepath, {title: raw_msg, url: target_url })
|
149
166
|
|
150
167
|
end
|
@@ -154,6 +171,9 @@ class MyMediaPages < MyMedia::Base
|
|
154
171
|
|
155
172
|
end
|
156
173
|
|
174
|
+
def escape(s)
|
175
|
+
s.gsub(/ +/,'_')#.gsub(/'/,'%27')
|
176
|
+
end
|
157
177
|
|
158
178
|
private
|
159
179
|
|
@@ -198,6 +218,10 @@ class MyMediaPages < MyMedia::Base
|
|
198
218
|
|
199
219
|
def modify_xml(docx, filepath, xslpath='r/')
|
200
220
|
|
221
|
+
if @debug then
|
222
|
+
'mymedia_pages: inside modify_xml: docx.xml: ' + docx.xml.inspect
|
223
|
+
end
|
224
|
+
|
201
225
|
if @log then
|
202
226
|
@log.info 'mymedia_pages: inside modify_xml: docx.xml: ' + docx.xml.inspect
|
203
227
|
end
|
@@ -256,7 +280,7 @@ class MyMediaPages < MyMedia::Base
|
|
256
280
|
xml.access access if access
|
257
281
|
xml.source_url filename
|
258
282
|
xml.source_file File.basename(filename)
|
259
|
-
xml.original_file original_file
|
283
|
+
xml.original_file File.basename(original_file)
|
260
284
|
xml.published Time.now.strftime("%d-%m-%Y %H:%M")
|
261
285
|
xml.filetitle original_file[/.*(?=\.\w+$)/]
|
262
286
|
end
|
data.tar.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
~E�����H�X�K�4Vr�\Z�È���K�����j�������\��Yv�g�f�d�v|�7y~��+i�{7G�8�\�/%R�b:+���e���<|�n��Jea6���kSF�Q4+�7�f��"�1�����0`���m�Mu�\>�ގԘ��,�4��X��Ȏ{z��Xzulm��h�$��-��/�JbsR������3��X��CaR�@S���ù�̅�ti�����S�]�m�b\i�
|
2
|
+
(�H"�yݭ��i
|
3
|
+
g���Y��/��M�*&;��f���y0�g��>=��C�6R�.�Zw��vF�s+��\���
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mymedia-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
jSG8iFV4kJofCyHyfW6zyZy0d22o23Syxam2rIESaal2RPL7gADDTc8XBe/sFeWr
|
36
36
|
A7Ido2/5qg5YDVloSOHTfzZj
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-04-25 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: mymedia
|
@@ -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
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: martile
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,7 +86,7 @@ dependencies:
|
|
86
86
|
version: '2.3'
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 2.3.
|
89
|
+
version: 2.3.2
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
version: '2.3'
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: 2.3.
|
99
|
+
version: 2.3.2
|
100
100
|
description:
|
101
101
|
email: digital.robertson@gmail.com
|
102
102
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|