rxfreadwrite 0.1.3 → 0.1.4
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/rxfreadwrite.rb +86 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: f590af109926771c33146cd9d67028c7265dc21b1325d73db1030ffe9b986c60
|
4
|
+
data.tar.gz: 98b4786889d566036dd90f2fe2f742f88a9aca70bb1d2a90b494d932e9728bc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4fa55f10256f185dbf553ae60b089536481f35211ba69cfe78fed0242f79144c4dd3d31d5af969209e2eb9c8c3ba071ef263009977de7c1a97d4e825e31d1f5
|
7
|
+
data.tar.gz: f79b56d926a4020edebfc687863d38e2ed7d92da233d6e0b36856a9d8d12df9f04e08e7933d9f99687112a26a5bf76e59d40ffa1c38515fd7cd18746cb34f3a2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rxfreadwrite.rb
CHANGED
@@ -11,7 +11,9 @@ module RXFReadWriteModule
|
|
11
11
|
|
12
12
|
class DirX
|
13
13
|
|
14
|
-
def self.glob(s)
|
14
|
+
def self.glob(s) RXFReadWrite.glob(s) end
|
15
|
+
def self.mkdir(s) RXFReadWrite.mkdir(s) end
|
16
|
+
def self.mkdir_p(s) RXFReadWrite.mkdir_p(s) end
|
15
17
|
|
16
18
|
end
|
17
19
|
|
@@ -57,6 +59,15 @@ module RXFReadWriteModule
|
|
57
59
|
end
|
58
60
|
end
|
59
61
|
|
62
|
+
def FileX.mkdir(s) RXFReadWrite.mkdir(s) end
|
63
|
+
def FileX.mkdir_p(s) RXFReadWrite.mkdir_p(s) end
|
64
|
+
|
65
|
+
def FileX.rm(s) RXFReadWrite.rm(s) end
|
66
|
+
|
67
|
+
def FileX.rm_r(s, force: false)
|
68
|
+
RXFReadWrite.rm_r(s, force: force)
|
69
|
+
end
|
70
|
+
|
60
71
|
def FileX.touch(s, mtime: Time.now)
|
61
72
|
RXFReadWrite.touch(s, mtime: mtime)
|
62
73
|
end
|
@@ -83,6 +94,80 @@ class RXFReadWrite < RXFReader
|
|
83
94
|
|
84
95
|
end
|
85
96
|
|
97
|
+
def self.mkdir(x)
|
98
|
+
|
99
|
+
if x[/^file:\/\//] or File.exists?(File.dirname(x)) then
|
100
|
+
FileUtils.mkdir x
|
101
|
+
elsif x[/^dfs:\/\//]
|
102
|
+
DfsFile.mkdir x
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.mkdir_p(x)
|
108
|
+
|
109
|
+
if x[/^dfs:\/\//] then
|
110
|
+
DfsFile.mkdir_p x
|
111
|
+
else
|
112
|
+
FileUtils.mkdir_p x
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
|
117
|
+
def self.rm(filename)
|
118
|
+
|
119
|
+
case filename[/^\w+(?=:\/\/)/]
|
120
|
+
when 'dfs'
|
121
|
+
DfsFile.rm filename
|
122
|
+
else
|
123
|
+
|
124
|
+
if File.basename(filename) =~ /\*/ then
|
125
|
+
|
126
|
+
Dir.glob(filename).each do |file|
|
127
|
+
|
128
|
+
begin
|
129
|
+
FileUtils.rm file
|
130
|
+
rescue
|
131
|
+
puts ('RXFReadWrite#rm: ' + file + ' is a Directory').warning
|
132
|
+
end
|
133
|
+
|
134
|
+
end
|
135
|
+
|
136
|
+
else
|
137
|
+
FileUtils.rm filename
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
|
142
|
+
end
|
143
|
+
|
144
|
+
def self.rm_r(filename, force: false)
|
145
|
+
|
146
|
+
case filename[/^\w+(?=:\/\/)/]
|
147
|
+
when 'dfs'
|
148
|
+
DfsFile.rm_r filename, force: force
|
149
|
+
else
|
150
|
+
|
151
|
+
if File.basename(filename) =~ /\*/ then
|
152
|
+
|
153
|
+
Dir.glob(filename).each do |file|
|
154
|
+
|
155
|
+
begin
|
156
|
+
FileUtils.rm_r file, force: force
|
157
|
+
rescue
|
158
|
+
puts ('RXFReadWrite#rm_r: ' + file + ' is a Directory').warning
|
159
|
+
end
|
160
|
+
|
161
|
+
end
|
162
|
+
|
163
|
+
else
|
164
|
+
FileUtils.rm_r filename, force: force
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
|
86
171
|
def self.touch(filename, mtime: Time.now)
|
87
172
|
|
88
173
|
case filename[/^\w+(?=:\/\/)/]
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|