mymedia-pages 0.5.3 → 0.5.4
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-pages.rb +29 -13
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: c090792550a9c690e5c798257f4e750070236fdcec48c9be467a8fb463aefb83
|
4
|
+
data.tar.gz: 15c98cd42e3fa859737c1529d58e2a240f546e170d635d19c36ba941d4f7a2f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1401804769832c5b3e006051fc3df5e8fcf7800845816afe00b86e94fd28cf76fae4ed782e20454fec52274e81595c361a903c753d7594426b0a2690dd15d903
|
7
|
+
data.tar.gz: fc928b7156eaf1ea0a8495efe815d77d7bcbf801c5c2522561c5e1b0cf2b981993fa6a1746ade38921b9e843d906357a4b326954dbc0262868271573db20e75b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-pages.rb
CHANGED
@@ -14,14 +14,26 @@ module PageReader
|
|
14
14
|
|
15
15
|
# read the source file
|
16
16
|
#
|
17
|
-
def read(
|
18
|
-
|
17
|
+
def read(raw_filename)
|
18
|
+
|
19
|
+
filename = raw_filename.gsub(/ +/,'_')#.gsub(/'/,'%27')
|
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 + '.html')
|
31
|
+
else
|
32
|
+
# static file
|
33
|
+
File.join(@home, @public_type, s)
|
34
|
+
end
|
35
|
+
|
36
|
+
FileX.read(filepath)
|
25
37
|
end
|
26
38
|
|
27
39
|
end
|
@@ -50,7 +62,7 @@ class MyMediaPages < MyMedia::Base
|
|
50
62
|
|
51
63
|
@log.info 'MyMediaPagesinside copy_publish' if @log
|
52
64
|
@filename = filename
|
53
|
-
src_path = File.join(
|
65
|
+
src_path = File.join(filename)
|
54
66
|
|
55
67
|
if File.basename(src_path)[/[a-z]\d{6}T\d{4}\.(?:html)/] then
|
56
68
|
return file_publish(src_path, raw_msg)
|
@@ -66,7 +78,7 @@ class MyMediaPages < MyMedia::Base
|
|
66
78
|
dest_xml = destination.sub(/html$/,'xml')
|
67
79
|
x_destination = raw_destination.sub(/\.html$/,ext)
|
68
80
|
|
69
|
-
|
81
|
+
puts "src: %s dest: %s" % [src_path, x_destination] if @debug
|
70
82
|
FileX.cp src_path, x_destination
|
71
83
|
|
72
84
|
source = x_destination[/\/r\/#{@public_type}.*/]
|
@@ -84,13 +96,13 @@ class MyMediaPages < MyMedia::Base
|
|
84
96
|
@log.info 'mymedia_pages/copy_publish: after modify_xml' if @log
|
85
97
|
|
86
98
|
FileX.write raw_destination,
|
87
|
-
xsltproc(
|
88
|
-
|
99
|
+
xsltproc(File.join(@home, 'r', 'xsl', @public_type + '.xsl'),
|
100
|
+
raw_dest_xml)
|
89
101
|
FileX.write destination,
|
90
|
-
xsltproc(
|
102
|
+
xsltproc(File.join(@home, @www, 'xsl', @public_type + '.xsl'),
|
103
|
+
dest_xml)
|
91
104
|
|
92
|
-
html_filename = basename(@media_src, src_path)
|
93
|
-
.sub(/(?:md|txt)$/,'html')
|
105
|
+
html_filename = basename(@media_src, src_path).sub(/(?:md|txt)$/,'html')
|
94
106
|
|
95
107
|
|
96
108
|
xml_filename = html_filename.sub(/html$/,'xml')
|
@@ -114,7 +126,7 @@ class MyMediaPages < MyMedia::Base
|
|
114
126
|
|
115
127
|
else
|
116
128
|
|
117
|
-
html_filename = basename(
|
129
|
+
html_filename = basename(src_path)
|
118
130
|
|
119
131
|
if html_filename =~ /\// then
|
120
132
|
FileX.mkdir_p File.dirname(html_filename)
|
@@ -199,6 +211,10 @@ class MyMediaPages < MyMedia::Base
|
|
199
211
|
|
200
212
|
def modify_xml(docx, filepath, xslpath='r/')
|
201
213
|
|
214
|
+
if @debug then
|
215
|
+
'mymedia_pages: inside modify_xml: docx.xml: ' + docx.xml.inspect
|
216
|
+
end
|
217
|
+
|
202
218
|
if @log then
|
203
219
|
@log.info 'mymedia_pages: inside modify_xml: docx.xml: ' + docx.xml.inspect
|
204
220
|
end
|
@@ -257,7 +273,7 @@ class MyMediaPages < MyMedia::Base
|
|
257
273
|
xml.access access if access
|
258
274
|
xml.source_url filename
|
259
275
|
xml.source_file File.basename(filename)
|
260
|
-
xml.original_file original_file
|
276
|
+
xml.original_file File.basename(original_file)
|
261
277
|
xml.published Time.now.strftime("%d-%m-%Y %H:%M")
|
262
278
|
xml.filetitle original_file[/.*(?=\.\w+$)/]
|
263
279
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
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.4
|
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-03-
|
38
|
+
date: 2022-03-21 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: mymedia
|
metadata.gz.sig
CHANGED
Binary file
|