You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@buildr.apache.org by Shane Witbeck <sh...@digitalsanctum.com> on 2008/06/09 20:00:47 UTC

net-ssh, net-sftp and buildr

I'm attempting to update some extended buildr code to work with
1.3.1.1. The code in question was coded against 1.2.10 AND the older
1.x versions of net-ssh and net-sftp. The upgrade to buildr 1.3.1.1
requires the 2.x versions of net-ssh and net-sftp but I'd like to
stick with the 1.x versions for the old extended code until I have a
chance to update for 2.x versions. Note that there were some major
changes to the net-sftp which are not backward compatible.

My question is: Is there a way to load the 2.x gem versions of net-ssh
and net-sftp for buildr and load the older 1.x versions for a specific
class? I've tried the following:

require 'rubygems'
gem 'net-ssh', '=1.1.2'
require 'net/ssh'
require 'net/ssh/version'
gem 'net-sftp', '=1.1.0'
require 'net/sftp'
require 'find'

this results in something like....

can't activate net-ssh (=1.1.2), already activated net-ssh-2.0.1


Any suggestions that don't involve rewriting the 1.x dependent class?

-- 
-Shane

Re: net-ssh, net-sftp and buildr

Posted by Shane Witbeck <sh...@digitalsanctum.com>.
Assaf,

Thanks for the response. Based on your suggestions I think it will be
easier to just rewrite the class with the new API changes.

Shane

On Mon, Jun 9, 2008 at 5:41 PM, Assaf Arkin <ar...@intalio.com> wrote:
> On Mon, Jun 9, 2008 at 2:00 PM, Shane Witbeck <sh...@digitalsanctum.com> wrote:
>> I'm attempting to update some extended buildr code to work with
>> 1.3.1.1. The code in question was coded against 1.2.10 AND the older
>> 1.x versions of net-ssh and net-sftp. The upgrade to buildr 1.3.1.1
>> requires the 2.x versions of net-ssh and net-sftp but I'd like to
>> stick with the 1.x versions for the old extended code until I have a
>> chance to update for 2.x versions. Note that there were some major
>> changes to the net-sftp which are not backward compatible.
>>
>> My question is: Is there a way to load the 2.x gem versions of net-ssh
>> and net-sftp for buildr and load the older 1.x versions for a specific
>> class? I've tried the following:
>
> By the time the buildfile loads, Buildr already loaded Net::SSH from
> the new version of the gem, you'll need a bit of work to make Ruby
> forget about the class, loaded files, dependencies, etc.  Might be
> more pain than gain.
>
>>
>> require 'rubygems'
>> gem 'net-ssh', '=1.1.2'
>> require 'net/ssh'
>> require 'net/ssh/version'
>> gem 'net-sftp', '=1.1.0'
>> require 'net/sftp'
>> require 'find'
>>
>> this results in something like....
>>
>> can't activate net-ssh (=1.1.2), already activated net-ssh-2.0.1
>>
>>
>> Any suggestions that don't involve rewriting the 1.x dependent class?
>
> Create your own version of Buildr, comment out any net-ssh dependency
> you find in transport.rb, change the dependency in buildr.gemspec to
> 1.1.2, and rake install.
>
> Assaf
>
>>
>> --
>> -Shane
>



-- 
-Shane

Re: net-ssh, net-sftp and buildr

Posted by Shane Witbeck <sh...@digitalsanctum.com>.
FYI....I found that there's a file truncation bug when uploading from
Windows XP with the versions of net-ssh and net-sftp that buildr
currently requires. Newer versions of the gems claim to fix the
bug(s).

I'm going to create an issue to request that Buildr use the newer gem versions.


On Mon, Jun 9, 2008 at 5:41 PM, Assaf Arkin <ar...@intalio.com> wrote:
> On Mon, Jun 9, 2008 at 2:00 PM, Shane Witbeck <sh...@digitalsanctum.com> wrote:
>> I'm attempting to update some extended buildr code to work with
>> 1.3.1.1. The code in question was coded against 1.2.10 AND the older
>> 1.x versions of net-ssh and net-sftp. The upgrade to buildr 1.3.1.1
>> requires the 2.x versions of net-ssh and net-sftp but I'd like to
>> stick with the 1.x versions for the old extended code until I have a
>> chance to update for 2.x versions. Note that there were some major
>> changes to the net-sftp which are not backward compatible.
>>
>> My question is: Is there a way to load the 2.x gem versions of net-ssh
>> and net-sftp for buildr and load the older 1.x versions for a specific
>> class? I've tried the following:
>
> By the time the buildfile loads, Buildr already loaded Net::SSH from
> the new version of the gem, you'll need a bit of work to make Ruby
> forget about the class, loaded files, dependencies, etc.  Might be
> more pain than gain.
>
>>
>> require 'rubygems'
>> gem 'net-ssh', '=1.1.2'
>> require 'net/ssh'
>> require 'net/ssh/version'
>> gem 'net-sftp', '=1.1.0'
>> require 'net/sftp'
>> require 'find'
>>
>> this results in something like....
>>
>> can't activate net-ssh (=1.1.2), already activated net-ssh-2.0.1
>>
>>
>> Any suggestions that don't involve rewriting the 1.x dependent class?
>
> Create your own version of Buildr, comment out any net-ssh dependency
> you find in transport.rb, change the dependency in buildr.gemspec to
> 1.1.2, and rake install.
>
> Assaf
>
>>
>> --
>> -Shane
>



-- 
-Shane

Re: net-ssh, net-sftp and buildr

Posted by Assaf Arkin <ar...@intalio.com>.
On Mon, Jun 9, 2008 at 2:00 PM, Shane Witbeck <sh...@digitalsanctum.com> wrote:
> I'm attempting to update some extended buildr code to work with
> 1.3.1.1. The code in question was coded against 1.2.10 AND the older
> 1.x versions of net-ssh and net-sftp. The upgrade to buildr 1.3.1.1
> requires the 2.x versions of net-ssh and net-sftp but I'd like to
> stick with the 1.x versions for the old extended code until I have a
> chance to update for 2.x versions. Note that there were some major
> changes to the net-sftp which are not backward compatible.
>
> My question is: Is there a way to load the 2.x gem versions of net-ssh
> and net-sftp for buildr and load the older 1.x versions for a specific
> class? I've tried the following:

By the time the buildfile loads, Buildr already loaded Net::SSH from
the new version of the gem, you'll need a bit of work to make Ruby
forget about the class, loaded files, dependencies, etc.  Might be
more pain than gain.

>
> require 'rubygems'
> gem 'net-ssh', '=1.1.2'
> require 'net/ssh'
> require 'net/ssh/version'
> gem 'net-sftp', '=1.1.0'
> require 'net/sftp'
> require 'find'
>
> this results in something like....
>
> can't activate net-ssh (=1.1.2), already activated net-ssh-2.0.1
>
>
> Any suggestions that don't involve rewriting the 1.x dependent class?

Create your own version of Buildr, comment out any net-ssh dependency
you find in transport.rb, change the dependency in buildr.gemspec to
1.1.2, and rake install.

Assaf

>
> --
> -Shane