mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
some small fixups
This commit is contained in:
parent
1cf33ccc7a
commit
28c1d90d63
1 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
require 'delegate'
|
||||||
|
|
||||||
module Fog
|
module Fog
|
||||||
module SSH
|
module SSH
|
||||||
|
|
||||||
|
@ -42,7 +44,7 @@ module Fog
|
||||||
|
|
||||||
@address = address
|
@address = address
|
||||||
@username = username
|
@username = username
|
||||||
@debug = options.delete :debug
|
@debug = options.delete :debug
|
||||||
@options = { :paranoid => false }.merge(options)
|
@options = { :paranoid => false }.merge(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -92,13 +94,17 @@ module Fog
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'delegate'
|
|
||||||
|
|
||||||
class DebugString < SimpleDelegator
|
class DebugString < SimpleDelegator
|
||||||
|
|
||||||
|
def initialize(string='')
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
def <<(add_me)
|
def <<(add_me)
|
||||||
puts add_me
|
puts add_me
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class Result
|
class Result
|
||||||
|
@ -120,8 +126,8 @@ module Fog
|
||||||
|
|
||||||
def initialize(command, debug=false)
|
def initialize(command, debug=false)
|
||||||
@command = command
|
@command = command
|
||||||
@stderr = debug ? DebugString.new('') : ''
|
@stderr = debug ? DebugString.new : ''
|
||||||
@stdout = debug ? DebugString.new('') : ''
|
@stdout = debug ? DebugString.new : ''
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue