mymedia 0.3.0 → 0.4.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mymedia.rb +17 -15
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: cab99c1f36e7249115b72436a3ec9981056b0ed984e22161fc4ef481531b7542
|
4
|
+
data.tar.gz: 58e4ec2b6e97bb96b0c8f002e8b805e82bff8af71d0e3c7414c9a2f50e1fd992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e6eec410b50bf3dedb1b33740b480597cac0ece76816d4f860dd99c9cc72f949376fdd39ca48a0263222a99e4694be0952facdf4d19023be6b523166dda7788
|
7
|
+
data.tar.gz: f9d3467d227659265e8237cfbae084134f05dec9a85b54f51b993a735ca8197a72e947630ba8bdeed493e0f4384904e4dd310c766da5aa621e3707090497e6c0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
# file: mymedia.rb
|
4
4
|
|
5
5
|
require 'time'
|
6
|
-
require 'fileutils'
|
7
6
|
require 'logger'
|
8
7
|
require 'dynarex'
|
9
8
|
require 'sps-pub'
|
@@ -20,6 +19,7 @@ module MyMedia
|
|
20
19
|
|
21
20
|
|
22
21
|
class Publisher
|
22
|
+
include RXFHelperModule
|
23
23
|
|
24
24
|
def initialize(opts={})
|
25
25
|
@index_page = true
|
@@ -33,7 +33,7 @@ module MyMedia
|
|
33
33
|
|
34
34
|
opt = {id: nil, rss: false}.merge(options)
|
35
35
|
|
36
|
-
dynarex = if
|
36
|
+
dynarex = if FileX.exists? dynarex_filepath then
|
37
37
|
Dynarex.new(dynarex_filepath)
|
38
38
|
else
|
39
39
|
Dynarex.new(@schema)
|
@@ -48,7 +48,7 @@ module MyMedia
|
|
48
48
|
|
49
49
|
dynarex.xslt_schema = dynarex.summary[:xslt_schema]
|
50
50
|
rss_filepath = dynarex_filepath.sub(/\.xml$/,'_rss.xml')
|
51
|
-
|
51
|
+
FileX.write rss_filepath, dynarex.to_rss
|
52
52
|
end
|
53
53
|
|
54
54
|
end
|
@@ -61,7 +61,7 @@ module MyMedia
|
|
61
61
|
return unless @index_page == true
|
62
62
|
raise MyMediaPublisherException, \
|
63
63
|
"template path: #{template_path} not found" unless \
|
64
|
-
|
64
|
+
FileX.exists?(template_path)
|
65
65
|
=begin jr 040916
|
66
66
|
dataisland = DataIsland.new(template_path, @opts)
|
67
67
|
|
@@ -71,7 +71,7 @@ module MyMedia
|
|
71
71
|
|
72
72
|
def publish_dxlite(dynarex_filepath='', record={title: '',url: ''})
|
73
73
|
|
74
|
-
dynarex = if
|
74
|
+
dynarex = if FileX.exists? dynarex_filepath then
|
75
75
|
DxLite.new(dynarex_filepath)
|
76
76
|
else
|
77
77
|
DxLite.new(@schema)
|
@@ -92,12 +92,13 @@ module MyMedia
|
|
92
92
|
end
|
93
93
|
|
94
94
|
module IndexReader
|
95
|
+
include RXFHelperModule
|
95
96
|
|
96
97
|
def browse()
|
97
98
|
|
98
99
|
json_filepath = "%s/%s/dynarex.json" % [@home, @public_type]
|
99
100
|
|
100
|
-
if
|
101
|
+
if FileX.exists? json_filepath then
|
101
102
|
|
102
103
|
dx = DxLite.new(json_filepath)
|
103
104
|
return dx.all
|
@@ -110,7 +111,7 @@ module MyMedia
|
|
110
111
|
|
111
112
|
json_filepath = "%s/%s/dynarex.json" % [@home, @public_type]
|
112
113
|
|
113
|
-
if
|
114
|
+
if FileX.exists? json_filepath then
|
114
115
|
|
115
116
|
dx = DxLite.new(json_filepath)
|
116
117
|
return dx.all.select {|x| x.title =~ /#{keyword}/i}
|
@@ -124,6 +125,7 @@ module MyMedia
|
|
124
125
|
end
|
125
126
|
|
126
127
|
class Base < Publisher
|
128
|
+
include RXFHelperModule
|
127
129
|
|
128
130
|
attr_reader :to_s
|
129
131
|
|
@@ -221,14 +223,14 @@ module MyMedia
|
|
221
223
|
|
222
224
|
raw_destination = "%s/%s/%s" % [@home, 'r', public_path]
|
223
225
|
|
224
|
-
if
|
226
|
+
if FileX.exists? raw_destination then
|
225
227
|
raw_destination = "%s/%s/%s" % [@home, 'r', public_path2]
|
226
228
|
public_path = public_path2
|
227
229
|
end
|
228
230
|
|
229
231
|
destination = File.join(@home, public_path)
|
230
|
-
|
231
|
-
|
232
|
+
FileX.mkdir_p File.dirname(raw_destination)
|
233
|
+
FileX.mkdir_p File.dirname(destination)
|
232
234
|
|
233
235
|
raw_msg = raw_msg.join ' ' if raw_msg.is_a? Array
|
234
236
|
|
@@ -239,8 +241,8 @@ module MyMedia
|
|
239
241
|
raw_msg, target_url = yield(destination, raw_destination)
|
240
242
|
static_url = target_url
|
241
243
|
else
|
242
|
-
|
243
|
-
|
244
|
+
FileX.cp src_path, destination
|
245
|
+
FileX.cp src_path, raw_destination
|
244
246
|
end
|
245
247
|
|
246
248
|
raw_msg = raw_msg.join if raw_msg.is_a? Array
|
@@ -261,7 +263,7 @@ module MyMedia
|
|
261
263
|
static_destination = "%s/%s" % [@home, static_path]
|
262
264
|
|
263
265
|
#FileUtils.mkdir_p File.dirname(static_destination)
|
264
|
-
|
266
|
+
FileX.cp destination, static_destination
|
265
267
|
|
266
268
|
#jr010817 FileUtils.cp raw_destination, raw_static_destination
|
267
269
|
|
@@ -270,8 +272,8 @@ module MyMedia
|
|
270
272
|
|
271
273
|
xmlfilepath = destination.sub('.html','.xml')
|
272
274
|
|
273
|
-
if
|
274
|
-
|
275
|
+
if FileX.exists?(xmlfilepath) then
|
276
|
+
FileX.cp xmlfilepath, static_destination.sub('.html','.xml')
|
275
277
|
end
|
276
278
|
|
277
279
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mymedia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
bL55NDdi8BFHkNVohRBak7aqxsw41LJKy3UTP+4TzU5vyluDJMiscK6JJFaM4JiS
|
36
36
|
xtlAM0O5ZFe9QflatP+P8JnB
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-02-
|
38
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: dynarex
|
metadata.gz.sig
CHANGED
Binary file
|