drb_fileclient 0.8.0 → 0.8.1

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: 3ed719651fa7f16cafe56ad1b31e5dc38e2b5f4911efc02ea3debbf000fe979f
4
- data.tar.gz: e7f3cedea649ef656a2a3bbac1bbea1c5b08d4361a8dbba6e8e6c053daba6cea
3
+ metadata.gz: 07a2cbcbbc70f014fa750685abf3a553e1d904873aba2c58b979b9178c1ab8e8
4
+ data.tar.gz: 0c6ea77a2ce0c463a4ecc39a1c735f5b91645e917b1208d7e43258c9db096fd0
5
5
  SHA512:
6
- metadata.gz: 8e58ed59bb066e970725a2c78e7f53541eba9dd78502583fe460353a60e2ea1ceead178426fb5f062a763fb96663395274f9318551576cd6d01d09692268a1a6
7
- data.tar.gz: 7f9dea8306afeb58826bf9c0ca791d41770dc566a1409ff8df7d7c2d564aee3904ddb2404c75580bf99d29ed28226ad2bd996f63c1793b3d7770ee7d772332f8
6
+ metadata.gz: 33d3c8869c4228aa4bfd05e2b488d1606110bd3db7634f995d978cc132b3189124b13c5d301064a1f8844e9243c12685183456d12e87bd335eec5da8ee1a7105
7
+ data.tar.gz: b75e6e463ed540df983fd10d655fa8bfeea7ad2072701c688b4278e224aa87fb74a1e242f2e87ff698a68f9a2393094ac7722620858862e434a4ae6ebb1d03dd
checksums.yaml.gz.sig CHANGED
@@ -1 +1,3 @@
1
- �U��I���gK����NC[=�r0��EtV�︱r������UnYUxEJde=+�����t�Osȍ!���_��u��\3���T��Z���.5��33�b�����,-1_ �R��= ,�=���� [�WYNvQA%�{��Ow<�p�����!(������E�^�k8�=�=�@ʩqs_R�#&�?�IVoJC=��*�}B�]���m�"���@tķ
1
+ ��IJ����'y���Q������2(`0m)h"�^A��lT�h��$!6��11RXp�^��_TV��V[g���.��:�cN���s 8�Mt#pEB�C}���}��Au J ez40�����*O6[ȍf9Z������o�n���eY�l]e�.���*=�E������p����
2
+ �nzSWo��
3
+ �'x�����r%�/�`"�5 �P0�s0v�#�
@@ -10,32 +10,13 @@ require 'drb_fileclient-readwrite'
10
10
  class DRbFileClient < DRbFileClientReadWrite
11
11
  using ColouredText
12
12
 
13
- def chdir(raw_path)
14
-
15
- return Dir.chdir raw_path unless @directory or raw_path =~ /^dfs:\/\//
16
-
17
- if raw_path[0] == '/' then
18
- directory = raw_path[1..-1]
19
- elsif raw_path =~ /^dfs:\/\//
20
- @file, directory = parse_path(raw_path)
21
- else
22
- directory = File.join(@directory, raw_path)
23
- end
24
-
25
- if @file.exists? directory then
26
- @directory = directory
27
- else
28
- 'No such file or directory'
29
- end
30
-
31
- end
32
13
 
33
14
  def chmod(permissions, raw_path)
34
15
 
35
16
  if raw_path =~ /^dfs:\/\// then
36
17
 
37
- @file, path = parse_path(raw_path)
38
- @file.chmod permissions, path
18
+ @@file, path = parse_path(raw_path)
19
+ @@file.chmod permissions, path
39
20
 
40
21
  else
41
22
  return FileUtils.chmod(permissions, raw_path)
@@ -56,26 +37,26 @@ class DRbFileClient < DRbFileClientReadWrite
56
37
  if raw_path[/^dfs:\/\/([^\/]+)/] == raw_path2[/^dfs:\/\/([^\/]+)/] then
57
38
 
58
39
  _, path = parse_path(raw_path)
59
- @file, path2 = parse_path(raw_path2)
60
- @file.cp path, path2
40
+ @@file, path2 = parse_path(raw_path2)
41
+ @@file.cp path, path2
61
42
 
62
43
  elsif raw_path2[/^dfs:\/\//]
63
44
 
64
- @file, path = parse_path(raw_path)
45
+ @@file, path = parse_path(raw_path)
65
46
  file2, path2 = parse_path(raw_path2)
66
47
  puts ('path: ' + path.inspect).debug if @debug
67
48
  puts ('path2: ' + path.inspect).debug if @debug
68
- content = @file.read path
49
+ content = @@file.read path
69
50
 
70
51
  file2.write path2, content
71
52
 
72
53
  else
73
54
 
74
- @file, path = parse_path(raw_path)
55
+ @@file, path = parse_path(raw_path)
75
56
  #file2, path2 = parse_path(raw_path2)
76
57
  puts ('path: ' + path.inspect).debug if @debug
77
58
  puts ('path2: ' + path2.inspect).debug if @debug
78
- content = @file.read path
59
+ content = @@file.read path
79
60
 
80
61
  File.write raw_path2, content
81
62
 
@@ -98,104 +79,83 @@ class DRbFileClient < DRbFileClientReadWrite
98
79
 
99
80
  end
100
81
 
101
- def directory?(filename=@filename)
102
-
103
- return File.directory? filename unless @directory or filename =~ /^dfs:\/\//
104
-
105
- if filename =~ /^dfs:\/\// then
106
- @file, filename2 = parse_path(filename)
107
- else
108
-
109
- filename2 = File.join(@directory, filename)
110
- end
111
-
112
- @file.directory?(filename2)
113
-
114
- end
115
-
116
82
  def ls(raw_path)
117
83
 
118
- return Dir[raw_path] unless @directory or raw_path =~ /^dfs:\/\//
84
+ return Dir[raw_path] unless @@directory or raw_path =~ /^dfs:\/\//
119
85
 
120
86
  if raw_path[0] == '/' then
121
87
  path = raw_path[1..-1]
122
88
  elsif raw_path =~ /^dfs:\/\//
123
- @file, path = parse_path(raw_path)
89
+ @@file, path = parse_path(raw_path)
124
90
  else
125
- path = File.join(@directory, raw_path)
91
+ path = File.join(@@directory, raw_path)
126
92
  end
127
93
 
128
- @file.ls path
94
+ @@file.ls path
129
95
 
130
96
  end
131
97
 
132
98
  def mv(raw_path, raw_path2)
133
99
 
134
- unless @directory or raw_path =~ /^dfs:\/\// then
100
+ unless @@directory or raw_path =~ /^dfs:\/\// then
135
101
  return FileUtils.mv raw_path, raw_path2
136
102
  end
137
103
 
138
104
  if raw_path =~ /^dfs:\/\// then
139
105
  _, path = parse_path(raw_path)
140
106
  else
141
- path = File.join(@directory, raw_path)
107
+ path = File.join(@@directory, raw_path)
142
108
  end
143
109
 
144
110
  if raw_path2 =~ /^dfs:\/\// then
145
111
  _, path2 = parse_path(raw_path2)
146
112
  else
147
- path2 = File.join(@directory, raw_path2)
113
+ path2 = File.join(@@directory, raw_path2)
148
114
  end
149
115
 
150
- @file.mv path, path2
116
+ @@file.mv path, path2
151
117
  end
152
118
 
153
- def pwd()
154
119
 
155
- return Dir.pwd unless @directory
156
-
157
- '/' + @directory if @file
158
-
159
- end
160
120
 
161
121
  def ru(path)
162
122
 
163
- return DirToXML.new(path, verbose: false).latest unless @directory \
123
+ return DirToXML.new(path, verbose: false).latest unless @@directory \
164
124
  or path =~ /^dfs:\/\//
165
125
 
166
126
  if path =~ /^dfs:\/\// then
167
- @file, path2, addr = parse_path(path)
127
+ @@file, path2, addr = parse_path(path)
168
128
  else
169
- path2 = File.join(@directory, path)
129
+ path2 = File.join(@@directory, path)
170
130
  end
171
131
 
172
- found = @file.ru path2
132
+ found = @@file.ru path2
173
133
  return (addr + found) if found and addr
174
134
 
175
135
  end
176
136
 
177
137
  def ru_r(path)
178
138
 
179
- unless @directory or path =~ /^dfs:\/\// then
139
+ unless @@directory or path =~ /^dfs:\/\// then
180
140
  return DirToXML.new(path, recursive: true, verbose: false).latest
181
141
  end
182
142
 
183
143
  if path =~ /^dfs:\/\// then
184
- @file, path2, addr = parse_path(path)
144
+ @@file, path2, addr = parse_path(path)
185
145
  else
186
- path2 = File.join(@directory, path)
146
+ path2 = File.join(@@directory, path)
187
147
  end
188
148
 
189
- found = @file.ru_r path2
149
+ found = @@file.ru_r path2
190
150
  return (addr + found) if found and addr
191
151
 
192
152
  end
193
153
 
194
154
  def zip(filename_zip, a)
195
155
 
196
- puts '@directory: ' + @directory.inspect if @debug
156
+ puts '@@directory: ' + @@directory.inspect if @debug
197
157
 
198
- unless @directory or filename_zip =~ /^dfs:\/\// then
158
+ unless @@directory or filename_zip =~ /^dfs:\/\// then
199
159
 
200
160
  Zip::File.open(zipfile_zip, Zip::File::CREATE) do |x|
201
161
 
@@ -208,45 +168,42 @@ class DRbFileClient < DRbFileClientReadWrite
208
168
  end
209
169
 
210
170
  if filename_zip =~ /^dfs:\/\// then
211
- @file, filepath = parse_path(filename_zip)
171
+ @@file, filepath = parse_path(filename_zip)
212
172
  else
213
- filepath = File.join(@directory, filename_zip)
173
+ filepath = File.join(@@directory, filename_zip)
214
174
  end
215
175
 
216
- @file.zip filepath, a
176
+ @@file.zip filepath, a
217
177
 
218
178
  end
219
179
 
220
180
  end
221
181
 
222
182
 
223
- def DfsFile.directory?(filename)
224
- DRbFileClient.new.directory?(filename)
225
- end
226
- def DfsFile.chdir(path)
227
- DRbFileClient.new.chdir(path)
228
- end
229
183
  def DfsFile.chmod(num, filename)
230
184
  DRbFileClient.new.chmod(num, filename)
231
185
  end
186
+
232
187
  def DfsFile.cp(path, path2)
233
188
  DRbFileClient.new.cp(path, path2)
234
189
  end
190
+
235
191
  def DfsFile.ls(path)
236
192
  DRbFileClient.new.ls(path)
237
193
  end
194
+
238
195
  def DfsFile.mv(path, path2)
239
196
  DRbFileClient.new.mv(path, path2)
240
197
  end
241
- def DfsFile.pwd()
242
- DRbFileClient.new.pwd()
243
- end
198
+
244
199
  def DfsFile.ru(path)
245
200
  DRbFileClient.new.ru(path)
246
201
  end
202
+
247
203
  def DfsFile.ru_r(path)
248
204
  DRbFileClient.new.ru_r(path)
249
205
  end
206
+
250
207
  def DfsFile.zip(filename, a)
251
208
  DRbFileClient.new.zip(filename, a)
252
209
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drb_fileclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  FGcgjmmz5fOIqq2sBxk6JW1yo2G43yIUzymWOYKT2Jh6RR0Gg3z66wWwYpFpx8yR
36
36
  00JTBNVAgW+s2sLpeBtyMDbb
37
37
  -----END CERTIFICATE-----
38
- date: 2022-02-22 00:00:00.000000000 Z
38
+ date: 2022-02-23 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: zip
@@ -86,7 +86,7 @@ dependencies:
86
86
  version: '0.1'
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.1.0
89
+ version: 0.1.5
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
@@ -96,7 +96,7 @@ dependencies:
96
96
  version: '0.1'
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
- version: 0.1.0
99
+ version: 0.1.5
100
100
  description:
101
101
  email: digital.robertson@gmail.com
102
102
  executables: []
metadata.gz.sig CHANGED
Binary file