From 784baf62e691da5b497fea30a07ee1ae37229eee Mon Sep 17 00:00:00 2001 From: moe Date: Wed, 26 Oct 2011 03:25:31 +0200 Subject: [PATCH] Removes deprecated attribute 'context' from Net::SSH::Simple::Result. --- lib/net/ssh/simple.rb | 21 +++++++++++++++++++++ lib/net/ssh/simple/core.rb | 32 +++++++++++++++++++++++--------- lib/net/ssh/simple/version.rb | 2 +- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/lib/net/ssh/simple.rb b/lib/net/ssh/simple.rb index 7168f4a..c447741 100755 --- a/lib/net/ssh/simple.rb +++ b/lib/net/ssh/simple.rb @@ -1,3 +1,24 @@ +# +# Copyright (C) 2011 by moe@busyloop.net +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# require 'net/ssh/simple/version' require 'blockenspiel' require 'hashie' diff --git a/lib/net/ssh/simple/core.rb b/lib/net/ssh/simple/core.rb index 6d4f3f7..2e5cb21 100755 --- a/lib/net/ssh/simple/core.rb +++ b/lib/net/ssh/simple/core.rb @@ -1,3 +1,24 @@ +# +# Copyright (C) 2011 by moe@busyloop.net +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# module Net module SSH # Net::SSH::Simple is a simple wrapper around Net::SSH and Net::SCP. @@ -559,7 +580,7 @@ def with_session(host, opts={:timeout => 60}, &block) @result[:success] = false @result[:timed_out] = true @result[:finish_at] = Time.new - raise Net::SSH::Simple::Error, [e, [host,opts,@result]] + raise Net::SSH::Simple::Error, [e, @result] end end @@ -590,20 +611,13 @@ class Error < RuntimeError # Reference to the underlying Exception attr_reader :wrapped - # Context of the operation that failed, as an Array: [host, opts, result]. - # - # @deprecated - # This will be removed soon, use {#result} instead! - attr_reader :context - # {Net::SSH::Simple::Result} of the interrupted operation. attr_reader :result def initialize(msg, e=$!) super(msg) @wrapped = e - @context = msg[1] - @result = msg[1][2] + @result = msg[1] end def to_s diff --git a/lib/net/ssh/simple/version.rb b/lib/net/ssh/simple/version.rb index 3677646..645e1dd 100644 --- a/lib/net/ssh/simple/version.rb +++ b/lib/net/ssh/simple/version.rb @@ -1,7 +1,7 @@ module Net module SSH class Simple - VERSION = "1.2.1" + VERSION = "1.3.0" end end end