smb-client 0.1.2 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f651dd31ee5d350f7e0b360cf174e194ae9bfab
4
- data.tar.gz: b45cb7eb1f73c605139795bc71355ed75d04f8c1
3
+ metadata.gz: 537a44bc5b1fec93cc807fb05255b8a3a4cfe0e3
4
+ data.tar.gz: 6a5c79d193aa1665a38150db5d5a6418c066258e
5
5
  SHA512:
6
- metadata.gz: 9777debb5d8176ab01f543f8c37c8ffde3c9a6c5418745690ff927a1d2254ef826474c396144fe0ac2840958912a4cf00b7b6be54ea305d343bcdc2cc7c20b6e
7
- data.tar.gz: 913a1a40edd78e053effd7cff12fe46a92b6ab7b061bbbc9dba19623bf158efde5bfe170a3b7fe9b9756cb39786fb2d801eaaf68f4e99e232461d376de066429
6
+ metadata.gz: 1b80c605f62f4dfbdf0a849f23294df8c9ddb59f5b08cce570555e49aad9046cc13e2456c057fc3056b338b747ef2d125527645476621d3612092dd760e8a38c
7
+ data.tar.gz: 7fa816bbd2db9e5560198bad0a79efa13a81ceea3e079cb23f06922d66bbe05b1e171b41b0ac3547195fdbd5ae0d455287be57e219a2cc54cb3510b3e3de370d
File without changes
data/bin/setup CHANGED
File without changes
@@ -114,7 +114,7 @@ module SMB
114
114
  v.nil? && raise(Client::RuntimeError, "Missing option [:#{k}]")
115
115
  end
116
116
  "//#{@options[:host]}/#{@options[:share]} #{@options[:password]} \
117
- -U #{@options[:user]} #{@options[:workgroup]} -m SMB#{@options[:version]}"
117
+ -U #{@options[:user]} -W #{@options[:workgroup]} -m SMB#{@options[:version]}"
118
118
  end
119
119
 
120
120
  # Handles a response from smbclient
@@ -13,6 +13,7 @@ module SMB
13
13
  # @return [Array] List of +mask+ matching LsItems
14
14
  def ls(mask = '', raise = true)
15
15
  ls_items = []
16
+ mask = '"' + mask + '"' if mask.include? ' '
16
17
  output = exec 'ls ' + mask
17
18
  output.lines.each do |line|
18
19
  ls_item = LsItem.from_line(line)
@@ -32,6 +33,7 @@ module SMB
32
33
  # @param [Boolean] raise raise Error or just return +false+
33
34
  # @return [Boolean] true on success
34
35
  def mkdir(path, raise = true)
36
+ path = '"' + path + '"' if mask.include? ' '
35
37
  exec 'mkdir ' + path
36
38
  true
37
39
  rescue Client::RuntimeError => e
@@ -44,6 +46,7 @@ module SMB
44
46
  # @param [TrueClass/FalseClass] raise raise Error or just return +false+
45
47
  # @return [Boolean] true on success
46
48
  def rmdir(path, raise = true)
49
+ path = '"' + path + '"' if mask.include? ' '
47
50
  exec 'rmdir ' + path
48
51
  true
49
52
  rescue Client::RuntimeError => e
@@ -62,6 +65,8 @@ module SMB
62
65
  if !overwrite && !ls_items.empty?
63
66
  raise Client::RuntimeError, "File [#{to}] already exist"
64
67
  end
68
+ from = '"' + from + '"' if mask.include? ' '
69
+ to = '"' + to + '"' if mask.include? ' '
65
70
  exec 'put ' + from + ' ' + to
66
71
  true
67
72
  rescue Client::RuntimeError => e
@@ -89,6 +94,7 @@ module SMB
89
94
  # @param [Boolean] raise raise raise Error or just return +false+
90
95
  # @return [Boolean] true on success
91
96
  def del(path, raise = true)
97
+ path = '"' + path + '"' if mask.include? ' '
92
98
  exec 'del ' + path
93
99
  true
94
100
  rescue Client::RuntimeError => e
@@ -115,6 +121,7 @@ module SMB
115
121
  if !overwrite && File.exist?(to)
116
122
  raise Client::RuntimeError, "File [#{to}] already exist locally"
117
123
  end
124
+ from = '"' + from + '"' if mask.include? ' '
118
125
  exec 'get ' + from + ' ' + to
119
126
  to
120
127
  rescue Client::RuntimeError => e
@@ -1,5 +1,5 @@
1
1
  module SMB
2
2
  class Client
3
- VERSION = '0.1.2'.freeze
3
+ VERSION = '0.1.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smb-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ralf Herzog
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-20 00:00:00.000000000 Z
11
+ date: 2017-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler