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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95295c82220fac32aad607d93eb02499e847e50b10241c5988e501cfbe47836e
4
- data.tar.gz: 321f4eb44aced8e168d4569794a729a2b0988ac84919692c4a62a9844c0205c9
3
+ metadata.gz: f590af109926771c33146cd9d67028c7265dc21b1325d73db1030ffe9b986c60
4
+ data.tar.gz: 98b4786889d566036dd90f2fe2f742f88a9aca70bb1d2a90b494d932e9728bc9
5
5
  SHA512:
6
- metadata.gz: 3fe0e6d2836ac67e079630480e8fda469f042621c66312e67d8e766b2396235834befe0ccedfb8aeac57a7aec78cc31abb6e0ba6b33cab17f826d86bd8f4fa47
7
- data.tar.gz: 7204f4795f43b7d45a82d1d5b99f948d355e8687e2428731ae143942228ce2db75f845a0b763079ad9acb8c453ff839793091266f8e6eee31f7436615462c58c
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) RXFReadWrite.glob(s) end
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rxfreadwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file