rxfhelper 1.2.0 → 1.2.4
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/rxfhelper.rb +52 -16
- 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: 0b78603e8153b7dea1846f2eb4d0ea043f57b57482884427b6aace2084bbaf3e
|
4
|
+
data.tar.gz: 587c9eaacf707615a39dbad35b2710e90a1ca4210e9b9ec0fa10ccaddb32f23c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dda34bd5be25db3997aad0e216c16f96de4634079d595b58a0856b64d731040e51aae82eaa159b43f27980170dcb99244ca3a90e487141e1963858a54f458d7
|
7
|
+
data.tar.gz: 40e54dc7853bd4bbe6745ede8dd815aa8eb5f2f41be39f265d4e47ee1a9cdf55664abf8ea30deb86325487b2f2c1b408842f873053f7ffdc025fc02e4b8c99f3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rxfhelper.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
require 'rsc'
|
6
6
|
#require 'gpd-request'
|
7
|
+
require 'rest-client'
|
7
8
|
require 'mymedia_ftp'
|
8
9
|
require 'drb_fileclient'
|
9
10
|
require 'drb_reg_client'
|
@@ -11,7 +12,7 @@ require 'remote_dwsregistry'
|
|
11
12
|
|
12
13
|
|
13
14
|
|
14
|
-
# Setup: Add a local DNS entry called *reg.lookup* if you are planning on
|
15
|
+
# Setup: Add a local DNS entry called *reg.lookup* if you are planning on
|
15
16
|
# using the Registry feaure to look up objects automatically.
|
16
17
|
|
17
18
|
module RXFHelperModule
|
@@ -109,6 +110,11 @@ module RXFHelperModule
|
|
109
110
|
def self.pwd() RXFHelper.pwd() end
|
110
111
|
def self.read(x) RXFHelper.read(x).first end
|
111
112
|
def self.rm(s) RXFHelper.rm(s) end
|
113
|
+
|
114
|
+
def self.touch(s, mtime: Time.now)
|
115
|
+
RXFHelper.touch(s, mtime: mtime)
|
116
|
+
end
|
117
|
+
|
112
118
|
def self.write(x, s) RXFHelper.write(x, s) end
|
113
119
|
def self.zip(s, a) RXFHelper.zip(s, a) end
|
114
120
|
|
@@ -153,7 +159,7 @@ class RXFHelper
|
|
153
159
|
return unless permissions.is_a? Integer
|
154
160
|
return unless s.is_a? String
|
155
161
|
|
156
|
-
if s[/^dfs:\/\//] or @fs ==
|
162
|
+
if s[/^dfs:\/\//] or @fs[0..2] == 'dfs' then
|
157
163
|
DfsFile.chmod permissions, s
|
158
164
|
else
|
159
165
|
FileUtils.chmod permissions, s
|
@@ -161,17 +167,20 @@ class RXFHelper
|
|
161
167
|
|
162
168
|
end
|
163
169
|
|
164
|
-
def self.cp(s1, s2)
|
170
|
+
def self.cp(s1, s2, debug: false)
|
171
|
+
|
172
|
+
puts 'inside RXFHelper.cp' if debug
|
165
173
|
|
166
174
|
found = [s1,s2].grep /^\w+:\/\//
|
175
|
+
puts 'found: ' + found.inspect if debug
|
167
176
|
|
168
|
-
if found then
|
177
|
+
if found.any? then
|
169
178
|
|
170
|
-
case found.first[/^\w+(?=:\/\/)/]
|
179
|
+
case found.first[/^\w+(?=:\/\/)/]
|
171
180
|
|
172
|
-
when
|
181
|
+
when 'dfs'
|
173
182
|
DfsFile.cp(s1, s2)
|
174
|
-
when
|
183
|
+
when 'ftp'
|
175
184
|
MyMediaFTP.cp s1, s2
|
176
185
|
else
|
177
186
|
|
@@ -186,12 +195,22 @@ class RXFHelper
|
|
186
195
|
|
187
196
|
def self.chdir(x)
|
188
197
|
|
198
|
+
# We can use @fs within chdir() to flag the current file system.
|
199
|
+
# Allowing us to use relative paths with FileX operations instead
|
200
|
+
# of explicitly stating the path each time. e.g. touch 'foo.txt'
|
201
|
+
#
|
202
|
+
|
189
203
|
if x[/^file:\/\//] or File.exists?(File.dirname(x)) then
|
204
|
+
|
190
205
|
@fs = :local
|
191
206
|
FileUtils.chdir x
|
207
|
+
|
192
208
|
elsif x[/^dfs:\/\//]
|
193
|
-
|
209
|
+
|
210
|
+
host = x[/(?<=dfs:\/\/)[^\/]+/]
|
211
|
+
@fs = 'dfs://' + host
|
194
212
|
DfsFile.chdir x
|
213
|
+
|
195
214
|
end
|
196
215
|
|
197
216
|
end
|
@@ -229,12 +248,12 @@ class RXFHelper
|
|
229
248
|
|
230
249
|
return Dir[x] if File.exists?(File.dirname(x))
|
231
250
|
|
232
|
-
case x[/^\w+(?=:\/\/)/]
|
233
|
-
when
|
251
|
+
case x[/^\w+(?=:\/\/)/]
|
252
|
+
when 'file'
|
234
253
|
Dir[x]
|
235
|
-
when
|
254
|
+
when 'dfs'
|
236
255
|
DfsFile.ls x
|
237
|
-
when
|
256
|
+
when 'ftp'
|
238
257
|
MyMediaFTP.ls x
|
239
258
|
else
|
240
259
|
|
@@ -254,7 +273,7 @@ class RXFHelper
|
|
254
273
|
|
255
274
|
def self.mkdir_p(x)
|
256
275
|
|
257
|
-
if x[/^dfs:\/\//] or @fs ==
|
276
|
+
if x[/^dfs:\/\//] or @fs[0..2] == 'dfs' then
|
258
277
|
DfsFile.mkdir_p x
|
259
278
|
else
|
260
279
|
FileUtils.mkdir_p x
|
@@ -378,13 +397,30 @@ class RXFHelper
|
|
378
397
|
|
379
398
|
def self.rm(filename)
|
380
399
|
|
381
|
-
case filename[/^\w+(?=:\/\/)/]
|
382
|
-
when
|
400
|
+
case filename[/^\w+(?=:\/\/)/]
|
401
|
+
when 'dfs'
|
383
402
|
DfsFile.rm filename
|
384
|
-
when
|
403
|
+
when 'ftp'
|
385
404
|
MyMediaFTP.rm filename
|
386
405
|
else
|
406
|
+
FileUtils.rm
|
407
|
+
end
|
408
|
+
|
409
|
+
end
|
387
410
|
|
411
|
+
def self.touch(filename, mtime: Time.now)
|
412
|
+
|
413
|
+
if @fs[0..2] == 'dfs' then
|
414
|
+
return DfsFile.touch(@fs + pwd + '/' + filename, mtime: mtime)
|
415
|
+
end
|
416
|
+
|
417
|
+
case filename[/^\w+(?=:\/\/)/]
|
418
|
+
when 'dfs'
|
419
|
+
DfsFile.touch filename, mtime: mtime
|
420
|
+
#when 'ftp'
|
421
|
+
# MyMediaFTP.touch filename
|
422
|
+
else
|
423
|
+
FileUtils.touch filename, mtime: mtime
|
388
424
|
end
|
389
425
|
|
390
426
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rxfhelper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
MrrH8cS6bqJRPQqEL1FsPmXfQpp86RvPSr0WqNSRnYEUCmqL0l2pYrXdPAyBLcji
|
36
36
|
X1jPyhH0sl/QdPdaUnsigze+
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-02-08 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rsc
|
metadata.gz.sig
CHANGED
Binary file
|