drb_fileclient 0.4.3 → 0.4.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.tar.gz.sig +0 -0
- data/lib/drb_fileclient.rb +32 -31
- 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: aac4c5bf2603750af085ade9036fd20874b0cca8cbfbbb36e51a774c5943cc3f
|
4
|
+
data.tar.gz: fb4483969bc3717fa84838f2a636de99c8b97f8e0e56b3736190b7f9a4ec5250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f697ca6f319dda244a197c48911f91697b17c7deaf920d54ec03bcbc04ff31ad1236f3e547370d16635baa2ef70eabbce2c10b3767828316bd44a3a4cc1cbad8
|
7
|
+
data.tar.gz: 0ae4f1f63619bf461d5e39fa602194f2cbe24c81d742a01ae9c8d91dd17ee8b376fc13a0ec3929b2eb43fc2eb74af63028e72ca39a4021fc24d3a0f85b61c35a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/drb_fileclient.rb
CHANGED
@@ -26,12 +26,12 @@ class DRbFileClient
|
|
26
26
|
|
27
27
|
return Dir.chdir raw_path unless @directory or raw_path =~ /^dfs:\/\//
|
28
28
|
|
29
|
-
|
30
|
-
raw_path[1..-1]
|
29
|
+
if raw_path[0] == '/' then
|
30
|
+
directory = raw_path[1..-1]
|
31
31
|
elsif raw_path =~ /^dfs:\/\//
|
32
|
-
parse_path(raw_path)
|
32
|
+
@file, directory = parse_path(raw_path)
|
33
33
|
else
|
34
|
-
File.join(@directory, raw_path)
|
34
|
+
directory = File.join(@directory, raw_path)
|
35
35
|
end
|
36
36
|
|
37
37
|
if @file.exists? directory then
|
@@ -79,11 +79,11 @@ class DRbFileClient
|
|
79
79
|
|
80
80
|
return File.exists? filename unless @directory or filename =~ /^dfs:\/\//
|
81
81
|
|
82
|
-
|
83
|
-
parse_path(filename)
|
82
|
+
if filename =~ /^dfs:\/\// then
|
83
|
+
@file, filename2 = parse_path(filename)
|
84
84
|
else
|
85
85
|
|
86
|
-
File.join(@directory, filename)
|
86
|
+
filename2 = File.join(@directory, filename)
|
87
87
|
end
|
88
88
|
|
89
89
|
@file.exists?(filename2)
|
@@ -96,12 +96,12 @@ class DRbFileClient
|
|
96
96
|
|
97
97
|
return Dir[raw_path] unless @directory or raw_path =~ /^dfs:\/\//
|
98
98
|
|
99
|
-
|
100
|
-
raw_path[1..-1]
|
99
|
+
if raw_path[0] == '/' then
|
100
|
+
path = raw_path[1..-1]
|
101
101
|
elsif raw_path =~ /^dfs:\/\//
|
102
|
-
parse_path(raw_path)
|
102
|
+
@file, path = parse_path(raw_path)
|
103
103
|
else
|
104
|
-
File.join(@directory, raw_path)
|
104
|
+
path = File.join(@directory, raw_path)
|
105
105
|
end
|
106
106
|
|
107
107
|
@file.ls path
|
@@ -112,7 +112,7 @@ class DRbFileClient
|
|
112
112
|
|
113
113
|
return FileUtils.mkdir name unless @directory or name =~ /^dfs:\/\//
|
114
114
|
|
115
|
-
path = parse_path(name)
|
115
|
+
@file, path = parse_path(name)
|
116
116
|
@file.mkdir path
|
117
117
|
end
|
118
118
|
|
@@ -122,10 +122,10 @@ class DRbFileClient
|
|
122
122
|
return FileUtils.mkdir_p raw_path
|
123
123
|
end
|
124
124
|
|
125
|
-
|
126
|
-
parse_path(raw_path)
|
125
|
+
if raw_path =~ /^dfs:\/\// then
|
126
|
+
@file, filepath = parse_path(raw_path)
|
127
127
|
else
|
128
|
-
File.join(@directory, raw_path)
|
128
|
+
filepath = File.join(@directory, raw_path)
|
129
129
|
end
|
130
130
|
|
131
131
|
@file.mkdir_p filepath
|
@@ -137,10 +137,12 @@ class DRbFileClient
|
|
137
137
|
return FileUtils.mv raw_path, raw_path2
|
138
138
|
end
|
139
139
|
|
140
|
-
|
141
|
-
|
140
|
+
if raw_path =~ /^dfs:\/\// then
|
141
|
+
_, path = parse_path(raw_path)
|
142
|
+
@file, path2 = parse_path(raw_path2)
|
142
143
|
else
|
143
|
-
|
144
|
+
path = File.join(@directory, raw_path)
|
145
|
+
path2 = File.join(@directory, raw_path2)
|
144
146
|
end
|
145
147
|
|
146
148
|
@file.mv path, path2
|
@@ -158,10 +160,10 @@ class DRbFileClient
|
|
158
160
|
|
159
161
|
return File.read filename, s unless @directory or filename =~ /^dfs:\/\//
|
160
162
|
|
161
|
-
|
162
|
-
parse_path(filename)
|
163
|
+
if filename =~ /^dfs:\/\// then
|
164
|
+
@file, path = parse_path(filename)
|
163
165
|
else
|
164
|
-
File.join(@directory, filename)
|
166
|
+
path = File.join(@directory, filename)
|
165
167
|
end
|
166
168
|
|
167
169
|
@file.read path
|
@@ -171,10 +173,10 @@ class DRbFileClient
|
|
171
173
|
|
172
174
|
return FileUtils.rm path unless @directory or path =~ /^dfs:\/\//
|
173
175
|
|
174
|
-
|
175
|
-
parse_path( path)
|
176
|
+
if path =~ /^dfs:\/\// then
|
177
|
+
@file, path2 = parse_path( path)
|
176
178
|
else
|
177
|
-
File.join(@directory, path)
|
179
|
+
path2 = File.join(@directory, path)
|
178
180
|
end
|
179
181
|
|
180
182
|
@file.rm path2
|
@@ -185,13 +187,12 @@ class DRbFileClient
|
|
185
187
|
|
186
188
|
return File.write filename, s unless @directory or filename =~ /^dfs:\/\//
|
187
189
|
|
188
|
-
|
189
|
-
parse_path(filename)
|
190
|
+
if filename =~ /^dfs:\/\// then
|
191
|
+
@file, path = parse_path(filename)
|
190
192
|
else
|
191
|
-
File.join(@directory, filename)
|
193
|
+
path = File.join(@directory, filename)
|
192
194
|
end
|
193
195
|
|
194
|
-
|
195
196
|
@file.write path, s
|
196
197
|
|
197
198
|
end
|
@@ -212,10 +213,10 @@ class DRbFileClient
|
|
212
213
|
|
213
214
|
end
|
214
215
|
|
215
|
-
|
216
|
-
parse_path(filename_zip)
|
216
|
+
if filename_zip =~ /^dfs:\/\// then
|
217
|
+
@file, filepath = parse_path(filename_zip)
|
217
218
|
else
|
218
|
-
File.join(@directory, filename_zip)
|
219
|
+
filepath = File.join(@directory, filename_zip)
|
219
220
|
end
|
220
221
|
|
221
222
|
@file.zip filepath, a
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|