mymedia-pages 0.5.6 → 0.6.1
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 +86 -9
- data.tar.gz.sig +0 -0
- metadata +8 -8
- 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: 48401d1220e021c1bd73088e7c243f2682ee6cd65bafe6b85a7a490c9e5f2ec0
|
4
|
+
data.tar.gz: b8feba33c46aa29a0e3f392c078b2db66662ca022d1e0f994a895954e4dc021c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d43bac76e27f5a5d2712969401f6953cff9edd266609dcfc4a1b83c3c846d85eeef35c5cd2303035a6cb6d443e9700a9332ec2aff8894ce632b5c8fa464b84a
|
7
|
+
data.tar.gz: 4925d47943d7e311c28cc088ecd593fbdf258fab06af5c52ba0b207bd25d443ac2cdf15a0f6661d41a3712c725da1d48b1ad02d42fe0227df8a5bd335618cf03
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia-pages.rb
CHANGED
@@ -49,14 +49,13 @@ class MyMediaPages < MyMedia::Base
|
|
49
49
|
include MyMedia::IndexReader
|
50
50
|
include PageReader
|
51
51
|
|
52
|
-
def initialize(media_type:
|
53
|
-
|
54
|
-
config: nil, log: nil, debug: false)
|
52
|
+
def initialize(media_type: 'pages', public_type: @public_type=media_type,
|
53
|
+
ext: '.(html|md|txt)', config: nil, log: nil, debug: false)
|
55
54
|
|
56
55
|
raise MyMediaPagesError, 'Missing config' unless config
|
57
56
|
|
58
57
|
super(media_type: media_type, public_type: @public_type=media_type,
|
59
|
-
ext: '.(html|md|txt)', config: config, log: log)
|
58
|
+
ext: '.(html|md|txt)', config: config, log: log, debug: debug)
|
60
59
|
|
61
60
|
@target_ext = '.html'
|
62
61
|
@static_html = true
|
@@ -66,7 +65,7 @@ class MyMediaPages < MyMedia::Base
|
|
66
65
|
|
67
66
|
def copy_publish(filename, raw_msg='')
|
68
67
|
|
69
|
-
|
68
|
+
puts 'MyMediaPagesinside copy_publish' if @debug
|
70
69
|
@filename = filename
|
71
70
|
#jr2022-10-09 src_path = File.join(@media_src, filename)
|
72
71
|
src_path = filename
|
@@ -100,7 +99,7 @@ class MyMediaPages < MyMedia::Base
|
|
100
99
|
modify_xml(doc, raw_dest_xml)
|
101
100
|
modify_xml(doc, dest_xml)
|
102
101
|
|
103
|
-
|
102
|
+
puts 'mymedia_pages/copy_publish: after modify_xml' if @debug
|
104
103
|
|
105
104
|
FileX.write raw_destination,
|
106
105
|
xsltproc(File.join(@home, @www, 'r', 'xsl', @public_type + '.xsl'),
|
@@ -128,7 +127,7 @@ class MyMediaPages < MyMedia::Base
|
|
128
127
|
tags.map {|x| "#%s" % x }.join(' ')]
|
129
128
|
|
130
129
|
|
131
|
-
|
130
|
+
puts "msg: %s tags: %s" % [raw_msg, tags.inspect] if @debug
|
132
131
|
|
133
132
|
|
134
133
|
else
|
@@ -263,9 +262,10 @@ class MyMediaPages < MyMedia::Base
|
|
263
262
|
|
264
263
|
begin
|
265
264
|
|
266
|
-
puts 'before htmlize'
|
265
|
+
puts 'before htmlize' if @debug
|
267
266
|
raw_title, raw_tags, html = htmlize(raw_buffer)
|
268
|
-
puts 'after htmlize'
|
267
|
+
puts 'after htmlize' if @debug
|
268
|
+
puts 'raw: ' + [raw_title, raw_tags, html].inspect if @debug
|
269
269
|
|
270
270
|
doc = Rexle.new("<body>%s</body>" % html)
|
271
271
|
|
@@ -324,3 +324,80 @@ class MyMediaPages < MyMedia::Base
|
|
324
324
|
.transform(Nokogiri::XML(FileX.read(xmlpath))).to_xhtml(indent: 0)
|
325
325
|
end
|
326
326
|
end
|
327
|
+
|
328
|
+
module PagesTestSetup
|
329
|
+
include RXFileIOModule
|
330
|
+
|
331
|
+
def set_paths(cur_dir, www_dir, media_dir)
|
332
|
+
|
333
|
+
@cur_dir = cur_dir
|
334
|
+
@dir, @www_dir, @media_dir = @public_type, www_dir, media_dir
|
335
|
+
|
336
|
+
end
|
337
|
+
|
338
|
+
def cleanup()
|
339
|
+
|
340
|
+
# remove the previous test files
|
341
|
+
#
|
342
|
+
FileX.rm_r @www_dir + '/*', force: true
|
343
|
+
puts "Previous #{@www_dir} files now removed!"
|
344
|
+
|
345
|
+
FileX.rm_r @media_dir + '/*', force: true
|
346
|
+
puts "Previous #{@media_dir} files now removed!"
|
347
|
+
|
348
|
+
end
|
349
|
+
|
350
|
+
def prep()
|
351
|
+
|
352
|
+
# create the template files and directories
|
353
|
+
#
|
354
|
+
xsl_file = @public_type + '.xsl'
|
355
|
+
xsl_src = File.join(@cur_dir, @public_type + '.xsl')
|
356
|
+
|
357
|
+
www_dest = File.join(@www_dir, 'xsl', xsl_file)
|
358
|
+
r_dest = File.join(@www_dir, 'r', 'xsl', xsl_file)
|
359
|
+
index_dest = File.join(@www_dir, @public_type, 'index-template.html')
|
360
|
+
|
361
|
+
FileX.mkdir_p File.dirname(www_dest)
|
362
|
+
FileX.cp xsl_src, www_dest
|
363
|
+
|
364
|
+
FileX.mkdir_p File.dirname(r_dest)
|
365
|
+
FileX.cp xsl_src, r_dest
|
366
|
+
|
367
|
+
FileX.mkdir_p File.dirname(index_dest)
|
368
|
+
FileX.cp File.join(@cur_dir, 'index-template.html'), index_dest
|
369
|
+
|
370
|
+
FileUtils.mkdir_p File.join(@media_dir, @dir)
|
371
|
+
|
372
|
+
end
|
373
|
+
|
374
|
+
# create the input file
|
375
|
+
#
|
376
|
+
def write(filename: '', content: '')
|
377
|
+
|
378
|
+
File.write File.join(@media_dir, @dir, filename), content
|
379
|
+
puts 'debug: filename: ' + filename.inspect
|
380
|
+
|
381
|
+
end
|
382
|
+
|
383
|
+
end
|
384
|
+
|
385
|
+
|
386
|
+
class PagesTester23 < MyMediaPages
|
387
|
+
|
388
|
+
include PagesTestSetup
|
389
|
+
|
390
|
+
# it is assumed this class will be executed from a test directory
|
391
|
+
# containing the following auxillary files:
|
392
|
+
# - pages.xsl
|
393
|
+
# - index-template.html
|
394
|
+
|
395
|
+
def initialize(config: '', cur_dir: '', www_dir: '/tmp/www',
|
396
|
+
media_dir: '/tmp/media', debug: false)
|
397
|
+
|
398
|
+
super(config: config, debug: debug)
|
399
|
+
set_paths(cur_dir, www_dir, media_dir)
|
400
|
+
|
401
|
+
end
|
402
|
+
|
403
|
+
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.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
ngT+/RQQOTNmhN3XBRq8VfcVGUw+w5jm4emNDe1pzTATNmzyadOHF0Rokv0B2T4u
|
37
37
|
txMWqrBuLISsGTO4DRqpDmR09caoN5dRM6k=
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2023-02-
|
39
|
+
date: 2023-02-26 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mymedia
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
version: '0.5'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.5.
|
50
|
+
version: 0.5.6
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,27 +57,27 @@ dependencies:
|
|
57
57
|
version: '0.5'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.5.
|
60
|
+
version: 0.5.6
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: martile
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '1.
|
67
|
+
version: '1.7'
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 1.
|
70
|
+
version: 1.7.0
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '1.
|
77
|
+
version: '1.7'
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 1.
|
80
|
+
version: 1.7.0
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: kramdown
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|