sambal 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sambal/version.rb +1 -1
- data/lib/sambal.rb +2 -2
- data/spec/sambal/client_spec.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abe20faeafb0cf4e5117a5decfec59c43c440501
|
4
|
+
data.tar.gz: 20032ebe666efcf9ed27274e28a014917dca1000
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbf2111bb855e33b98a28ac6b6c7a0e8c193a03ddfa89b4cc6ea028f5709a010caf66b27789b904a10143b32fed61a28033f0f039bdc40a34330650e9767a14b
|
7
|
+
data.tar.gz: 62c67112d634d2a832a8a97674a9b2c22aec9c1abd24c3e0300d24082e9731af619ceced796c345f2d5a94c8922b049e5669baf7cae35f55d280f9b41d2ad93e
|
data/lib/sambal/version.rb
CHANGED
data/lib/sambal.rb
CHANGED
@@ -46,7 +46,7 @@ module Sambal
|
|
46
46
|
begin
|
47
47
|
options = {domain: 'WORKGROUP', host: '127.0.0.1', share: '', user: 'guest', password: '--no-pass', port: 445, timeout: 10}.merge(options)
|
48
48
|
@timeout = options[:timeout].to_i
|
49
|
-
@o, @i, @pid = PTY.spawn("smbclient \"//#{options[:host]}/#{options[:share]}\"
|
49
|
+
@o, @i, @pid = PTY.spawn("smbclient \"//#{options[:host]}/#{options[:share]}\" '#{options[:password]}' -W \"#{options[:domain]}\" -U \"#{options[:user]}\" -p #{options[:port]}")
|
50
50
|
#@o.set_encoding('UTF-8:UTF-8') ## don't know didn't work, we only have this problem when the files are named using non-english characters
|
51
51
|
#@i.set_encoding('UTF-8:UTF-8')
|
52
52
|
res = @o.expect(/(.*\n)?smb:.*\\>/, @timeout)[0] rescue nil
|
@@ -250,7 +250,7 @@ module Sambal
|
|
250
250
|
|
251
251
|
def wrap_filenames(cmd,filenames)
|
252
252
|
filenames = [filenames] unless filenames.kind_of?(Array)
|
253
|
-
filenames.map!{ |filename|
|
253
|
+
filenames.map!{ |filename| "\"#{filename}\"" }
|
254
254
|
[cmd,filenames].flatten.join(' ')
|
255
255
|
end
|
256
256
|
|
data/spec/sambal/client_spec.rb
CHANGED
@@ -201,11 +201,15 @@ describe Sambal::Client do
|
|
201
201
|
end
|
202
202
|
|
203
203
|
it 'should create commands with one wrapped filename' do
|
204
|
-
@sambal_client.wrap_filenames('cmd',
|
204
|
+
@sambal_client.wrap_filenames('cmd','file1').should eq('cmd "file1"')
|
205
205
|
end
|
206
206
|
|
207
207
|
it 'should create commands with more than one wrapped filename' do
|
208
208
|
@sambal_client.wrap_filenames('cmd',['file1','file2']).should eq('cmd "file1" "file2"')
|
209
209
|
end
|
210
210
|
|
211
|
+
it 'should create commands with pathnames instead of strings' do
|
212
|
+
@sambal_client.wrap_filenames('cmd',[Pathname.new('file1'), Pathname.new('file2')]).should eq('cmd "file1" "file2"')
|
213
|
+
end
|
214
|
+
|
211
215
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sambal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Axel Eriksson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|