summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-ruby/net-sftp')
-rw-r--r--dev-ruby/net-sftp/files/net-sftp-2.1.2-net-ssh-4.patch42
-rw-r--r--dev-ruby/net-sftp/net-sftp-2.1.2-r2.ebuild10
2 files changed, 46 insertions, 6 deletions
diff --git a/dev-ruby/net-sftp/files/net-sftp-2.1.2-net-ssh-4.patch b/dev-ruby/net-sftp/files/net-sftp-2.1.2-net-ssh-4.patch
new file mode 100644
index 000000000000..d510153ba8d5
--- /dev/null
+++ b/dev-ruby/net-sftp/files/net-sftp-2.1.2-net-ssh-4.patch
@@ -0,0 +1,42 @@
+From 9870b32d31bbe5cddceead54c64f71e4fd91779e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Mon, 27 Feb 2017 15:00:30 +0100
+Subject: [PATCH] Fix compatiblity with net-ssh 4.0+
+
+---
+ test/test_download.rb | 4 +++-
+ test/test_session.rb | 6 ++++--
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/test/test_download.rb b/test/test_download.rb
+index d4a5f0b..d9582b6 100644
+--- a/test/test_download.rb
++++ b/test/test_download.rb
+@@ -139,7 +139,9 @@ def test_download_file_should_transfer_remote_to_local_buffer
+
+ def test_download_directory_to_buffer_should_fail
+ expect_sftp_session :server_version => 3
+- assert_raises(ArgumentError) { sftp.download("/path/to/remote", StringIO.new, :recursive => true) }
++ Net::SSH::Test::Extensions::IO.with_test_extension do
++ assert_raises(ArgumentError) { sftp.download("/path/to/remote", StringIO.new, :recursive => true) }
++ end
+ end
+
+ private
+diff --git a/test/test_session.rb b/test/test_session.rb
+index a59058a..c398436 100644
+--- a/test/test_session.rb
++++ b/test/test_session.rb
+@@ -660,8 +660,10 @@ def test_unblock_bang_should_block_and_return_response
+
+ def assert_not_implemented(server_version, command, *args)
+ expect_sftp_session :server_version => 1
+- sftp.connect!
+- assert_raises(NotImplementedError) { sftp.send(command, *args) }
++ Net::SSH::Test::Extensions::IO.with_test_extension do
++ sftp.connect!
++ assert_raises(NotImplementedError) { sftp.send(command, *args) }
++ end
+ end
+
+ def assert_command_with_callback(command, *args)
diff --git a/dev-ruby/net-sftp/net-sftp-2.1.2-r2.ebuild b/dev-ruby/net-sftp/net-sftp-2.1.2-r2.ebuild
index 06d83b14fd7f..355c2a819361 100644
--- a/dev-ruby/net-sftp/net-sftp-2.1.2-r2.ebuild
+++ b/dev-ruby/net-sftp/net-sftp-2.1.2-r2.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=5
-USE_RUBY="ruby22 ruby23"
+USE_RUBY="ruby22 ruby23 ruby24"
RUBY_FAKEGEM_EXTRADOC="CHANGES.txt README.rdoc"
@@ -16,13 +16,11 @@ SLOT="2"
KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x64-solaris ~x86-solaris"
IUSE=""
-ruby_add_rdepend "|| ( dev-ruby/net-ssh:3 dev-ruby/net-ssh:2.6 )"
+RUBY_PATCHES=( "${FILESDIR}/${P}-net-ssh-4.patch" )
+
+ruby_add_rdepend "|| ( dev-ruby/net-ssh:4 dev-ruby/net-ssh:3 dev-ruby/net-ssh:2.6 )"
ruby_add_bdepend "
test? (
>=dev-ruby/mocha-0.13
)"
-
-all_ruby_prepare() {
- sed -i -e '1i gem "net-ssh", "< 4"' test/common.rb || die
-}