drb_fileclient 0.2.2 → 0.2.3
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_fileclient.rb +48 -30
- 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: ea9cc771c048915a82829d8345a4cdae23b9f2aab572a874f324b3d8d69bde09
|
4
|
+
data.tar.gz: 1f52d8f7bdbfe796c83ecc876967e3037c2727312f9deb55f55d28e428281f22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dec077dc8a983eae80ac378dfc8676d5d06cda7885894e9babc852f4a37af3c3bf5e7c24f87a85b67dc8e81b5591ed3270c2f18d3ef87aed8492124580c645b4
|
7
|
+
data.tar.gz: 59b140c1071ae5bb3a930580e8446e468b1f562dd604d5d40ca9d5278b519205e3a85daf92f73f6d5868b88cfd2274c156cab36f6f7a961ae58ce3a918a60626
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/drb_fileclient.rb
CHANGED
@@ -37,17 +37,29 @@ class DRbFileClient
|
|
37
37
|
'No such file or directory'
|
38
38
|
end
|
39
39
|
|
40
|
-
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def cp(raw_path, raw_path2)
|
43
|
+
|
44
|
+
path, path2 = if raw_path =~ /^dfs:\/\// then
|
45
|
+
[parse_path(raw_path), parse_path(raw_path2)]
|
46
|
+
else
|
47
|
+
[File.join(@directory, raw_path), File.join(@directory, raw_path2)]
|
48
|
+
end
|
49
|
+
|
50
|
+
@file.cp path, path2
|
51
|
+
end
|
41
52
|
|
42
53
|
def exists?(filename=@filename)
|
43
54
|
|
44
55
|
filename2 = if filename =~ /^dfs:\/\// then
|
45
56
|
parse_path(filename)
|
46
57
|
else
|
47
|
-
|
58
|
+
|
59
|
+
File.join(@directory, filename)
|
48
60
|
end
|
49
61
|
|
50
|
-
@file.exists?(
|
62
|
+
@file.exists?(filename2) if @directory
|
51
63
|
|
52
64
|
end
|
53
65
|
|
@@ -61,6 +73,17 @@ class DRbFileClient
|
|
61
73
|
@file.mkdir_p path
|
62
74
|
end
|
63
75
|
|
76
|
+
def mv(raw_path, raw_path2)
|
77
|
+
|
78
|
+
path, path2 = if raw_path =~ /^dfs:\/\// then
|
79
|
+
[parse_path(raw_path), parse_path(raw_path2)]
|
80
|
+
else
|
81
|
+
[File.join(@directory, raw_path), File.join(@directory, raw_path2)]
|
82
|
+
end
|
83
|
+
|
84
|
+
@file.mv path, path2
|
85
|
+
end
|
86
|
+
|
64
87
|
def pwd()
|
65
88
|
|
66
89
|
'/' + @directory if @file
|
@@ -78,6 +101,18 @@ class DRbFileClient
|
|
78
101
|
@file.read path
|
79
102
|
end
|
80
103
|
|
104
|
+
def rm(path)
|
105
|
+
|
106
|
+
path2 = if path =~ /^dfs:\/\// then
|
107
|
+
parse_path( path)
|
108
|
+
else
|
109
|
+
File.join(@directory, path)
|
110
|
+
end
|
111
|
+
|
112
|
+
@file.rm path2
|
113
|
+
|
114
|
+
end
|
115
|
+
|
81
116
|
def write(filename=@filename, s)
|
82
117
|
|
83
118
|
path = if filename =~ /^dfs:\/\// then
|
@@ -108,32 +143,15 @@ class DfsFile
|
|
108
143
|
|
109
144
|
@client = DRbFileClient.new
|
110
145
|
|
111
|
-
def self.exists?(filename)
|
112
|
-
|
113
|
-
end
|
114
|
-
|
115
|
-
def self.
|
116
|
-
@client.
|
117
|
-
end
|
118
|
-
|
119
|
-
def self.
|
120
|
-
|
121
|
-
end
|
122
|
-
|
123
|
-
def self.mkdir_p(path)
|
124
|
-
@client.mkdir_p(path)
|
125
|
-
end
|
126
|
-
|
127
|
-
def self.pwd()
|
128
|
-
@client.pwd()
|
129
|
-
end
|
130
|
-
|
131
|
-
def self.read(filename)
|
132
|
-
@client.read(filename)
|
133
|
-
end
|
134
|
-
|
135
|
-
def self.write(filename, s)
|
136
|
-
@client.write(filename, s)
|
137
|
-
end
|
146
|
+
def self.exists?(filename) @client.exists?(filename) end
|
147
|
+
def self.chdir(path) @client.chdir(path) end
|
148
|
+
def self.cp(path, path2) @client.cp(path, path2) end
|
149
|
+
def self.mkdir(name) @client.mkdir(name) end
|
150
|
+
def self.mkdir_p(path) @client.mkdir_p(path) end
|
151
|
+
def self.mv(path, path2) @client.mv(path, path2) end
|
152
|
+
def self.pwd() @client.pwd() end
|
153
|
+
def self.read(filename) @client.read(filename) end
|
154
|
+
def self.rm(filename) @client.rm(filename) end
|
155
|
+
def self.write(filename, s) @client.write(filename, s) end
|
138
156
|
|
139
157
|
end
|
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
2aIZ9lf6/AT4LP07t9jB5oYLHlr2nBLIqtPXdJvg5RKKr79CQVmpJ5LCTjwTg9h+
|
31
31
|
g1Q=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2018-08-
|
33
|
+
date: 2018-08-12 00:00:00.000000000 Z
|
34
34
|
dependencies: []
|
35
35
|
description:
|
36
36
|
email: james@jamesrobertson.eu
|
metadata.gz.sig
CHANGED
Binary file
|