ruby-fcp 0.0.9 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1155d73ac1fae96727ec974cd20478c07b37fe3
4
- data.tar.gz: 6473e4a1b4fb1e1b2bdc16d05294cd1c8ba8869b
3
+ metadata.gz: dc8d92bba6373cc2a798338ea96c12bc2213903d
4
+ data.tar.gz: c0fb34a5a3060b20d930207f936acc812dc1e1ef
5
5
  SHA512:
6
- metadata.gz: 9283b3058d5ff46d336ba3ab00084a6e548328fe702b4c58defc0101c8b324097c3c9f85171632b457b3e306c45a70d3d727b2e0cc6421435ba1b9dbce079254
7
- data.tar.gz: dc8cff53b6c29c12eedb8fd3edbed5bb188b2a92f8b9fb6403025fe96c69a2ae2d14619fbd865f154f879d9fe0aad147d94c6b0a93cf2fc69984bca5e1ffec9e
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
- client.simple_put(options[:uri].chomp.lstrip,options[:path].chomp.lstrip)
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
 
@@ -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] if uri =~ /CHK@/
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.0.9
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.4.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: