drb_fileserver_plus 0.2.1 → 0.2.2
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 +2 -3
- data/lib/drb_fileserver_plus.rb +66 -24
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: 17d1dddceaf3c825e2da89a9a9dc96ac2d86fab7839d44a544af74db8a7581f2
|
4
|
+
data.tar.gz: f9d8147a5c84c69427292c23d4dece3fb0902da8d7d2ae1c4abba65e4df6793b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28f129af88a0a6c18c87758830a6e92ae33a707ac7f24c91fb90e4fef6ffdba9ce3da22bce4cb7a05bd11c7233835599f543dfa84a96dd0bca53aefb0e8653cb
|
7
|
+
data.tar.gz: f1bfc398a716f146db25d51d8355627f79d549899370e87b47368a5ca601883806b1065fc3799c86ba1a36bdd2d3b8ca180ed4d7cd37da0b15e3af4c90b6beb0
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
�
|
3
|
-
�0�)����ʍ��v�:`����i��S:���2N%dT�����u8k�Ay�Jl}�̕�#Dzb�It����1}�P��8v�H�
|
1
|
+
:��|�+��Gx�u����ڗw��Ɣ|��7@�Pѳ9
|
2
|
+
}�e%���ŧ\�#�� 1���� ��\xS�<��HI�Y�6�7ڜ>�G%��6�%���6/&N`Ս�����̬Y�yT��g�G����vp&���_�5zŬ�����È�d�؍y�`F W��&s/?�z\���E�,��)����%�mf4Z��/�ۖ��<�x�h�u�h�S?�lr���D��vt
|
data/lib/drb_fileserver_plus.rb
CHANGED
@@ -10,105 +10,147 @@ require 'drb_fileclient'
|
|
10
10
|
|
11
11
|
|
12
12
|
class DRbFileServer
|
13
|
+
|
14
|
+
attr_accessor :nodes
|
13
15
|
|
14
16
|
def initialize(nodes, sps: nil, topic: 'file')
|
15
17
|
|
16
|
-
@nodes = nodes
|
18
|
+
@nodes = nodes
|
17
19
|
@failcount = 0
|
18
20
|
@sps, @topic = sps, topic
|
19
21
|
|
20
22
|
end
|
21
23
|
|
22
24
|
def cp(path, path2)
|
25
|
+
|
26
|
+
node = ''
|
23
27
|
|
24
28
|
file_op do |f|
|
25
|
-
|
29
|
+
node = 'dfs://' + @nodes.first
|
30
|
+
f.cp File.join(node, path), File.join(node, path2)
|
26
31
|
end
|
27
32
|
|
28
33
|
if @sps then
|
29
|
-
@sps.notice "%s/copy: %s %s" % [@topic, File.join(
|
30
|
-
File.join(
|
34
|
+
@sps.notice "%s/copy: %s %s" % [@topic, File.join(node, path),
|
35
|
+
File.join(node, path2)]
|
31
36
|
end
|
32
37
|
|
33
38
|
end
|
34
39
|
|
35
40
|
def exists?(fname)
|
36
|
-
|
37
|
-
file_op
|
41
|
+
|
42
|
+
file_op do |f|
|
43
|
+
node = 'dfs://' + @nodes.first
|
44
|
+
f.exists? File.join(node, fname)
|
45
|
+
end
|
38
46
|
|
39
47
|
end
|
40
48
|
|
41
49
|
def ls(path)
|
42
|
-
|
43
|
-
file_op
|
50
|
+
|
51
|
+
file_op do |f|
|
52
|
+
node = 'dfs://' + @nodes.first
|
53
|
+
f.ls File.join(node, path)
|
54
|
+
end
|
44
55
|
|
45
56
|
end
|
46
57
|
|
47
58
|
def mkdir(path)
|
48
59
|
|
49
|
-
|
60
|
+
node = ''
|
61
|
+
|
62
|
+
file_op do |f|
|
63
|
+
node = 'dfs://' + @nodes.first
|
64
|
+
f.mkdir File.join(node, path)
|
65
|
+
end
|
50
66
|
|
51
67
|
if @sps then
|
52
|
-
@sps.notice "%s/mkdir: %s" % [@topic, File.join(
|
68
|
+
@sps.notice "%s/mkdir: %s" % [@topic, File.join(node, path)]
|
53
69
|
end
|
54
70
|
|
55
71
|
end
|
56
72
|
|
57
73
|
def mkdir_p(path)
|
58
74
|
|
59
|
-
|
75
|
+
node = ''
|
76
|
+
|
77
|
+
file_op do |f|
|
78
|
+
node = 'dfs://' + @nodes.first
|
79
|
+
f.mkdir_p File.join(node, path)
|
80
|
+
end
|
60
81
|
|
61
82
|
if @sps then
|
62
|
-
@sps.notice "%s/mkdir_p: %s" % [@topic, File.join(
|
83
|
+
@sps.notice "%s/mkdir_p: %s" % [@topic, File.join(node, path)]
|
63
84
|
end
|
64
85
|
|
65
86
|
end
|
66
87
|
|
67
88
|
def mv(path, path2)
|
68
89
|
|
90
|
+
node = ''
|
91
|
+
|
69
92
|
file_op do |f|
|
70
|
-
|
93
|
+
node = 'dfs://' + @nodes.first
|
94
|
+
f.mv File.join(node, path), File.join(node, path2)
|
71
95
|
end
|
72
96
|
|
73
97
|
if @sps then
|
74
|
-
@sps.notice "%s/mv: %s %s" % [@topic, File.join(
|
75
|
-
File.join(
|
98
|
+
@sps.notice "%s/mv: %s %s" % [@topic, File.join(node, path),
|
99
|
+
File.join(node, path2)]
|
76
100
|
end
|
77
101
|
|
78
102
|
end
|
79
103
|
|
80
104
|
def read(fname)
|
81
|
-
|
82
|
-
file_op
|
105
|
+
|
106
|
+
file_op do |f|
|
107
|
+
node = 'dfs://' + @nodes.first
|
108
|
+
f.read File.join(node, fname)
|
109
|
+
end
|
83
110
|
|
84
111
|
end
|
85
112
|
|
86
113
|
def rm(fname)
|
87
114
|
|
88
|
-
|
115
|
+
node = ''
|
116
|
+
|
117
|
+
file_op do |f|
|
118
|
+
node = 'dfs://' + @nodes.first
|
119
|
+
f.rm File.join(node, fname)
|
120
|
+
end
|
89
121
|
|
90
122
|
if @sps then
|
91
|
-
@sps.notice "%s/rm: %s" % [@topic, File.join(
|
123
|
+
@sps.notice "%s/rm: %s" % [@topic, File.join(node, fname)]
|
92
124
|
end
|
93
125
|
|
94
126
|
end
|
95
127
|
|
96
128
|
def write(fname, content)
|
97
129
|
|
98
|
-
|
130
|
+
node = ''
|
131
|
+
|
132
|
+
file_op do |f|
|
133
|
+
node = 'dfs://' + @nodes.first
|
134
|
+
f.write File.join(node, fname), content
|
135
|
+
end
|
99
136
|
|
100
137
|
if @sps then
|
101
|
-
@sps.notice("%s/write: %s" % [@topic, File.join(
|
138
|
+
@sps.notice("%s/write: %s" % [@topic, File.join(node, fname)])
|
102
139
|
end
|
103
140
|
|
104
141
|
end
|
105
142
|
|
106
143
|
def zip(fname, a)
|
107
|
-
|
108
|
-
|
144
|
+
|
145
|
+
node = ''
|
146
|
+
|
147
|
+
file_op do |f|
|
148
|
+
node = 'dfs://' + @nodes.first
|
149
|
+
f.zip File.join(node, fname), a
|
150
|
+
end
|
109
151
|
|
110
152
|
if @sps then
|
111
|
-
@sps.notice "%s/zip: %s" % [@topic, File.join(
|
153
|
+
@sps.notice "%s/zip: %s" % [@topic, File.join(node, fname)]
|
112
154
|
end
|
113
155
|
|
114
156
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drb_fileserver_plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
IzajbtHbQOY56M17vmJw7Y9ei8bGWzjVxfRUg33mVpGQQIWHA2JpaJ8+jpwrxdbF
|
36
36
|
DfzPJWgIRbTOgE4v1XGQcqsO
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2018-08-
|
38
|
+
date: 2018-08-24 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: drb_fileclient
|
metadata.gz.sig
CHANGED
Binary file
|