ruby-fcp 0.0.9 → 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
- data/bin/fput +9 -1
- data/lib/ruby-fcp/fcp_client.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc8d92bba6373cc2a798338ea96c12bc2213903d
|
4
|
+
data.tar.gz: c0fb34a5a3060b20d930207f936acc812dc1e1ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cf25047c3340202c38df5b9c2d1b7cb0a6df46bbcf7c7a1bcd34336807c67b551a1aeddc07a4f821ccd768234b3fac18e8f342e5c72dc337da5cd00e1bb5315
|
7
|
+
data.tar.gz: e4560f95169d2d5d568bf16717f7702536c1b0029ddf6062ec7a62f161d5c1c688749ad261257af43395cc952e30cf289139520f75813622fafc68889561e29f
|
data/bin/fput
CHANGED
@@ -33,6 +33,10 @@ opts = OptionParser.new do |opts|
|
|
33
33
|
options[:directory] = d
|
34
34
|
end
|
35
35
|
|
36
|
+
opts.on("-n", "--target-name name", "uploaded file name") do |p|
|
37
|
+
options[:name] = p
|
38
|
+
end
|
39
|
+
|
36
40
|
opts.on_tail("-h", "--help", "Show this message") do
|
37
41
|
puts opts
|
38
42
|
exit
|
@@ -52,7 +56,11 @@ if options.has_key? :uri and options.has_key? :path
|
|
52
56
|
if options[:directory]
|
53
57
|
client.simple_dir_put(options[:uri].chomp.lstrip,options[:path].chomp.chomp('/').lstrip,true,{"DefaultName" => options[:index]})
|
54
58
|
else
|
55
|
-
|
59
|
+
if options.has_key? :name
|
60
|
+
client.simple_put(options[:uri].chomp.lstrip,options[:path].chomp.lstrip, true,{"TargetFilename" => options[:name].chomp.lstrip})
|
61
|
+
else
|
62
|
+
client.simple_put(options[:uri].chomp.lstrip,options[:path].chomp.lstrip)
|
63
|
+
end
|
56
64
|
end
|
57
65
|
client.close
|
58
66
|
|
data/lib/ruby-fcp/fcp_client.rb
CHANGED
@@ -25,7 +25,7 @@ class FCPClient < Communicator
|
|
25
25
|
def simple_put(uri, filename, wait = true, opts = {})
|
26
26
|
id = @utils.id_generate
|
27
27
|
options = { "URI" => uri, "Identifier" => id, "UploadFrom" => 'disk', "Filename" => filename, "FileHash" => @utils.filehash_maker(id, filename,identifier), "Verbosity" => "111111111" }.merge(opts)
|
28
|
-
options["TargetFilename"] = filename.split(File::SEPARATOR)[-1]
|
28
|
+
options["TargetFilename"] = filename.split(File::SEPARATOR)[-1] unless options.has_key? "TargetFilename"
|
29
29
|
send_packet @utils.packet_mangler(options,"ClientPut")
|
30
30
|
#@com.fcpackets.client_put uri, id, options
|
31
31
|
if wait
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-fcp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hikiko
|
@@ -44,9 +44,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
44
44
|
version: '0'
|
45
45
|
requirements: []
|
46
46
|
rubyforge_project:
|
47
|
-
rubygems_version: 2.
|
47
|
+
rubygems_version: 2.2.2
|
48
48
|
signing_key:
|
49
49
|
specification_version: 4
|
50
50
|
summary: FCPClient
|
51
51
|
test_files: []
|
52
|
-
has_rdoc:
|