rxfhelper 1.2.3 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28e436ed54b4585bc6386e61934df9ef818720c3bda4948df520c44c9d0671bc
4
- data.tar.gz: bed423faffffcee3e793eb0e2c739302a65f8e4d36241a4902c337bb07bb455f
3
+ metadata.gz: 7ee4ada6e5d55045940a454a0b5c9dfab3d2630c739e31bf952e465af40ea62b
4
+ data.tar.gz: 58ab749bec1edae0106076958b0a2889b14f16eccff12f585278e96d68a22a59
5
5
  SHA512:
6
- metadata.gz: c13aa7cd67307d6b551fe77d56e326f077f47ab84f1ca1343ec60891b94545957d8d858884296d7c19118bda9d343bbad890deb97b245d58bcfc62f36e4ca74c
7
- data.tar.gz: 8369514628a2a8993ea66fb7fb8623ed0771818df78dad09b6bc1c3ea7bfd4b7b230a39504c762d18c6aca4537f0b7af4c56499ee7c578b1445aec59d2c06e28
6
+ metadata.gz: b513111d712f8073c031bf2f10f6959c4d8be8e0b735828b8d007da2e456a42e888c03a5e49c6638b04e352fe40e8b0a53fda11d27bec35e474e6a54ec398702
7
+ data.tar.gz: a243d9874ad7c158fa3adadfef5b8aec7f38be92c705210f2d75dfa9bc6fef5613d797c1362887dab04e44a275c806004c5cc12c2f04f6f5171443b10ad76091
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rxfhelper.rb CHANGED
@@ -9,6 +9,7 @@ require 'mymedia_ftp'
9
9
  require 'drb_fileclient'
10
10
  require 'drb_reg_client'
11
11
  require 'remote_dwsregistry'
12
+ require 'dir-to-xml'
12
13
 
13
14
 
14
15
 
@@ -110,7 +111,18 @@ module RXFHelperModule
110
111
  def self.pwd() RXFHelper.pwd() end
111
112
  def self.read(x) RXFHelper.read(x).first end
112
113
  def self.rm(s) RXFHelper.rm(s) end
113
- def self.touch(s) RXFHelper.touch(s) end
114
+
115
+ def self.rm_r(s, force: false)
116
+ RXFHelper.rm_r(s, force: force)
117
+ end
118
+
119
+ def self.ru(s) RXFHelper.ru(s) end
120
+ def self.ru_r(s) RXFHelper.ru_r(s) end
121
+
122
+ def self.touch(s, mtime: Time.now)
123
+ RXFHelper.touch(s, mtime: mtime)
124
+ end
125
+
114
126
  def self.write(x, s) RXFHelper.write(x, s) end
115
127
  def self.zip(s, a) RXFHelper.zip(s, a) end
116
128
 
@@ -399,24 +411,101 @@ class RXFHelper
399
411
  when 'ftp'
400
412
  MyMediaFTP.rm filename
401
413
  else
402
- FileUtils.rm
414
+
415
+ if File.basename(filename) =~ /\*/ then
416
+
417
+ Dir.glob(filename).each do |file|
418
+
419
+ begin
420
+ FileUtils.rm file
421
+ rescue
422
+ puts ('RXFHelper#rm: ' + file + ' is a Directory').warning
423
+ end
424
+
425
+ end
426
+
427
+ else
428
+ FileUtils.rm filename
429
+ end
430
+
403
431
  end
404
432
 
405
433
  end
406
434
 
407
- def self.touch(filename)
435
+ def self.rm_r(filename, force: false)
436
+
437
+ case filename[/^\w+(?=:\/\/)/]
438
+ when 'dfs'
439
+ DfsFile.rm_r filename, force: force
440
+ #when 'ftp'
441
+ # MyMediaFTP.rm filename
442
+ else
443
+
444
+ if File.basename(filename) =~ /\*/ then
445
+
446
+ Dir.glob(filename).each do |file|
447
+
448
+ begin
449
+ FileUtils.rm_r file, force: force
450
+ rescue
451
+ puts ('RXFHelper#rm: ' + file + ' is a Directory').warning
452
+ end
453
+
454
+ end
455
+
456
+ else
457
+ FileUtils.rm_r filename, force: force
458
+ end
459
+
460
+ end
461
+
462
+ end
463
+
464
+ # recently_updated
465
+ #
466
+ def self.ru(path='.')
467
+
468
+ case path[/^\w+(?=:\/\/)/]
469
+ when 'dfs'
470
+ DfsFile.ru path
471
+
472
+ else
473
+
474
+ DirToXML.new(path, recursive: false, verbose: false).latest
475
+
476
+ end
477
+
478
+ end
479
+
480
+ # recently updated recursively check directories
481
+ #
482
+ def self.ru_r(path='.')
483
+
484
+ case path[/^\w+(?=:\/\/)/]
485
+ when 'dfs'
486
+ DfsFile.ru_r path
487
+
488
+ else
489
+
490
+ DirToXML.new(path, recursive: true, verbose: false).latest
491
+
492
+ end
493
+
494
+ end
495
+
496
+ def self.touch(filename, mtime: Time.now)
408
497
 
409
498
  if @fs[0..2] == 'dfs' then
410
- return DfsFile.touch(@fs + pwd + '/' + filename)
499
+ return DfsFile.touch(@fs + pwd + '/' + filename, mtime: mtime)
411
500
  end
412
501
 
413
502
  case filename[/^\w+(?=:\/\/)/]
414
503
  when 'dfs'
415
- DfsFile.touch filename
416
- when 'ftp'
417
- MyMediaFTP.touch filename
504
+ DfsFile.touch filename, mtime: mtime
505
+ #when 'ftp'
506
+ # MyMediaFTP.touch filename
418
507
  else
419
- FileUtils.touch filename
508
+ FileUtils.touch filename, mtime: mtime
420
509
  end
421
510
 
422
511
  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.3
4
+ version: 1.3.0
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-02-07 00:00:00.000000000 Z
38
+ date: 2022-02-10 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rsc
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0.6'
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 0.6.1
69
+ version: 0.6.3
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0.6'
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 0.6.1
79
+ version: 0.6.3
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: mymedia_ftp
82
82
  requirement: !ruby/object:Gem::Requirement
@@ -157,6 +157,26 @@ dependencies:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
159
  version: '2.1'
160
+ - !ruby/object:Gem::Dependency
161
+ name: dir-to-xml
162
+ requirement: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.1'
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: 1.1.2
170
+ type: :runtime
171
+ prerelease: false
172
+ version_requirements: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - "~>"
175
+ - !ruby/object:Gem::Version
176
+ version: '1.1'
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: 1.1.2
160
180
  description:
161
181
  email: digital.robertson@gmail.com
162
182
  executables: []
@@ -176,7 +196,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
196
  requirements:
177
197
  - - ">="
178
198
  - !ruby/object:Gem::Version
179
- version: 2.1.2
199
+ version: 3.0.2
180
200
  required_rubygems_version: !ruby/object:Gem::Requirement
181
201
  requirements:
182
202
  - - ">="
metadata.gz.sig CHANGED
Binary file