drb_fileclient-readwrite 0.1.4 → 0.1.5

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: 2aa95efb66b79c7c03e7d300fb89ef8847f6faf08635780d5eaa7492eed9b89a
4
- data.tar.gz: c6b05ab0657e3479a42b4fac490ccfd0de858a46aba1beecd0fd05a8e495f5e8
3
+ metadata.gz: 81c907cd7a0b84106eb65ed0c0cffec5529c5842f000995c8d5504d13db63bc2
4
+ data.tar.gz: e44fec001e94b68e73a9569ecde44fedff79542674ee73769bec909162dadf47
5
5
  SHA512:
6
- metadata.gz: 03f835196a52e120fed9f724df14df839a7182434b4ffb27b58b18e8d1f19deb1e884c8ef7b4012c38349f09566789fad12a0153bdbcc30c13ae5ffcbfb79447
7
- data.tar.gz: 376b3abb7b233700fec31e7cf0f64aaab7f89f60acd2dc271fd5b8e5d4c427ea51b90258f711edb89eaa81ba11c7e31a75bca7468f0fd971185e17f679468e09
6
+ metadata.gz: 90a356f7fecd376992afdf45d49ce2c041913970add9f90f5f16b1065d47c94f42dde9e8c75429eef30edc3f2fa660f178582f4cc84b5b98b0bdd436c74b44cf
7
+ data.tar.gz: ceaf0b22f952a19aed844ba7000533406bc8842fe7ea4524b84ee55a226dbb0e88e114fa008b6c0a9b180581cbc16f56f5c0abf850cdee846cac7cccf2bf900d
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- ���R��æ҇���H�x�B�5rB����KL���?Z�����B;�<��(V�D����Â�����Ӏ�h����RX"��~��,���(�����<rf�>�XQyU$cs�!�D ��G�ٴ�jm���*� ��2! l�H���X �V�� j���Ӈ������DЊJ��hw��Zs��%j������p9�
2
- ������q�§������E���͛P�0Wf��t�h�D >���U��b����J�0@k������G۩����+N>]O5܀�� o�F�f0�(H��5f��^"��к��jP�j<�'n��A�_0�I��o~ q��{0��l�.]�M��ab�}״��wM�b�'8�8�>M4N[+���L
1
+ �L��,|�?
2
+ ���C�� ��
3
+ ��<7]~큀m�d/N���Ƿ+�H���؝_�@�åO��z�y�BZ&��#��S���lŽ5%A��]1�B~#d���}, ��riX����F���b�\�9*�|��Q)%�ܨG��?���~�_�A�6�f=�L�v1����&?�o��F�����no��,(+C1W�&|����L�Lmj���ok|�ױ��Y�RߗHQ
@@ -8,141 +8,152 @@ require 'drb_fileclient-reader'
8
8
  class DRbFileClientReadWrite < DRbFileClientReader
9
9
  using ColouredText
10
10
 
11
+ def initialize()
12
+ @@directory ||= nil
13
+ @@file ||= nil
14
+ end
15
+
11
16
  def chdir(raw_path)
17
+ puts 'inside chdir: ' + raw_path
12
18
 
13
- return Dir.chdir raw_path unless @directory or raw_path =~ /^dfs:\/\//
19
+ return Dir.chdir raw_path unless @@directory or raw_path =~ /^dfs:\/\//
14
20
 
15
21
  if raw_path[0] == '/' then
16
22
  directory = raw_path[1..-1]
17
23
  elsif raw_path =~ /^dfs:\/\//
18
- @file, directory = parse_path(raw_path)
24
+ @@file, directory = parse_path(raw_path)
19
25
  else
20
- directory = File.join(@directory, raw_path)
26
+ directory = File.join(@@directory, raw_path)
21
27
  end
22
28
 
23
- if @file.exists? directory then
24
- @directory = directory
29
+ if @@file.exists? directory then
30
+ @@directory = directory
31
+ puts '@@directory:' + @@directory.inspect
25
32
  else
26
33
  'No such file or directory'
27
34
  end
28
35
 
29
36
  end
30
37
 
31
- def directory?(filename=@filename)
38
+ def directory?(filename=@@filename)
32
39
 
33
- return File.directory? filename unless @directory or filename =~ /^dfs:\/\//
40
+ return File.directory? filename unless @@directory or filename =~ /^dfs:\/\//
34
41
 
35
42
  if filename =~ /^dfs:\/\// then
36
- @file, filename2 = parse_path(filename)
43
+ @@file, filename2 = parse_path(filename)
37
44
  else
38
45
 
39
- filename2 = File.join(@directory, filename)
46
+ filename2 = File.join(@@directory, filename)
40
47
  end
41
48
 
42
- @file.directory?(filename2)
49
+ @@file.directory?(filename2)
43
50
 
44
51
  end
45
52
 
46
53
  def glob(s)
47
54
 
48
55
  if s =~ /^dfs:\/\// then
49
- @file, s2 = parse_path(s)
56
+ @@file, s2 = parse_path(s)
50
57
  else
51
- s2 = File.join(@directory, s)
58
+ s2 = File.join(@@directory, s)
52
59
  end
53
60
 
54
- @file.glob s2
61
+ @@file.glob s2
55
62
 
56
63
  end
57
64
 
58
65
  def mkdir(name)
59
66
 
60
- return FileUtils.mkdir name unless @directory or name =~ /^dfs:\/\//
67
+ return FileUtils.mkdir name unless @@directory or name =~ /^dfs:\/\//
61
68
 
62
- @file, path = parse_path(name)
63
- @file.mkdir path
69
+ @@file, path = parse_path(name)
70
+ @@file.mkdir path
64
71
  end
65
72
 
66
73
  def mkdir_p(raw_path)
67
74
 
68
- unless @directory or raw_path =~ /^dfs:\/\// then
75
+ unless @@directory or raw_path =~ /^dfs:\/\// then
69
76
  return FileUtils.mkdir_p raw_path
70
77
  end
71
78
 
72
79
  if raw_path =~ /^dfs:\/\// then
73
- @file, filepath = parse_path(raw_path)
80
+ @@file, filepath = parse_path(raw_path)
74
81
  else
75
- filepath = File.join(@directory, raw_path)
82
+ filepath = File.join(@@directory, raw_path)
76
83
  end
77
84
 
78
- @file.mkdir_p filepath
85
+ @@file.mkdir_p filepath
79
86
  end
80
87
 
81
88
  def pwd()
82
89
 
83
- return Dir.pwd unless @directory
90
+ puts 'inside pwd'
91
+ puts '@@directory: ' + @@directory.inspect
92
+ puts '@@file: ' + @@file.inspect
93
+
94
+ return Dir.pwd unless @@directory
84
95
 
85
- '/' + @directory if @file
96
+ '/' + @@directory if @@file
86
97
 
87
98
  end
88
99
 
89
100
  def rm(path)
90
101
 
91
- return FileUtils.rm path unless @directory or path =~ /^dfs:\/\//
102
+ return FileUtils.rm path unless @@directory or path =~ /^dfs:\/\//
92
103
 
93
104
  if path =~ /^dfs:\/\// then
94
- @file, path2 = parse_path( path)
105
+ @@file, path2 = parse_path( path)
95
106
  else
96
- path2 = File.join(@directory, path)
107
+ path2 = File.join(@@directory, path)
97
108
  end
98
109
 
99
- @file.rm path2
110
+ @@file.rm path2
100
111
 
101
112
  end
102
113
 
103
114
  def rm_r(path, force: false)
104
115
 
105
- unless @directory or path =~ /^dfs:\/\// then
116
+ unless @@directory or path =~ /^dfs:\/\// then
106
117
  return FileUtils.rm_r(path, force: force)
107
118
  end
108
119
 
109
120
  if path =~ /^dfs:\/\// then
110
- @file, path2 = parse_path( path)
121
+ @@file, path2 = parse_path( path)
111
122
  else
112
- path2 = File.join(@directory, path)
123
+ path2 = File.join(@@directory, path)
113
124
  end
114
125
 
115
- @file.rm_r(path2, force: force)
126
+ @@file.rm_r(path2, force: force)
116
127
 
117
128
  end
118
129
 
119
130
  def touch(s, mtime: Time.now)
120
131
 
121
- unless @directory or s =~ /^dfs:\/\// then
132
+ unless @@directory or s =~ /^dfs:\/\// then
122
133
  return FileUtils.touch(s, mtime: mtime)
123
134
  end
124
135
 
125
136
  if s =~ /^dfs:\/\// then
126
- @file, s2 = parse_path(s)
137
+ @@file, s2 = parse_path(s)
127
138
  else
128
- s2 = File.join(@directory, s)
139
+ s2 = File.join(@@directory, s)
129
140
  end
130
141
 
131
- @file.touch s2, mtime: mtime
142
+ @@file.touch s2, mtime: mtime
132
143
 
133
144
  end
134
145
 
135
- def write(filename=@filename, s)
146
+ def write(filename=@@filename, s)
136
147
 
137
- return File.write filename, s unless @directory or filename =~ /^dfs:\/\//
148
+ return File.write filename, s unless @@directory or filename =~ /^dfs:\/\//
138
149
 
139
150
  if filename =~ /^dfs:\/\// then
140
- @file, path = parse_path(filename)
151
+ @@file, path = parse_path(filename)
141
152
  else
142
- path = File.join(@directory, filename)
153
+ path = File.join(@@directory, filename)
143
154
  end
144
155
 
145
- @file.write path, s
156
+ @@file.write path, s
146
157
 
147
158
  end
148
159
 
@@ -169,7 +180,7 @@ def DfsFile.mkdir_p(filename)
169
180
  end
170
181
 
171
182
  def DfsFile.pwd()
172
- DRbFileClient.new.pwd()
183
+ DRbFileClientReadWrite.new.pwd()
173
184
  end
174
185
 
175
186
  def DfsFile.rm(filename)
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.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '0.1'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.1.0
49
+ version: 0.1.1
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.0
59
+ version: 0.1.1
60
60
  description:
61
61
  email: digital.robertson@gmail.com
62
62
  executables: []
metadata.gz.sig CHANGED
Binary file