ruby-fcp 0.0.6 → 0.0.7
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
- data/lib/ruby-fcp/fcp_client.rb +9 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 148d0ae13e8e0abd05ddfd005ef0345ec97e3b3b
|
4
|
+
data.tar.gz: a93859dc50c8d9593c862959710344beecc55a61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 358eab85e76bb515dfb2dffb6229f7ba2bc878e45bb22afb96763581fe7f7fda4bc8848fedb566e579c8d2ba412220894ec3300d61d9e86320f95338273b6dbe
|
7
|
+
data.tar.gz: 7272ced7cc6074811e12ecc91d78e815f7e85737fd8fa4d46149069d62e06f170236c8ec6ee2ea623a31c8072c3b9ff5533581de98f39758df1cadf53fe736f3
|
data/lib/ruby-fcp/fcp_client.rb
CHANGED
@@ -39,7 +39,8 @@ class FCPClient
|
|
39
39
|
# * KSK@filename
|
40
40
|
def simple_put(uri, filename, wait = true, opts = {})
|
41
41
|
id = @utils.id_generate
|
42
|
-
options = { "URI" => uri, "Identifier" => id, "UploadFrom" => 'disk', "Filename" => filename, "FileHash" => @utils.filehash_maker(id, filename,identifier) }.merge(opts)
|
42
|
+
options = { "URI" => uri, "Identifier" => id, "UploadFrom" => 'disk', "Filename" => filename, "FileHash" => @utils.filehash_maker(id, filename,identifier), "Verbosity" => "111111111" }.merge(opts)
|
43
|
+
options["TargetFilename"] = filename.split(File::SEPARATOR)[-1] if uri =~ /CHK@/
|
43
44
|
@com.send_packet @utils.packet_mangler(options,"ClientPut")
|
44
45
|
#@com.fcpackets.client_put uri, id, options
|
45
46
|
if wait
|
@@ -100,7 +101,7 @@ class FCPClient
|
|
100
101
|
def put_complex_dir(uri, files, wait = true,opts = {})
|
101
102
|
dirs = []
|
102
103
|
id = @utils.id_generate
|
103
|
-
files.each{ |f| dirs << f[:filename].split(
|
104
|
+
files.each{ |f| dirs << f[:filename].split(File::SEPARATOR)[0...-1].join(File::SEPARATOR) + File::SEPARATOR if f.has_key? :filename }
|
104
105
|
(dirs.uniq).each { |dir| ddarun(dir,true,false) }
|
105
106
|
options = {"URI" => uri, "Identifier" => id}.merge(opts)
|
106
107
|
files.each_with_index do |file, index|
|
@@ -206,10 +207,14 @@ class FCPClient
|
|
206
207
|
end
|
207
208
|
|
208
209
|
#subscirbe to a usk, have to poll it yourself by using responses[id]
|
209
|
-
def subscribe_usk(uri, wait=false ,opts ={})
|
210
|
+
def subscribe_usk(uri, wait = false ,opts ={})
|
210
211
|
id = @utils.id_generate
|
211
212
|
@com.send_packet @utils.packet_mangler({"URI" => uri, "Identifier" => id} ,"SubscribeUSK")
|
212
|
-
|
213
|
+
if wait
|
214
|
+
wait_for id, /SubscribedUSKUpdate/
|
215
|
+
else
|
216
|
+
id
|
217
|
+
end
|
213
218
|
end
|
214
219
|
|
215
220
|
def unsubscribe_usk(id)
|