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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fc78e7e213ed935fdffc733862d520abb3b0c7d1dc3afde43905372e8bfd427
4
- data.tar.gz: fdae3bd4aeeb04d230dbe95b67700b68fe2ec92a09292124e912bc66285a1937
3
+ metadata.gz: cab99c1f36e7249115b72436a3ec9981056b0ed984e22161fc4ef481531b7542
4
+ data.tar.gz: 58e4ec2b6e97bb96b0c8f002e8b805e82bff8af71d0e3c7414c9a2f50e1fd992
5
5
  SHA512:
6
- metadata.gz: ee00e96ba62317e509b44024544885deae61cebbc973fd62417106bd56f6c025eba8aac5c6baa658ad965bff9be1d37501a8a8be2716e5d36f37b21d4cf88692
7
- data.tar.gz: 0a4ed8e0eb86dccf1e6603d9f6a0b7bc78acbb3e864706c2e61724d46d1a925e520e84d94dfb111f4193b46615af9cc5132868f93f2c9d79c0c47272e0edd44b
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 File.exists? dynarex_filepath then
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
- File.open(rss_filepath, 'w'){|f| f.write dynarex.to_rss }
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
- File.exists?(template_path)
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 File.exists? dynarex_filepath then
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 File.exists? json_filepath then
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 File.exists? json_filepath then
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 File.exists? raw_destination then
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
- FileUtils.mkdir_p File.dirname(raw_destination)
231
- FileUtils.mkdir_p File.dirname(destination)
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
- FileUtils.cp src_path, destination
243
- FileUtils.cp src_path, raw_destination
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
- FileUtils.cp destination, static_destination
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 File.exists?(xmlfilepath) then
274
- FileUtils.cp xmlfilepath, static_destination.sub('.html','.xml')
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.3.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-03 00:00:00.000000000 Z
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