drb_fileserver_plus 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/drb_fileserver_plus.rb +55 -3
- 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: e9547063824d71ebd77c11e75ee30b9f65834d18b5db3d91ce9580526d7cd69d
|
4
|
+
data.tar.gz: 6dadec10fbbba36cb1beb6249eca1df4762b677f0d9ba83b83de9bf3d40d46be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d44933c4280f74e469f29d33449e7f5c37d05c2f53cb8887630c6aa593af5e7dbdd82faf5319d0719e498d3da1832b6e4ebd503030bfa790d28a3cf3194a0ad1
|
7
|
+
data.tar.gz: 0360aa78c5b539fac87e93754bcac61b4767791551f2f26415dbac282b9dab4e7325370d3094d0c4e1d57bdd6654e27c7f7197281f7ae034fcda9487a21b3659
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/drb_fileserver_plus.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
# file: drb_fileserver_plus.rb
|
4
4
|
|
5
|
-
# description: Designed to provide fault tolerant access to a DRb file
|
6
|
-
#
|
5
|
+
# description: Designed to provide fault tolerant access to a DRb file server
|
6
|
+
# when 2 or more back-end nodes are running.
|
7
7
|
|
8
8
|
require 'drb_fileclient'
|
9
9
|
|
@@ -14,18 +14,71 @@ class DRbFileServer
|
|
14
14
|
@nodes = nodes.map {|x| 'dfs://' + x}
|
15
15
|
@failcount = 0
|
16
16
|
end
|
17
|
+
|
18
|
+
def cp(path, path2)
|
17
19
|
|
20
|
+
file_op do |f|
|
21
|
+
f.cp File.join(@nodes.first, path), File.join(@nodes.first, path2)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
def exists?(fname)
|
27
|
+
|
28
|
+
file_op {|f| f.exists? File.join(@nodes.first, fname) }
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
def ls(path)
|
33
|
+
|
34
|
+
file_op {|f| f.ls File.join(@nodes.first, path) }
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
def mkdir(path)
|
39
|
+
|
40
|
+
file_op {|f| f.mkdir File.join(@nodes.first, path) }
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
def mkdir_p(path)
|
45
|
+
|
46
|
+
file_op {|f| f.mkdir_p File.join(@nodes.first, path) }
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
def mv(path, path2)
|
51
|
+
|
52
|
+
file_op do |f|
|
53
|
+
f.mv File.join(@nodes.first, path), File.join(@nodes.first, path2)
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
18
58
|
def read(fname)
|
19
59
|
|
20
60
|
file_op {|f| f.read File.join(@nodes.first, fname) }
|
21
61
|
|
22
62
|
end
|
63
|
+
|
64
|
+
def rm(fname)
|
65
|
+
|
66
|
+
file_op {|f| f.rm File.join(@nodes.first, fname) }
|
67
|
+
|
68
|
+
end
|
23
69
|
|
24
70
|
def write(fname, content)
|
25
71
|
|
26
72
|
file_op {|f| f.write File.join(@nodes.first, fname), content }
|
27
73
|
|
28
74
|
end
|
75
|
+
|
76
|
+
def zip(fname, a)
|
77
|
+
|
78
|
+
file_op {|f| f.zip File.join(@nodes.first, fname), a }
|
79
|
+
|
80
|
+
end
|
81
|
+
|
29
82
|
|
30
83
|
private
|
31
84
|
|
@@ -64,4 +117,3 @@ class DRbFileServerPlus
|
|
64
117
|
end
|
65
118
|
|
66
119
|
end
|
67
|
-
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|