rxfileio 0.2.1 → 0.2.2
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/rxfileio.rb +5 -72
- data.tar.gz.sig +0 -0
- metadata +4 -4
- 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: e7db64c7d89309ab0d9eb3873d6a0e052c6e9727111d2901b3a2f23b807e6545
|
4
|
+
data.tar.gz: 1958f065b57a9caac5d62eff33ffe095fd20b8d5f9740d2f85cd826b69af6f80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae1d408d9aaf428e71d2009e4f9ef9885504179a2855b9dac6a4d04e910b86062581b3d49528053d0c7bd4007be4dadebbc8604769fa2f594e86b52370b1bc75
|
7
|
+
data.tar.gz: b8b62bb03b42e9ede6ec223d7c3ab3fac01d30c8506b5e25a6efd6efa07971c2009bb51219441e89eb473d5b19832de0a6d423b89365a9d907ca8a14a04a780a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rxfileio.rb
CHANGED
@@ -11,42 +11,13 @@ require 'mymedia_ftp'
|
|
11
11
|
module RXFileIOModule
|
12
12
|
include RXFReadWriteModule
|
13
13
|
|
14
|
-
def
|
15
|
-
def DirX.mkdir(s) RXFileIO.mkdir(s) end
|
16
|
-
def DirX.pwd() RXFileIO.pwd() end
|
17
|
-
|
18
|
-
def FileX.chdir(s) RXFileIO.chdir(s) end
|
19
|
-
|
20
|
-
def FileX.directory?(filename)
|
21
|
-
|
22
|
-
type = FileX.filetype(filename)
|
23
|
-
|
24
|
-
filex = case type
|
25
|
-
when :file
|
26
|
-
File
|
27
|
-
when :dfs
|
28
|
-
DfsFile
|
29
|
-
else
|
30
|
-
nil
|
31
|
-
end
|
32
|
-
|
33
|
-
return nil unless filex
|
34
|
-
|
35
|
-
filex.directory? filename
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
def FileX.exist?(filename)
|
40
|
-
exists? filename
|
41
|
-
end
|
42
|
-
|
14
|
+
def FileX.exist?(filename) exists? filename end
|
43
15
|
def FileX.chmod(num, s) RXFileIO.chmod(num, s) end
|
44
16
|
def FileX.cp(s, s2) RXFileIO.cp(s, s2) end
|
45
17
|
def FileX.ls(s) RXFileIO.ls(s) end
|
46
18
|
def FileX.mkdir(s) RXFileIO.mkdir(s) end
|
47
19
|
def FileX.mkdir_p(s) RXFileIO.mkdir_p(s) end
|
48
20
|
def FileX.mv(s, s2) RXFileIO.mv(s, s2) end
|
49
|
-
def FileX.pwd() RXFileIO.pwd() end
|
50
21
|
def FileX.read(x) RXFileIO.read(x).first end
|
51
22
|
def FileX.rm(s) RXFileIO.rm(s) end
|
52
23
|
|
@@ -73,14 +44,13 @@ end
|
|
73
44
|
class RXFileIO < RXFReadWrite
|
74
45
|
using ColouredText
|
75
46
|
|
76
|
-
@fs = :local
|
77
47
|
|
78
48
|
def self.chmod(permissions, s)
|
79
49
|
|
80
50
|
return unless permissions.is_a? Integer
|
81
51
|
return unless s.is_a? String
|
82
52
|
|
83
|
-
if s[/^dfs:\/\//] or
|
53
|
+
if s[/^dfs:\/\//] or @@fs[0..2] == 'dfs' then
|
84
54
|
DfsFile.chmod permissions, s
|
85
55
|
else
|
86
56
|
FileUtils.chmod permissions, s
|
@@ -112,27 +82,7 @@ class RXFileIO < RXFReadWrite
|
|
112
82
|
end
|
113
83
|
end
|
114
84
|
|
115
|
-
def self.chdir(x)
|
116
|
-
|
117
|
-
# We can use @fs within chdir() to flag the current file system.
|
118
|
-
# Allowing us to use relative paths with FileX operations instead
|
119
|
-
# of explicitly stating the path each time. e.g. touch 'foo.txt'
|
120
|
-
#
|
121
|
-
|
122
|
-
if x[/^file:\/\//] or File.exists?(File.dirname(x)) then
|
123
|
-
|
124
|
-
@fs = :local
|
125
|
-
FileUtils.chdir x
|
126
85
|
|
127
|
-
elsif x[/^dfs:\/\//]
|
128
|
-
|
129
|
-
host = x[/(?<=dfs:\/\/)[^\/]+/]
|
130
|
-
@fs = 'dfs://' + host
|
131
|
-
DfsFile.chdir x
|
132
|
-
|
133
|
-
end
|
134
|
-
|
135
|
-
end
|
136
86
|
|
137
87
|
def self.ls(x='*')
|
138
88
|
|
@@ -151,19 +101,9 @@ class RXFileIO < RXFReadWrite
|
|
151
101
|
|
152
102
|
end
|
153
103
|
|
154
|
-
def self.mkdir(x)
|
155
|
-
|
156
|
-
if x[/^file:\/\//] or File.exists?(File.dirname(x)) then
|
157
|
-
FileUtils.mkdir x
|
158
|
-
elsif x[/^dfs:\/\//]
|
159
|
-
DfsFile.mkdir x
|
160
|
-
end
|
161
|
-
|
162
|
-
end
|
163
|
-
|
164
104
|
def self.mkdir_p(x)
|
165
105
|
|
166
|
-
if x[/^dfs:\/\//] or
|
106
|
+
if x[/^dfs:\/\//] or @@fs[0..2] == 'dfs' then
|
167
107
|
DfsFile.mkdir_p x
|
168
108
|
else
|
169
109
|
FileUtils.mkdir_p x
|
@@ -175,13 +115,6 @@ class RXFileIO < RXFReadWrite
|
|
175
115
|
DfsFile.mv(s1, s2)
|
176
116
|
end
|
177
117
|
|
178
|
-
|
179
|
-
def self.pwd()
|
180
|
-
|
181
|
-
DfsFile.pwd
|
182
|
-
|
183
|
-
end
|
184
|
-
|
185
118
|
def self.read(x, h={})
|
186
119
|
|
187
120
|
opt = {debug: false}.merge(h)
|
@@ -347,8 +280,8 @@ class RXFileIO < RXFReadWrite
|
|
347
280
|
|
348
281
|
def self.touch(filename, mtime: Time.now)
|
349
282
|
|
350
|
-
if
|
351
|
-
return DfsFile.touch(
|
283
|
+
if @@fs[0..2] == 'dfs' then
|
284
|
+
return DfsFile.touch(@@fs + pwd + '/' + filename, mtime: mtime)
|
352
285
|
end
|
353
286
|
|
354
287
|
case filename[/^\w+(?=:\/\/)/]
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rxfileio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
yLO5YIYbN1F1F4bnaaoKLedXnnC+5VCarLA4HblYDwqrZ78CQIBelACSnxeY9gD3
|
36
36
|
oyr0nnshzqXtH7vQD0nI5kqL
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-02-
|
38
|
+
date: 2022-02-28 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rxfreadwrite
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
version: '0.2'
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.2.
|
49
|
+
version: 0.2.5
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
version: '0.2'
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.2.
|
59
|
+
version: 0.2.5
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: drb_fileclient
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|