doo 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/doo/stock/run_on_server.rb +8 -5
  3. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -4,22 +4,25 @@ Doo::Base.class_eval do
4
4
  with_clone(variables.merge({:host => host}).merge(params || {})) do
5
5
  def run(cmd, opt = {})
6
6
  cmdopts = ["-S \"~/.ssh/master-%l-%r@%h:%p\""]
7
- cmdopts << "-t" if opt.include? :pty || opt[:pty]
7
+ cmdopts << "-t" if !opt.include? :pty || opt[:pty]
8
8
  command = "ssh #{cmdopts.join(' ')} #{user}@#{host} #{cmd}"
9
9
  puts "Running #{command}" if verbose
10
10
  system(command) || raise("SSH Error") unless dry_run
11
11
  $?
12
12
  end
13
13
 
14
- def put(local, remote)
15
- puts "scp -r \"#{local}\" \"#{host}:#{remote}\"" if verbose
16
- system("scp -r \"#{local}\" \"#{host}:#{remote}\"") || raise("SSH Error") unless dry_run
14
+ def put(local, remote, opt = {})
15
+ cmdopts = ["-r"]
16
+ cmdopts << "-oProxyCommand=\"ssh #{gateway} exec nc %h %p\"" if defined?(gateway) && gateway
17
+ command = "scp #{cmdopts.join(' ')} #{local} #{user}@#{host}:#{remote}"
18
+ puts "Putting file #{local} to #{remote} via #{command}" if verbose
19
+ system(command) || raise("Scp Error") unless dry_run
17
20
  $?
18
21
  end
19
22
 
20
23
  begin
21
24
  cmdopts = ["-MNf -S \"~/.ssh/master-%l-%r@%h:%p\""]
22
- cmdopts << "-oProxyCommand=\"ssh #{gateway} exec nc %h %p\"" if defined? :gateway
25
+ cmdopts << "-oProxyCommand=\"ssh #{gateway} exec nc %h %p\"" if defined?(gateway) && gateway
23
26
  command = "ssh #{cmdopts.join(' ')} #{user}@#{host}"
24
27
  puts "Running #{command}" if verbose
25
28
  system(command) || raise("SSH Error") unless dry_run
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mat Trudel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-16 00:00:00 -04:00
18
+ date: 2010-09-20 00:00:00 -04:00
19
19
  default_executable: doo
20
20
  dependencies: []
21
21