mymedia-pages 0.2.0 → 0.2.1
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 +23 -7
- data.tar.gz.sig +0 -0
- metadata +15 -15
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1e3a784fcd53878b091d5997175e46b4ddd2ca9
|
4
|
+
data.tar.gz: beab5cf0dd0b0c13de30c2c523b066c88dae324b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 932e20f4695523a45bab0aef9f3101818013f6c3eaecd519e189694206a9ef768b3657e11130952326c1359bf6c7028a8e38347d21cdf1140a18502f3d65b238
|
7
|
+
data.tar.gz: b475be7bbd8068c4adbe802a037103aeeff87ab7a9f30b71da5fe24368505940513a979260d0a7798989a48951e84b2fbe18a9e376354fa25ffdf0f82791f5f7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-pages.rb
CHANGED
@@ -7,13 +7,17 @@ require 'mymedia'
|
|
7
7
|
require 'martile'
|
8
8
|
|
9
9
|
|
10
|
+
class MyMediaPagesError < Exception
|
11
|
+
end
|
12
|
+
|
10
13
|
class MyMediaPages < MyMedia::Base
|
11
14
|
|
12
15
|
def initialize(media_type: media_type='pages',
|
13
|
-
public_type: @public_type=media_type, ext: '.(html|md|txt)',
|
16
|
+
public_type: @public_type=media_type, ext: '.(html|md|txt)',
|
17
|
+
config: nil, log: log)
|
14
18
|
|
15
19
|
super(media_type: media_type, public_type: @public_type=media_type,
|
16
|
-
ext: '.(html|md|txt)', config: config)
|
20
|
+
ext: '.(html|md|txt)', config: config, log: log)
|
17
21
|
|
18
22
|
@media_src = "%s/media/%s" % [@home, media_type]
|
19
23
|
@target_ext = '.html'
|
@@ -47,13 +51,16 @@ class MyMediaPages < MyMedia::Base
|
|
47
51
|
s = @website + source
|
48
52
|
|
49
53
|
relative_path = s[/https?:\/\/[^\/]+([^$]+)/,1]
|
54
|
+
src_content = File.read src_path
|
55
|
+
doc = xml(src_content, relative_path, filename)
|
50
56
|
|
51
|
-
doc = xml(File.open(src_path, 'r').read, relative_path, filename)
|
52
57
|
return unless doc
|
53
58
|
|
54
59
|
modify_xml(doc, raw_dest_xml)
|
55
60
|
modify_xml(doc, dest_xml)
|
56
61
|
|
62
|
+
@log.info 'mymedia_pages/copy_publish: after modify_xml' if @log
|
63
|
+
|
57
64
|
File.write raw_destination, xsltproc("#{@home}/r/xsl/#{@public_type}.xsl", raw_dest_xml)
|
58
65
|
|
59
66
|
File.write destination, xsltproc("#{@home}/#{@www}/xsl/#{@public_type}.xsl", dest_xml)
|
@@ -151,18 +158,27 @@ class MyMediaPages < MyMedia::Base
|
|
151
158
|
|
152
159
|
def modify_xml(docx, filepath, xslpath='r/')
|
153
160
|
|
161
|
+
if @log then
|
162
|
+
@log.info 'mymedia_pages: inside modify_xml: docx.xml: ' + docx.xml.inspect
|
163
|
+
end
|
164
|
+
|
154
165
|
doc = Rexle.new docx.xml pretty: false
|
166
|
+
|
167
|
+
if @log then
|
168
|
+
@log.info 'doc.xml: ' + doc.xml.inspect if @log
|
169
|
+
end
|
170
|
+
|
155
171
|
raw_msg = microblog_title(doc)
|
156
172
|
|
157
173
|
doc.instructions.push %w(xml-stylesheet title='XSL_formatting' type='text/xsl') \
|
158
|
-
|
174
|
+
+ ["href='#{@website}/#{xslpath}xsl/#{@public_type}.xsl'"]
|
175
|
+
|
159
176
|
yield(doc) if block_given?
|
160
177
|
File.write filepath, doc.xml(declaration: true, pretty: false)
|
161
178
|
end
|
162
179
|
|
163
180
|
def xml(raw_buffer, filename, original_file)
|
164
181
|
|
165
|
-
|
166
182
|
begin
|
167
183
|
|
168
184
|
|
@@ -208,9 +224,9 @@ class MyMediaPages < MyMedia::Base
|
|
208
224
|
|
209
225
|
|
210
226
|
rescue
|
211
|
-
|
227
|
+
raise MyMediaPagesError, 'xml(): ' + ($!).inspect
|
212
228
|
end
|
213
|
-
|
229
|
+
|
214
230
|
return Rexle.new(a)
|
215
231
|
end
|
216
232
|
|
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
f5cM/DycnWUbyyxUfvCHRvwNubEB3M+NDfHtIlbbeK82WC+HbtOYLXWQsy7266iP
|
32
32
|
Nz7iR/JcIY24rA==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2018-02-18 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: mymedia
|
@@ -39,60 +39,60 @@ dependencies:
|
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '0.
|
42
|
+
version: '0.2'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
45
|
+
version: 0.2.14
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '0.
|
52
|
+
version: '0.2'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.
|
55
|
+
version: 0.2.14
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: martile
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '0.
|
62
|
+
version: '0.9'
|
63
63
|
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.
|
65
|
+
version: 0.9.0
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
70
|
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: '0.
|
72
|
+
version: '0.9'
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.9.0
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: kramdown
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
82
|
+
version: '1.16'
|
83
83
|
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.
|
85
|
+
version: 1.16.2
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
90
|
- - "~>"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: '1.
|
92
|
+
version: '1.16'
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 1.
|
95
|
+
version: 1.16.2
|
96
96
|
description:
|
97
97
|
email: james@jamesrobertson.eu
|
98
98
|
executables: []
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.6.
|
123
|
+
rubygems_version: 2.6.13
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: A MyMedia gem to publish a basic web page
|
metadata.gz.sig
CHANGED
Binary file
|