drb_fileclient 0.6.0 → 0.7.0
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/drb_fileclient.rb +89 -0
- data.tar.gz.sig +0 -0
- metadata +22 -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: ebfe11659555afdd1a5b938d65dbf555710785308077f46040275f6416fa407a
|
4
|
+
data.tar.gz: 749c9c2c1dc888fe6cf7faa5ff7163454887edf2f2fdf26ba9b8a7ec47a65275
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ad6ed6c1a5b71271904c308df9ba30a9165b13777066afbf03d4dbba222f4b7b8c82a96d639156996a09d103efa7cf6401d8c51083e36e2a9d31c6b9e019c65
|
7
|
+
data.tar.gz: 03b607d56913a234a7e51ee91ecf6592aa3e366b545367bda920fa77ebe0413da9e5adf320789c0dd1f5687b6fe337c8422643d70c8beca6dd9d4e04ed69a5f4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/drb_fileclient.rb
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
require 'drb'
|
6
6
|
require 'zip'
|
7
7
|
require 'c32'
|
8
|
+
require 'dir-to-xml'
|
8
9
|
|
9
10
|
|
10
11
|
class DRbFileClient
|
@@ -146,6 +147,18 @@ class DRbFileClient
|
|
146
147
|
|
147
148
|
alias exist? exists?
|
148
149
|
|
150
|
+
def glob(s)
|
151
|
+
|
152
|
+
if s =~ /^dfs:\/\// then
|
153
|
+
@file, s2 = parse_path(s)
|
154
|
+
else
|
155
|
+
s2 = File.join(@directory, s)
|
156
|
+
end
|
157
|
+
|
158
|
+
@file.glob s2
|
159
|
+
|
160
|
+
end
|
161
|
+
|
149
162
|
def ls(raw_path)
|
150
163
|
|
151
164
|
return Dir[raw_path] unless @directory or raw_path =~ /^dfs:\/\//
|
@@ -241,6 +254,69 @@ class DRbFileClient
|
|
241
254
|
|
242
255
|
end
|
243
256
|
|
257
|
+
def rm_r(path, force: false)
|
258
|
+
|
259
|
+
unless @directory or path =~ /^dfs:\/\// then
|
260
|
+
return FileUtils.rm_r(path, force: force)
|
261
|
+
end
|
262
|
+
|
263
|
+
if path =~ /^dfs:\/\// then
|
264
|
+
@file, path2 = parse_path( path)
|
265
|
+
else
|
266
|
+
path2 = File.join(@directory, path)
|
267
|
+
end
|
268
|
+
|
269
|
+
@file.rm_r(path2, force: force)
|
270
|
+
|
271
|
+
end
|
272
|
+
|
273
|
+
def ru(path)
|
274
|
+
|
275
|
+
return DirToXML.new(path, verbose: false).latest unless @directory \
|
276
|
+
or path =~ /^dfs:\/\//
|
277
|
+
|
278
|
+
if path =~ /^dfs:\/\// then
|
279
|
+
@file, path2 = parse_path( path)
|
280
|
+
else
|
281
|
+
path2 = File.join(@directory, path)
|
282
|
+
end
|
283
|
+
|
284
|
+
@file.ru path2
|
285
|
+
|
286
|
+
end
|
287
|
+
|
288
|
+
def ru_r(path)
|
289
|
+
|
290
|
+
unless @directory or path =~ /^dfs:\/\// then
|
291
|
+
return DirToXML.new(path, recursive: true, verbose: false).latest
|
292
|
+
end
|
293
|
+
|
294
|
+
if path =~ /^dfs:\/\// then
|
295
|
+
@file, path2 = parse_path( path)
|
296
|
+
else
|
297
|
+
path2 = File.join(@directory, path)
|
298
|
+
end
|
299
|
+
|
300
|
+
@file.ru_r path2
|
301
|
+
|
302
|
+
end
|
303
|
+
|
304
|
+
def touch(s, mtime: Time.now)
|
305
|
+
|
306
|
+
unless @directory or s =~ /^dfs:\/\// then
|
307
|
+
return FileUtils.touch(s, mtime: mtime)
|
308
|
+
end
|
309
|
+
|
310
|
+
if s =~ /^dfs:\/\// then
|
311
|
+
@file, s2 = parse_path(s)
|
312
|
+
else
|
313
|
+
s2 = File.join(@directory, s)
|
314
|
+
end
|
315
|
+
|
316
|
+
@file.touch s2, mtime: mtime
|
317
|
+
|
318
|
+
end
|
319
|
+
|
244
320
|
def write(filename=@filename, s)
|
245
321
|
|
246
322
|
return File.write filename, s unless @directory or filename =~ /^dfs:\/\//
|
@@ -306,6 +382,7 @@ class DfsFile
|
|
306
382
|
def self.chdir(path) @client.chdir(path) end
|
307
383
|
def self.chmod(num, filename) @client.chmod(num, filename) end
|
308
384
|
def self.cp(path, path2) @client.cp(path, path2) end
|
385
|
+
def self.glob(s) @client.glob(s) end
|
309
386
|
def self.ls(path) @client.ls(path) end
|
310
387
|
def self.mkdir(name) @client.mkdir(name) end
|
311
388
|
def self.mkdir_p(path) @client.mkdir_p(path) end
|
@@ -313,6 +390,18 @@ class DfsFile
|
|
313
390
|
def self.pwd() @client.pwd() end
|
314
391
|
def self.read(filename) @client.read(filename) end
|
315
392
|
def self.rm(filename) @client.rm(filename) end
|
393
|
+
|
394
|
+
def self.rm_r(filename, force: false)
|
395
|
+
@client.rm_r(filename, force: force)
|
396
|
+
end
|
397
|
+
|
398
|
+
def self.ru(path) @client.ru(path) end
|
399
|
+
def self.ru_r(path) @client.ru_r(path) end
|
400
|
+
|
401
|
+
def self.touch(filename, mtime: Time.now)
|
402
|
+
@client.touch(filename, mtime: mtime)
|
403
|
+
end
|
404
|
+
|
316
405
|
def self.write(filename, s) @client.write(filename, s) end
|
317
406
|
def self.zip(filename, a) @client.zip(filename, a) end
|
318
407
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drb_fileclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,8 +35,28 @@ cert_chain:
|
|
35
35
|
FGcgjmmz5fOIqq2sBxk6JW1yo2G43yIUzymWOYKT2Jh6RR0Gg3z66wWwYpFpx8yR
|
36
36
|
00JTBNVAgW+s2sLpeBtyMDbb
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-02-10 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: dir-to-xml
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.1'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.1.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.1'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 1.1.2
|
40
60
|
- !ruby/object:Gem::Dependency
|
41
61
|
name: zip
|
42
62
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|