drb_fileclient-readwrite 0.1.5 → 0.1.8

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: 81c907cd7a0b84106eb65ed0c0cffec5529c5842f000995c8d5504d13db63bc2
4
- data.tar.gz: e44fec001e94b68e73a9569ecde44fedff79542674ee73769bec909162dadf47
3
+ metadata.gz: 11f863ffc1e5882397908738f13dcf6b4bbe6f14ef16480393412c40c35f2249
4
+ data.tar.gz: 5360addc8ee8e86209eaa8fb5afe091b43d8aea9c144c09a93353b64999add3c
5
5
  SHA512:
6
- metadata.gz: 90a356f7fecd376992afdf45d49ce2c041913970add9f90f5f16b1065d47c94f42dde9e8c75429eef30edc3f2fa660f178582f4cc84b5b98b0bdd436c74b44cf
7
- data.tar.gz: ceaf0b22f952a19aed844ba7000533406bc8842fe7ea4524b84ee55a226dbb0e88e114fa008b6c0a9b180581cbc16f56f5c0abf850cdee846cac7cccf2bf900d
6
+ metadata.gz: 5be78797ca064ded5e1b359ac679d01d8036fdcc308b7c1af03d12d74fdc28560a68da3a64997d0aca1e832ecf0ff4e8f7fa3b11d35f3e55cd2653b358c1df0d
7
+ data.tar.gz: ac703e2321fe21d8969e6c9e4d940f87778147254a482f46be64ee0d0fe7fef65b4a7cf9e7a163a5ce6fe8238d5ef0379815a50b50ae0a9e33534cf1fe35dfb7
checksums.yaml.gz.sig CHANGED
Binary file
@@ -11,24 +11,23 @@ class DRbFileClientReadWrite < DRbFileClientReader
11
11
  def initialize()
12
12
  @@directory ||= nil
13
13
  @@file ||= nil
14
+ @@uri_prefix ||= nil
14
15
  end
15
16
 
16
17
  def chdir(raw_path)
17
- puts 'inside chdir: ' + raw_path
18
18
 
19
19
  return Dir.chdir raw_path unless @@directory or raw_path =~ /^dfs:\/\//
20
20
 
21
21
  if raw_path[0] == '/' then
22
22
  directory = raw_path[1..-1]
23
23
  elsif raw_path =~ /^dfs:\/\//
24
- @@file, directory = parse_path(raw_path)
24
+ @@file, directory, @@uri_prefix = parse_path(raw_path)
25
25
  else
26
26
  directory = File.join(@@directory, raw_path)
27
27
  end
28
28
 
29
- if @@file.exists? directory then
29
+ if @@file.exist? directory then
30
30
  @@directory = directory
31
- puts '@@directory:' + @@directory.inspect
32
31
  else
33
32
  'No such file or directory'
34
33
  end
@@ -61,27 +60,49 @@ class DRbFileClientReadWrite < DRbFileClientReader
61
60
  @@file.glob s2
62
61
 
63
62
  end
63
+
64
+ def mkdir(raw_path)
65
+
66
+ unless @@directory or raw_path =~ /^dfs:\/\// then
67
+ return FileUtils.mkdir raw_path
68
+ end
69
+
70
+ if raw_path =~ /^dfs:\/\// then
71
+ @@file, filepath = parse_path(raw_path)
72
+ else
64
73
 
65
- def mkdir(name)
74
+ if @@uri_prefix then
75
+ @@file, filepath = parse_path(File.join(@@uri_prefix, @@directory,
76
+ raw_path))
77
+ else
78
+ filepath = File.join(@@directory, raw_path)
79
+ end
66
80
 
67
- return FileUtils.mkdir name unless @@directory or name =~ /^dfs:\/\//
81
+ end
68
82
 
69
- @@file, path = parse_path(name)
70
- @@file.mkdir path
83
+ @@file.mkdir filepath
71
84
  end
72
-
85
+
73
86
  def mkdir_p(raw_path)
74
-
87
+
75
88
  unless @@directory or raw_path =~ /^dfs:\/\// then
76
- return FileUtils.mkdir_p raw_path
77
- end
78
-
89
+ return FileUtils.mkdir_p raw_path
90
+ end
91
+
79
92
  if raw_path =~ /^dfs:\/\// then
80
93
  @@file, filepath = parse_path(raw_path)
81
94
  else
82
- filepath = File.join(@@directory, raw_path)
83
- end
84
95
 
96
+ if @@uri_prefix then
97
+ @@file, filepath = parse_path(File.join(@@uri_prefix, @@directory,
98
+ raw_path))
99
+ else
100
+ filepath = File.join(@@directory, raw_path)
101
+ end
102
+
103
+ end
104
+
105
+ puts 'drb_fileclient-readwrite inside mkdir_p: ' + filepath.inspect
85
106
  @@file.mkdir_p filepath
86
107
  end
87
108
 
@@ -96,20 +117,20 @@ class DRbFileClientReadWrite < DRbFileClientReader
96
117
  '/' + @@directory if @@file
97
118
 
98
119
  end
99
-
120
+
100
121
  def rm(path)
101
-
122
+
102
123
  return FileUtils.rm path unless @@directory or path =~ /^dfs:\/\//
103
-
124
+
104
125
  if path =~ /^dfs:\/\// then
105
126
  @@file, path2 = parse_path( path)
106
127
  else
107
128
  path2 = File.join(@@directory, path)
108
129
  end
109
-
130
+
110
131
  @@file.rm path2
111
-
112
- end
132
+
133
+ end
113
134
 
114
135
  def rm_r(path, force: false)
115
136
 
@@ -142,31 +163,31 @@ class DRbFileClientReadWrite < DRbFileClientReader
142
163
  @@file.touch s2, mtime: mtime
143
164
 
144
165
  end
145
-
166
+
146
167
  def write(filename=@@filename, s)
147
-
168
+
148
169
  return File.write filename, s unless @@directory or filename =~ /^dfs:\/\//
149
-
170
+
150
171
  if filename =~ /^dfs:\/\// then
151
172
  @@file, path = parse_path(filename)
152
173
  else
153
174
  path = File.join(@@directory, filename)
154
175
  end
155
-
176
+
156
177
  @@file.write path, s
157
-
178
+
158
179
  end
159
180
 
160
- end
181
+ end
161
182
 
162
183
  def DfsFile.chdir(path)
163
184
  DRbFileClientReadWrite.new.chdir(path)
164
185
  end
165
186
 
166
187
  def DfsFile.directory?(filename)
167
- DRbFileClient.new.directory?(filename)
188
+ DRbFileClientReadWrite.new.directory?(filename)
168
189
  end
169
-
190
+
170
191
  def DfsFile.glob(s)
171
192
  DRbFileClientReadWrite.new.glob(s)
172
193
  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-readwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  ILzVBTpjvSiaWCjFvxvVJFct97WGSbaR2jPvZ03xyAONtWdKkv2yceiyfAMaldSQ
36
36
  eftJvciSPh0DHzyI46OGIkLX
37
37
  -----END CERTIFICATE-----
38
- date: 2022-02-23 00:00:00.000000000 Z
38
+ date: 2023-01-25 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: drb_fileclient-reader
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '0.1'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.1.1
49
+ version: 0.1.6
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.1'
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 0.1.1
59
+ version: 0.1.6
60
60
  description:
61
61
  email: digital.robertson@gmail.com
62
62
  executables: []
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.2.22
86
+ rubygems_version: 3.4.4
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: A DRb file reader and writer client to access the DRb_fileserver service.
metadata.gz.sig CHANGED
Binary file