mymedia-pages 0.5.0 → 0.5.3
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 +24 -12
- data.tar.gz.sig +0 -0
- metadata +19 -20
- 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: 3f1212494cddb465a2992c38cf493903ca6228e9e0852d358953207de7cc2c27
|
4
|
+
data.tar.gz: b19b7b29329da34d44863aa1025d6206c4ecc684beb264b2085101ccdeb828e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9404f5def759be60fd1ea4f75c9d37f117065cc4a7ba1adf041d1dce78c61296b64655f36c9553616fd5039eabaadbe63f3870cb1cbae7e0a81c3ff151ced51a
|
7
|
+
data.tar.gz: 849e0bdc4d0d70909d33a486910609574a324913d997b7bb7d341d6958af1f8e6539948f307d507abb845362223f4ab78927f4b59acf6a2f1cc444d26ee7ad45
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-pages.rb
CHANGED
@@ -6,10 +6,11 @@
|
|
6
6
|
require 'mymedia'
|
7
7
|
require 'martile'
|
8
8
|
require 'kramdown'
|
9
|
+
require 'rxfileio'
|
9
10
|
|
10
11
|
|
11
12
|
module PageReader
|
12
|
-
include
|
13
|
+
include RXFRead
|
13
14
|
|
14
15
|
# read the source file
|
15
16
|
#
|
@@ -29,7 +30,6 @@ class MyMediaPagesError < Exception
|
|
29
30
|
end
|
30
31
|
|
31
32
|
class MyMediaPages < MyMedia::Base
|
32
|
-
include RXFHelperModule
|
33
33
|
include MyMedia::IndexReader
|
34
34
|
include PageReader
|
35
35
|
|
@@ -83,19 +83,25 @@ class MyMediaPages < MyMedia::Base
|
|
83
83
|
|
84
84
|
@log.info 'mymedia_pages/copy_publish: after modify_xml' if @log
|
85
85
|
|
86
|
-
FileX.write raw_destination,
|
86
|
+
FileX.write raw_destination,
|
87
|
+
xsltproc("#{@home}/r/xsl/#{@public_type}.xsl", raw_dest_xml)
|
87
88
|
|
88
|
-
FileX.write destination,
|
89
|
+
FileX.write destination,
|
90
|
+
xsltproc("#{@home}/#{@www}/xsl/#{@public_type}.xsl", dest_xml)
|
89
91
|
|
90
|
-
html_filename = basename(@media_src, src_path)
|
92
|
+
html_filename = basename(@media_src, src_path)\
|
93
|
+
.sub(/(?:md|txt)$/,'html')
|
91
94
|
|
92
95
|
|
93
96
|
xml_filename = html_filename.sub(/html$/,'xml')
|
94
97
|
|
95
|
-
FileX.mkdir_p File.dirname(File.join(File.dirname(destination),
|
96
|
-
|
98
|
+
FileX.mkdir_p File.dirname(File.join(File.dirname(destination),
|
99
|
+
html_filename))
|
100
|
+
FileX.cp destination, File.join(File.dirname(destination),
|
101
|
+
html_filename)
|
97
102
|
|
98
|
-
FileX.mkdir_p File.dirname( File.join(File.dirname(dest_xml),
|
103
|
+
FileX.mkdir_p File.dirname( File.join(File.dirname(dest_xml),
|
104
|
+
xml_filename))
|
99
105
|
FileX.cp dest_xml, File.join(File.dirname(dest_xml), xml_filename)
|
100
106
|
|
101
107
|
tags = doc.root.xpath('summary/tags/tag/text()')
|
@@ -103,7 +109,7 @@ class MyMediaPages < MyMedia::Base
|
|
103
109
|
tags.map {|x| "#%s" % x }.join(' ')]
|
104
110
|
|
105
111
|
|
106
|
-
@log.info "msg: %s tags: %s" % [raw_msg, tags.inspect]if @log
|
112
|
+
@log.info "msg: %s tags: %s" % [raw_msg, tags.inspect] if @log
|
107
113
|
|
108
114
|
|
109
115
|
else
|
@@ -117,7 +123,7 @@ class MyMediaPages < MyMedia::Base
|
|
117
123
|
FileX.cp src_path, destination
|
118
124
|
FileX.cp src_path, raw_destination
|
119
125
|
|
120
|
-
raw_msg =
|
126
|
+
raw_msg = FileX.read(destination)[/<title>([^<]+)<\/title>/,1]
|
121
127
|
end
|
122
128
|
|
123
129
|
if not File.basename(src_path)[/[a-z]\d{6}T\d{4}\.(?:html|md|txt)/] then
|
@@ -139,6 +145,7 @@ class MyMediaPages < MyMedia::Base
|
|
139
145
|
'before publish_dynarex'
|
140
146
|
end
|
141
147
|
|
148
|
+
target_url.sub!(/\.html$/,'') if @omit_html_ext
|
142
149
|
publish_dynarex(static_filepath, {title: raw_msg, url: target_url })
|
143
150
|
|
144
151
|
end
|
@@ -227,7 +234,8 @@ class MyMediaPages < MyMedia::Base
|
|
227
234
|
|
228
235
|
new_link = x.text.gsub(/\s/,'_')
|
229
236
|
|
230
|
-
x.attributes[:href] = "#{@dynamic_website}/do/#{@public_type}/new/"
|
237
|
+
x.attributes[:href] = "#{@dynamic_website}/do/#{@public_type}/new/" \
|
238
|
+
+ new_link
|
231
239
|
x.attributes[:class] = 'new'
|
232
240
|
x.attributes[:title] = x.text + ' (page does not exist)'
|
233
241
|
end
|
@@ -267,7 +275,11 @@ class MyMediaPages < MyMedia::Base
|
|
267
275
|
|
268
276
|
def xsltproc(xslpath, xmlpath)
|
269
277
|
|
270
|
-
|
278
|
+
if not FileX.exists? xslpath then
|
279
|
+
raise MyMediaPagesError, 'Missing file - ' + xslpath
|
280
|
+
end
|
281
|
+
|
282
|
+
Nokogiri::XSLT(FileX.read(xslpath))\
|
271
283
|
.transform(Nokogiri::XML(FileX.read(xmlpath))).to_xhtml(indent: 0)
|
272
284
|
end
|
273
285
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,48 +35,48 @@ cert_chain:
|
|
35
35
|
jSG8iFV4kJofCyHyfW6zyZy0d22o23Syxam2rIESaal2RPL7gADDTc8XBe/sFeWr
|
36
36
|
A7Ido2/5qg5YDVloSOHTfzZj
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-03-19 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: mymedia
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 0.4.0
|
47
44
|
- - "~>"
|
48
45
|
- !ruby/object:Gem::Version
|
49
|
-
version: '0.
|
46
|
+
version: '0.5'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.5.2
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: 0.4.0
|
57
54
|
- - "~>"
|
58
55
|
- !ruby/object:Gem::Version
|
59
|
-
version: '0.
|
56
|
+
version: '0.5'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.5.2
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: martile
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
|
-
- - ">="
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: 1.5.0
|
67
64
|
- - "~>"
|
68
65
|
- !ruby/object:Gem::Version
|
69
66
|
version: '1.5'
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.5.0
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: 1.5.0
|
77
74
|
- - "~>"
|
78
75
|
- !ruby/object:Gem::Version
|
79
76
|
version: '1.5'
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 1.5.0
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: kramdown
|
82
82
|
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: []
|
@@ -123,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
|
127
|
-
rubygems_version: 2.7.10
|
126
|
+
rubygems_version: 3.2.22
|
128
127
|
signing_key:
|
129
128
|
specification_version: 4
|
130
129
|
summary: A MyMedia gem to publish a basic web page
|
metadata.gz.sig
CHANGED
Binary file
|