sambal 0.1.5 → 0.1.6

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: 3c4274c002052cc5617a22cf418b4111806789e4
4
- data.tar.gz: c59a923920657398db1380f9d8c52882fe7258d2
3
+ metadata.gz: abe20faeafb0cf4e5117a5decfec59c43c440501
4
+ data.tar.gz: 20032ebe666efcf9ed27274e28a014917dca1000
5
5
  SHA512:
6
- metadata.gz: 29fd6e3b5d317456566266fb63137b75ecf92da195f9cd19e807b48f954fb5413491e46a2834607ca4dd460c511fad71df6a5d3001932240c35d9023dac64c29
7
- data.tar.gz: 743d8226678ff987da7f5c22343b676423c65ce9c1b8fb4a1be96727a9f97bf4762b6f7ee3e7910fc0f967bfd76a030df52909c558379fdc8a4a24312841535d
6
+ metadata.gz: cbf2111bb855e33b98a28ac6b6c7a0e8c193a03ddfa89b4cc6ea028f5709a010caf66b27789b904a10143b32fed61a28033f0f039bdc40a34330650e9767a14b
7
+ data.tar.gz: 62c67112d634d2a832a8a97674a9b2c22aec9c1abd24c3e0300d24082e9731af619ceced796c345f2d5a94c8922b049e5669baf7cae35f55d280f9b41d2ad93e
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module Sambal
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
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]}\" \"#{options[:password]}\" -W \"#{options[:domain]}\" -U \"#{options[:user]}\" -p #{options[:port]}")
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| '"' + filename + '"' }
253
+ filenames.map!{ |filename| "\"#{filename}\"" }
254
254
  [cmd,filenames].flatten.join(' ')
255
255
  end
256
256
 
@@ -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',['file1','file2']).should eq('cmd "file1" "file2"')
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.5
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-06-17 00:00:00.000000000 Z
11
+ date: 2015-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec