mymedia-pages 0.5.0 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4fda1001262e23054bd48053370ba0577692694e721cf0eccb8b81ca0f118ac
4
- data.tar.gz: e53e008532a3885c05856a59857690b068643b60ea2dece53fc87aa4321cf850
3
+ metadata.gz: 3f1212494cddb465a2992c38cf493903ca6228e9e0852d358953207de7cc2c27
4
+ data.tar.gz: b19b7b29329da34d44863aa1025d6206c4ecc684beb264b2085101ccdeb828e6
5
5
  SHA512:
6
- metadata.gz: c03f7c0dacd88b16b08b2b7ae235529c13f3f1a22de2fec257e68bf9262a7fa14610c968861bb760d9edb8f233cac9a2e25986adfc9a114ae2ea39df42e7c872
7
- data.tar.gz: a0b539bdfd82ac378893397d3f4c5abb1106c6449c131d28a0c097f6998b6b35c6f53b6d43c37b5a3a0272e14d4fb4f8a6d4c4a6fcaea1b2ab3bf9b65bdef8f6
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 RXFHelperModule
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, xsltproc("#{@home}/r/xsl/#{@public_type}.xsl", raw_dest_xml)
86
+ FileX.write raw_destination,
87
+ xsltproc("#{@home}/r/xsl/#{@public_type}.xsl", raw_dest_xml)
87
88
 
88
- FileX.write destination, xsltproc("#{@home}/#{@www}/xsl/#{@public_type}.xsl", dest_xml)
89
+ FileX.write destination,
90
+ xsltproc("#{@home}/#{@www}/xsl/#{@public_type}.xsl", dest_xml)
89
91
 
90
- html_filename = basename(@media_src, src_path).sub(/(?:md|txt)$/,'html')
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), html_filename))
96
- FileX.cp destination, File.join(File.dirname(destination), html_filename)
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), xml_filename))
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 = File.read(destination)[/<title>([^<]+)<\/title>/,1]
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/" + new_link
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
- Nokogiri::XSLT(File.open(xslpath))\
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.0
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-02-04 00:00:00.000000000 Z
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.4'
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.4'
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.1
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.1
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
- rubyforge_project:
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