mymedia-wiki 0.1.0
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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data/lib/mymedia-wiki.rb +85 -0
- data.tar.gz.sig +0 -0
- metadata +71 -0
- metadata.gz.sig +1 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 794379aa4989d89317d9c2ced3ac9df9bf5408b4766e57367b28649156bdc03d
|
4
|
+
data.tar.gz: f08be31d41324899864aa50da8ead0ce0e8848968e7502e3c126a178c9ff3703
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c8dc94635d239cf65a377a9fc28f98b9e660463132bf92d6e94e9512718c235235be2cc962ff2e3a3a1efc2b55376064bcf3cc2ea1c6b410007c3e73f4a6d4d4
|
7
|
+
data.tar.gz: 86baa867c7b055d7e388fe95dfe1211d34f392dc00b1e4cbe9bd23f26558239dc02ee84f523e827e616ca3db8b52df6d274a32a9c8185783c7da49618bf82226
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/lib/mymedia-wiki.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: mymedia-wiki.rb
|
4
|
+
|
5
|
+
require 'mymedia-pages'
|
6
|
+
|
7
|
+
|
8
|
+
class MyMediaWikiError < Exception
|
9
|
+
end
|
10
|
+
|
11
|
+
class MyMediaWiki < MyMediaPages
|
12
|
+
|
13
|
+
def initialize(media_type: media_type='wiki',
|
14
|
+
public_type: @public_type=media_type, ext: '.(html|md|txt)',
|
15
|
+
config: nil, log: nil, debug: false)
|
16
|
+
|
17
|
+
super(media_type: media_type, public_type: @public_type=media_type,
|
18
|
+
ext: '.(html|md|txt)', config: config, log: log, debug: debug)
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
def copy_publish(filename, raw_msg='')
|
23
|
+
|
24
|
+
@log.info 'MyMediaWiki inside copy_publish' if @log
|
25
|
+
@filename = filename
|
26
|
+
src_path = File.join(@media_src, filename)
|
27
|
+
|
28
|
+
html_filename = basename(@media_src, src_path).sub(/(?:md|txt)$/,'html')
|
29
|
+
|
30
|
+
FileUtils.mkdir_p File.dirname(@home + "/#{@public_type}/" + html_filename)
|
31
|
+
#FileUtils.write html, @home + "/#{@public_type}/" + html_filename
|
32
|
+
public_path = "#{@public_type}/" + html_filename
|
33
|
+
|
34
|
+
ext = File.extname(src_path)
|
35
|
+
|
36
|
+
raw_destination = "%s/r/%s" % [@home, public_path]
|
37
|
+
FileUtils.mkdir_p File.dirname(raw_destination)
|
38
|
+
raw_dest_xml = raw_destination.sub(/html$/,'xml')
|
39
|
+
|
40
|
+
destination = File.join(@home, public_path)
|
41
|
+
|
42
|
+
puts 'raw_destination: ' + raw_destination.inspect if @debug
|
43
|
+
|
44
|
+
x_destination = raw_destination.sub(/\.html$/,ext)
|
45
|
+
|
46
|
+
if @debug then
|
47
|
+
puts 'x_destination: ' + x_destination.inspect
|
48
|
+
puts '@public_type: ' + @public_type.inspect
|
49
|
+
end
|
50
|
+
|
51
|
+
FileUtils.cp src_path, x_destination
|
52
|
+
|
53
|
+
source = x_destination[/\/r\/#{@public_type}.*/]
|
54
|
+
|
55
|
+
puts 'source: ' + source.inspect if @debug
|
56
|
+
s = @website + source
|
57
|
+
relative_path = s[/https?:\/\/[^\/]+([^$]+)/,1]
|
58
|
+
|
59
|
+
src_content = File.read src_path
|
60
|
+
doc = xml(src_content, relative_path, filename)
|
61
|
+
|
62
|
+
return unless doc
|
63
|
+
|
64
|
+
modify_xml(doc, raw_dest_xml)
|
65
|
+
|
66
|
+
@log.info 'mymedia-wiki/copy_publish: after modify_xml' if @log
|
67
|
+
|
68
|
+
File.write destination, xsltproc("#{@home}/r/xsl/#{@public_type}.xsl",
|
69
|
+
raw_dest_xml)
|
70
|
+
|
71
|
+
target_url = [@website, @public_type, html_filename].join('/')
|
72
|
+
|
73
|
+
msg = "%s %s" % [target_url, raw_msg ]
|
74
|
+
sps_message = ['publish', @public_type,
|
75
|
+
target_url, raw_msg]
|
76
|
+
|
77
|
+
send_message(msg: sps_message.join(' '))
|
78
|
+
|
79
|
+
[raw_msg, target_url]
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
|
84
|
+
end
|
85
|
+
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mymedia-wiki
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Robertson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjExMjEzMjMxMDM2WhcN
|
15
|
+
MjIxMjEzMjMxMDM2WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDT82Vo
|
17
|
+
L6l861D20XG2c1bfspbhYSS3d3mmBPzUDGYWj+Kdq/Uznot8yDnLn7v/r6Y55AHy
|
18
|
+
QO4ArkCnPZc0q5wQnj8AQo7DBucDnfgubJQylGQngWvIoobrbYROCOlQ3/JrtoMu
|
19
|
+
akE8aG9YPneZvoMapEf/Ff7ExJWuD6vj8t1vJRSEBhaW7NDTavmeuPaCPt00aoh0
|
20
|
+
A59T/st4yPcILmuNziS0FCn6o7ejJ8xlrp0KpT0yF+esQ8gmH6UbsOT6J9amej3J
|
21
|
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1v2VnVoWoodKFBNGzwA+Lgs+aV
|
36
|
+
5FkMbZJFlcCYg1dUZxGwV5OV
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
date: 2021-12-13 00:00:00.000000000 Z
|
39
|
+
dependencies: []
|
40
|
+
description:
|
41
|
+
email: digital.robertson@gmail.com
|
42
|
+
executables: []
|
43
|
+
extensions: []
|
44
|
+
extra_rdoc_files: []
|
45
|
+
files:
|
46
|
+
- lib/mymedia-wiki.rb
|
47
|
+
homepage: https://github.com/jrobertson/mymedia-wiki
|
48
|
+
licenses:
|
49
|
+
- MIT
|
50
|
+
metadata: {}
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubyforge_project:
|
67
|
+
rubygems_version: 2.7.10
|
68
|
+
signing_key:
|
69
|
+
specification_version: 4
|
70
|
+
summary: Transforms a kind of Markdown document using Kramdown and XSLT.
|
71
|
+
test_files: []
|
metadata.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/��6(I�sR�Q"�bQ�P2T)P��m&cc�U�<��x���/�ZmJ�z��h�Q���������=��.r��_�W�|K�������|���]0|�$j�QJB�a/�X�~��M����|o��$(yV2���c��Rq/��C/��°OL3��M1\�>�)�6QX�vP��p��tSZ-���{����HՆ I�h� ɨM�M��)�x#c>vE̿�A��(���0�²�N�ŀIu3�D��JFc���a%8}�2�w鑊P�d��R��#֒T�p�t
|