mymedia 0.5.0 → 0.5.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.rb +44 -10
- data.tar.gz.sig +0 -0
- metadata +11 -52
- 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: 788b610f7561b603c218b18e55045766e787fef8f6065471fc5faccfa2e3f6d0
|
4
|
+
data.tar.gz: 3f16cb556b14e811bee09bb267dc2d7b4007bad0d358d1aa4b6755c198d14e22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54085653a1f9707f565070f00faa8eb31a81aa3452b124f3c6dd8f7c95879880348206ac5c372b65713c473846139d588f7f3751091e5e316bba5704c2283d31
|
7
|
+
data.tar.gz: 68922f33adc6cb6d1008d22bc76243a8a48a90f91644cf4a32121d8fb9ac6f3d80a0fca7ae5503ccdc7d445cd5aaa530a0d28ab76b5906f9dae29d2703718b04
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mymedia.rb
CHANGED
@@ -10,6 +10,7 @@ require 'dir-to-xml'
|
|
10
10
|
require 'dataisland'
|
11
11
|
require 'increment'
|
12
12
|
require 'simple-config'
|
13
|
+
require 'rxfileio'
|
13
14
|
|
14
15
|
|
15
16
|
module MyMedia
|
@@ -19,7 +20,7 @@ module MyMedia
|
|
19
20
|
|
20
21
|
|
21
22
|
class Publisher
|
22
|
-
include
|
23
|
+
include RXFReadWriteModule
|
23
24
|
|
24
25
|
def initialize(opts={})
|
25
26
|
@index_page = true
|
@@ -92,7 +93,7 @@ module MyMedia
|
|
92
93
|
end
|
93
94
|
|
94
95
|
module IndexReader
|
95
|
-
include
|
96
|
+
include RXFRead
|
96
97
|
|
97
98
|
def browse()
|
98
99
|
|
@@ -125,7 +126,7 @@ module MyMedia
|
|
125
126
|
end
|
126
127
|
|
127
128
|
class Base < Publisher
|
128
|
-
include
|
129
|
+
include RXFileIOModule
|
129
130
|
|
130
131
|
attr_reader :to_s
|
131
132
|
|
@@ -141,6 +142,7 @@ module MyMedia
|
|
141
142
|
c = SimpleConfig.new(config).to_h
|
142
143
|
|
143
144
|
@home = c[:home]
|
145
|
+
puts '@home: ' + @home.inspect if @debug
|
144
146
|
@media_src = "%s/media/%s" % [@home, media_type]
|
145
147
|
@website = c[:website]
|
146
148
|
|
@@ -184,27 +186,29 @@ module MyMedia
|
|
184
186
|
puts '@media_src: ' + @media_src.inspect if @debug
|
185
187
|
|
186
188
|
# fetch the most recent file
|
187
|
-
|
189
|
+
filename = FileX.ru_r @media_src
|
188
190
|
|
189
|
-
if
|
191
|
+
if filename then
|
190
192
|
|
191
|
-
puts '
|
193
|
+
puts 'filename: ' + filename.inspect if @debug
|
192
194
|
|
193
|
-
filename = r.sub(/^#{@media_src}/,'')
|
194
195
|
copy_publish( filename ,raw_msg, &blk)
|
195
196
|
|
196
197
|
end
|
197
198
|
|
198
199
|
end
|
199
200
|
|
200
|
-
def basename(
|
201
|
+
def basename(raw_s1, raw_s2)
|
202
|
+
|
203
|
+
s1 = raw_s1.sub(/dfs:\/\/[^\/]+/,'')
|
204
|
+
s2 = raw_s2.sub(/dfs:\/\/[^\/]+/,'')
|
201
205
|
|
202
206
|
(s2.split('/') - s1.split('/')).join('/')
|
203
207
|
|
204
208
|
end
|
205
209
|
|
206
210
|
def copy_publish(filename, raw_msg='', &blk)
|
207
|
-
file_publish(
|
211
|
+
file_publish(filename, raw_msg)
|
208
212
|
end
|
209
213
|
|
210
214
|
|
@@ -222,7 +226,7 @@ module MyMedia
|
|
222
226
|
|
223
227
|
public_path2 = "%s/%s/%shrs%s%s" % [@public_type, \
|
224
228
|
Time.now.strftime('%Y/%b/%d').downcase, Time.now.strftime('%H%M'),
|
225
|
-
|
229
|
+
Time.now.strftime('%S%2N'), @target_ext]
|
226
230
|
|
227
231
|
raw_destination = "%s/%s/%s" % [@home, 'r', public_path]
|
228
232
|
|
@@ -235,6 +239,11 @@ module MyMedia
|
|
235
239
|
FileX.mkdir_p File.dirname(raw_destination)
|
236
240
|
FileX.mkdir_p File.dirname(destination)
|
237
241
|
|
242
|
+
if @debug then
|
243
|
+
puts "file_publish() #50 mkdir_p %s" % [File.dirname(raw_destination)]
|
244
|
+
puts "file_publish() #70 mkdir_p %s" % [File.dirname(destination)]
|
245
|
+
end
|
246
|
+
|
238
247
|
raw_msg = raw_msg.join ' ' if raw_msg.is_a? Array
|
239
248
|
|
240
249
|
raw_msg = src_path[/([^\/]+)\.\w+$/,1] + ' ' + raw_msg if raw_msg[/^#/]
|
@@ -244,8 +253,21 @@ module MyMedia
|
|
244
253
|
raw_msg, target_url = yield(destination, raw_destination)
|
245
254
|
static_url = target_url
|
246
255
|
else
|
256
|
+
|
257
|
+
if @debug then
|
258
|
+
puts "file_publish() #80 cp %s to %s" % [src_path, destination]
|
259
|
+
puts "file_publish() #90 cp %s to %s" % [src_path, destination]
|
260
|
+
end
|
261
|
+
|
247
262
|
FileX.cp src_path, destination
|
248
263
|
FileX.cp src_path, raw_destination
|
264
|
+
|
265
|
+
if @debug then
|
266
|
+
puts "file_publish() #100 copied %s to %s" % [src_path, destination]
|
267
|
+
puts "file_publish() #200 copied %s to %s" % \
|
268
|
+
[src_path, raw_destination]
|
269
|
+
end
|
270
|
+
|
249
271
|
end
|
250
272
|
|
251
273
|
raw_msg = raw_msg.join if raw_msg.is_a? Array
|
@@ -266,6 +288,12 @@ module MyMedia
|
|
266
288
|
static_destination = "%s/%s" % [@home, static_path]
|
267
289
|
|
268
290
|
#FileUtils.mkdir_p File.dirname(static_destination)
|
291
|
+
|
292
|
+
if @debug then
|
293
|
+
puts "file_publish() #300 copy %s to %s" % [destination,
|
294
|
+
static_destination]
|
295
|
+
end
|
296
|
+
|
269
297
|
FileX.cp destination, static_destination
|
270
298
|
|
271
299
|
#jr010817 FileUtils.cp raw_destination, raw_static_destination
|
@@ -276,7 +304,13 @@ module MyMedia
|
|
276
304
|
xmlfilepath = destination.sub('.html','.xml')
|
277
305
|
|
278
306
|
if FileX.exists?(xmlfilepath) then
|
307
|
+
|
279
308
|
FileX.cp xmlfilepath, static_destination.sub('.html','.xml')
|
309
|
+
|
310
|
+
if @debug then
|
311
|
+
puts "file_publish() #400 copied %s to %s" % [xmlfilepath, static_destination.sub('.html','.xml')]
|
312
|
+
end
|
313
|
+
|
280
314
|
end
|
281
315
|
|
282
316
|
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.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,88 +35,48 @@ cert_chain:
|
|
35
35
|
bL55NDdi8BFHkNVohRBak7aqxsw41LJKy3UTP+4TzU5vyluDJMiscK6JJFaM4JiS
|
36
36
|
xtlAM0O5ZFe9QflatP+P8JnB
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-03-06 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
|
-
name:
|
42
|
-
requirement: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - "~>"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '1.9'
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 1.9.2
|
50
|
-
type: :runtime
|
51
|
-
prerelease: false
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - "~>"
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '1.9'
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: 1.9.2
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: sps-pub
|
41
|
+
name: dir-to-xml
|
62
42
|
requirement: !ruby/object:Gem::Requirement
|
63
43
|
requirements:
|
64
44
|
- - "~>"
|
65
45
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
46
|
+
version: '1.2'
|
67
47
|
- - ">="
|
68
48
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
49
|
+
version: 1.2.2
|
70
50
|
type: :runtime
|
71
51
|
prerelease: false
|
72
52
|
version_requirements: !ruby/object:Gem::Requirement
|
73
53
|
requirements:
|
74
54
|
- - "~>"
|
75
55
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
56
|
+
version: '1.2'
|
77
57
|
- - ">="
|
78
58
|
- !ruby/object:Gem::Version
|
79
|
-
version:
|
59
|
+
version: 1.2.2
|
80
60
|
- !ruby/object:Gem::Dependency
|
81
|
-
name:
|
61
|
+
name: dataisland
|
82
62
|
requirement: !ruby/object:Gem::Requirement
|
83
63
|
requirements:
|
84
64
|
- - "~>"
|
85
65
|
- !ruby/object:Gem::Version
|
86
|
-
version: '
|
66
|
+
version: '0.3'
|
87
67
|
- - ">="
|
88
68
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
69
|
+
version: 0.3.0
|
90
70
|
type: :runtime
|
91
71
|
prerelease: false
|
92
72
|
version_requirements: !ruby/object:Gem::Requirement
|
93
73
|
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.0'
|
97
|
-
- - ">="
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: 1.0.8
|
100
|
-
- !ruby/object:Gem::Dependency
|
101
|
-
name: dataisland
|
102
|
-
requirement: !ruby/object:Gem::Requirement
|
103
|
-
requirements:
|
104
|
-
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: 0.3.0
|
107
74
|
- - "~>"
|
108
75
|
- !ruby/object:Gem::Version
|
109
76
|
version: '0.3'
|
110
|
-
type: :runtime
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
77
|
- - ">="
|
115
78
|
- !ruby/object:Gem::Version
|
116
79
|
version: 0.3.0
|
117
|
-
- - "~>"
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: '0.3'
|
120
80
|
- !ruby/object:Gem::Dependency
|
121
81
|
name: increment
|
122
82
|
requirement: !ruby/object:Gem::Requirement
|
@@ -183,8 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
143
|
- !ruby/object:Gem::Version
|
184
144
|
version: '0'
|
185
145
|
requirements: []
|
186
|
-
|
187
|
-
rubygems_version: 2.7.10
|
146
|
+
rubygems_version: 3.2.22
|
188
147
|
signing_key:
|
189
148
|
specification_version: 4
|
190
149
|
summary: Makes publishing to the web easier
|
metadata.gz.sig
CHANGED
Binary file
|