mymedia-wiki 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1337add2c5360146f9dbd8cb01138dfae353d0e7c43fd6d7753e2c2e33de1238
4
- data.tar.gz: cd8e59cf8212a7f0dbf35e17b1d591c3da667b5190622c9b114698816acda05b
3
+ metadata.gz: ef1a5c2759cb242c19449da88f9922868d5025ab6da5e64cf98abda4da177991
4
+ data.tar.gz: 5aa70051c724a1816185b47b475652bc87e151e62837d385eea2cc2a96cae248
5
5
  SHA512:
6
- metadata.gz: c6aa290f5f8b2e1675dfeec187e4de5f78120c354151226b4f503bd2639b32712c314f0384a4c99de47c28418d42d899cc5294a7f427ca15b570824d56860789
7
- data.tar.gz: 49fbdd7d7917a9d690362abd31884226f60239b7871ed426aab076b3938b0eb1a1312cde6167d5211d5266011c1c19209794cdc5d87993e4f0011b1a53a2fa10
6
+ metadata.gz: a5735d96e05337ef09bb637b645e3392954cd25b45141baeafe26bba1a67951e88a2ebb9389d614c1d2469f0b2f63d198cc63eb8118503ea4dace0520c79c43a
7
+ data.tar.gz: 675619b9d5166ad4f774b80253da12f09d370bd1c63347dd86683c6e6b3f32c9763875e07b405e6102f5aab49a9454da79b68ecd9d71385fad6662e40b8f820d
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/mymedia-wiki.rb CHANGED
@@ -13,12 +13,12 @@ class MyMediaWiki < MyMediaPages
13
13
  def initialize(media_type: media_type='wiki',
14
14
  public_type: @public_type=media_type, ext: '.(html|md|txt)',
15
15
  config: nil, log: nil, debug: false)
16
-
16
+
17
17
  super(media_type: media_type, public_type: @public_type=media_type,
18
18
  ext: '.(html|md|txt)', config: config, log: log, debug: debug)
19
-
20
- end
21
-
19
+
20
+ end
21
+
22
22
  def copy_publish(filename, raw_msg='')
23
23
 
24
24
  @log.info 'MyMediaWiki inside copy_publish' if @log
@@ -63,6 +63,10 @@ class MyMediaWiki < MyMediaPages
63
63
 
64
64
  modify_xml(doc, raw_dest_xml)
65
65
 
66
+ tags = doc.root.xpath('summary/tags/tag/text()')
67
+ raw_msg = "%s %s" % [doc.root.text('summary/title'),
68
+ tags.map {|x| "#%s" % x }.join(' ')]
69
+
66
70
  @log.info 'mymedia-wiki/copy_publish: after modify_xml' if @log
67
71
 
68
72
  File.write destination, xsltproc("#{@home}/r/xsl/#{@public_type}.xsl",
@@ -70,16 +74,35 @@ class MyMediaWiki < MyMediaPages
70
74
 
71
75
  target_url = [@website, @public_type, html_filename].join('/')
72
76
 
77
+ json_filepath = "%s/%s/dynarex.json" % [@home, @public_type]
78
+ publish_dxlite(json_filepath, {title: raw_msg, url: target_url})
79
+ =begin
73
80
  msg = "%s %s" % [target_url, raw_msg ]
74
81
  sps_message = ['publish', @public_type,
75
82
  target_url, raw_msg]
76
83
 
77
84
  send_message(msg: sps_message.join(' '))
78
-
85
+ =end
79
86
  [raw_msg, target_url]
80
87
 
81
88
  end
82
-
83
89
 
84
- end
90
+ def writecopy_publish(raws)
91
+
92
+ s = raws.strip.gsub(/\r/,'')
85
93
 
94
+ title = escape(s.lines[0].chomp)
95
+ filename = title + '.txt'
96
+ File.write File.join(@media_src, filename), s
97
+
98
+ copy_publish filename
99
+ end
100
+
101
+ private
102
+
103
+ def escape(s)
104
+ s.gsub(/ +/,'_')#.gsub(/'/,'%27')
105
+ end
106
+
107
+
108
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mymedia-wiki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  y9Yuu5WqjuJZ3NtesI/X2BMzO5Pq/vyXzvVcAv1v2VnVoWoodKFBNGzwA+Lgs+aV
36
36
  5FkMbZJFlcCYg1dUZxGwV5OV
37
37
  -----END CERTIFICATE-----
38
- date: 2021-12-13 00:00:00.000000000 Z
38
+ date: 2022-02-03 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: mymedia-pages
@@ -43,20 +43,20 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.3.0
46
+ version: 0.4.0
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '0.3'
49
+ version: '0.4'
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 0.3.0
56
+ version: 0.4.0
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '0.3'
59
+ version: '0.4'
60
60
  description:
61
61
  email: digital.robertson@gmail.com
62
62
  executables: []
metadata.gz.sig CHANGED
Binary file