sambala 0.9.1 → 0.9.2

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.
Files changed (3) hide show
  1. data/lib/sambala.rb +6 -6
  2. data/lib/sambala_gardener.rb +2 -0
  3. metadata +1 -1
@@ -71,7 +71,7 @@ class Sambala
71
71
  def initialize(options={:domain => '', :host => '', :share => '', :user => '', :password => '', :threads => 1})
72
72
  begin
73
73
  options[:threads] = 4 if options[:threads] > 4
74
- options[:init_timeout] = options[:threads] * 1
74
+ options[:init_timeout] = options[:threads]
75
75
  @options = options; gardener_ok
76
76
  rescue
77
77
  @gardener.close unless @gardener.nil? || @gardener.class != 'Gardener'
@@ -135,8 +135,8 @@ class Sambala
135
135
  # === Example
136
136
  # samba.get(:from => 'aFile.txt') # => [true, "getting file \\aFile.txt.rb of size 3877 as test.rb (99.6 kb/s) (average 89.9 kb/s)\r\n"]
137
137
  def get(opts={:from => nil, :to => nil, :queue => false})
138
- opts[:to].nil? ? strng = opts[:from] : strng = opts[:from] + ' ' + opts[:to]
139
- execute('get', clean_path(strng), opts[:queue])
138
+ opts[:to].nil? ? strng = opts[:from] : strng = clean_path(opts[:from]) + ' ' + opts[:to]
139
+ execute('get', strng, opts[:queue])
140
140
  end
141
141
 
142
142
  # The +lcd+ instance method changes the current working directory on the local machine to the directory specified.
@@ -147,7 +147,7 @@ class Sambala
147
147
  # === Example
148
148
  # samba.lcd('aLocalFolder/anOtherFolder/') # => true
149
149
  def lcd(to='.')
150
- execute_all('lcd', clean_path(to))
150
+ execute_all('lcd', to)
151
151
  end
152
152
 
153
153
  # The +lowercase+ method toggles lowercasing of filenames for the get command.
@@ -236,8 +236,8 @@ class Sambala
236
236
  # samba.put(:from => 'aLocalFile.txt') # => [false, "aLocalFile.txt does not exist\r\n"]
237
237
 
238
238
  def put(opts={:from => nil, :to => nil, :queue => false})
239
- opts[:to].nil? ? strng = opts[:from] : strng = opts[:from] + ' ' + opts[:to]
240
- execute('put' , clean_path(strng), opts[:queue])
239
+ opts[:to].nil? ? strng = opts[:from] : strng = opts[:from] + ' ' + clean_path(opts[:to])
240
+ execute('put' , strng, opts[:queue])
241
241
  end
242
242
 
243
243
  # The +recurse+ method toggles directory recursion
@@ -85,9 +85,11 @@ class Sambala
85
85
  init.map! { |result| result[:success] }
86
86
  throw :gardener if init.uniq.size == 1 and init[0] == true
87
87
  rescue Timeout::Error
88
+ $! = "Slugish Network or Server?"
88
89
  end
89
90
  kill_gardener_and_incr
90
91
  end
92
+ $! = "All Attemps Failed, Gardener could not be initiated" if $!.nil?
91
93
  raise SmbInitError.exception("Couldn't set smbclient properly (#{$!.to_s})")
92
94
  end
93
95
  @posix_support = posix?(@init_status[0][:message])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sambala
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis-Philippe Perron