scttnlsn / dandelion

Incremental Git repository deployment.
http://scttnlsn.github.io/dandelion
MIT License
738 stars 57 forks source link

Using correct getbinaryfile method call #1

Closed rougecardinal closed 13 years ago

rougecardinal commented 13 years ago

Hi Scott,

Great work, but it had some small bugs, I did try to correct them. I'm now able to upload first files to the repo, but still having errors with directories :

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/ftp.rb:243:in getresp': 553 Could not create file. (Net::FTPPermError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/ftp.rb:264:insendcmd' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in synchronize' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/ftp.rb:262:insendcmd' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/ftp.rb:321:in transfercmd' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/ftp.rb:452:instorbinary' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in synchronize' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/ftp.rb:450:instorbinary' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/ftp.rb:562:in putbinaryfile' from /Library/Ruby/Gems/1.8/gems/dandelion-0.1.7/bin/../lib/dandelion/service.rb:60:inwrite' from /Library/Ruby/Gems/1.8/gems/dandelion-0.1.7/bin/../lib/dandelion/service.rb:26:in temp' from /Library/Ruby/Gems/1.8/gems/dandelion-0.1.7/bin/../lib/dandelion/service.rb:59:inwrite' from /Library/Ruby/Gems/1.8/gems/dandelion-0.1.7/bin/../lib/dandelion/deployment.rb:119:in deploy' from /Library/Ruby/Gems/1.8/gems/dandelion-0.1.7/bin/../lib/dandelion/deployment.rb:114:ineach' from /Library/Ruby/Gems/1.8/gems/dandelion-0.1.7/bin/../lib/dandelion/deployment.rb:114:in deploy' from /Library/Ruby/Gems/1.8/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:157:inexecute!' from /Library/Ruby/Gems/1.8/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:71:in execute' from /Library/Ruby/Gems/1.8/gems/dandelion-0.1.7/bin/dandelion:7 from /usr/bin/dandelion:19:inload' from /usr/bin/dandelion:19

scttnlsn commented 13 years ago

Nice! Thanks!

How come you removed localfile = nil in the getbinaryfile method call? If that is omitted then the remote file will be written locally.

-Scott

rougecardinal commented 13 years ago

Sorry Scott, I do not have errors anymore, rewriting the mkdir_p made the trick, but I did not update de push request comment. For the getbinaryfile I believe it needs to be improved again I was using ruby 1.8 and encoutered a bug, implementation differs between 1.8 and 1.9:

1.9 : http://www.ruby-doc.org/stdlib/libdoc/net/ftp/rdoc/index.html 1.8 : http://www.ruby-doc.org/stdlib-1.8.7/libdoc/net/ftp/rdoc/classes/Net/FTP.html#M001079

I will prepare a version compatible with both.

scttnlsn commented 13 years ago

Oh, bummer. Those 1.8/1.9 differences get me every time!

Thanks!

-Scott

scttnlsn commented 13 years ago

rougecardinal,

Were you able to come up with a version of Dandelion::Service::FTP#read that works for 1.8 and 1.9? At first glance it seems like we have to pass in a temp file ... getbinaryfile(file, localfile = temp) and then delete it when we're done, but that feels wrong. Any ideas?

-Scott

rougecardinal commented 13 years ago

Apparently the head version of dandelion is ok for 1.8, 1.9, FTP and sftp.

At least it is working like a charm for me in both environments.

Tell me if you have found a bug. Otherwise you can package it as a new gem release.

Thomas

Envoyé de mon téléphone.

Rouge Cardinal - 01 83 64 02 13

Le 14 avr. 2011 à 03:54, scttnlsn reply@reply.github.com a écrit :

rougecardinal,

Were you able to come up with a version of Dandelion::Service::FTP#read that works for 1.8 and 1.9? At first glance it seems like we have to pass in a temp file ... getbinaryfile(file, localfile = temp) and then delete it when we're done, but that feels wrong. Any ideas?

-Scott

Reply to this email directly or view it on GitHub: https://github.com/scttnlsn/dandelion/pull/1#issuecomment-998841

scttnlsn commented 13 years ago

Works well with 1.9, but 1.8 raises the following error:

/Users/scott/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/ftp.rb:500:in open': can't convert nil into String (TypeError) from /Users/scott/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/ftp.rb:500:ingetbinaryfile' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/service.rb:42:in read' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/deployment.rb:105:inread_remote_revision' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/deployment.rb:52:in initialize' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:139:innew' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:139:in deployment' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:121:inexecute' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:102:in execute' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/dandelion:7 from /Users/scott/.rvm/gems/ruby-1.8.7-p334/bin/dandelion:19:inload' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/bin/dandelion:19

-Scott

rougecardinal commented 13 years ago

Ok, I try to watch this one before tonight (I'm in France, it's 2:20pm here)

Thomas

Thomas Darde rougecardinal.fr - 34 rue de Turin, 75008 Paris 01 83 64 02 13 - 06 63 38 45 68

On jeudi 14 avril 2011 at 14:09, scttnlsn wrote:

Works well with 1.9, but 1.8 raises the following error:

/Users/scott/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/ftp.rb:500:in open': can't convert nil into String (TypeError) from /Users/scott/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net/ftp.rb:500:ingetbinaryfile' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/service.rb:42:in read' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/deployment.rb:105:inread_remote_revision' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/deployment.rb:52:in initialize' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:139:innew' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:139:in deployment' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:121:inexecute' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/../lib/dandelion/cli.rb:102:in execute' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/gems/dandelion-0.1.7/bin/dandelion:7 from /Users/scott/.rvm/gems/ruby-1.8.7-p334/bin/dandelion:19:inload' from /Users/scott/.rvm/gems/ruby-1.8.7-p334/bin/dandelion:19

-Scott

Reply to this email directly or view it on GitHub: https://github.com/scttnlsn/dandelion/pull/1#issuecomment-1000930

scttnlsn commented 13 years ago

I committed a fix for the Service::FTP#read method that should be compatible with Ruby 1.8 and 1.9. Would you mind testing it out on your end as well? If all goes well I'll push a 0.2.0 Gem.

Thanks a lot!

-Scott

rougecardinal commented 13 years ago

Hi Scott,

Sorry for the delay, I was looking for a new office for my company this week (and finally found them !). Seams to me it's working, I'm using 1.8.7 from rvm head.

So I say you can go for 0.2 !

Have a nice sunday,

Thomas

Thomas Darde rougecardinal.fr - 34 rue de Turin, 75008 Paris 01 83 64 02 13 - 06 63 38 45 68

On dimanche 17 avril 2011 at 15:41, scttnlsn wrote:

I committed a fix for the Service::FTP#read method that should be compatible with Ruby 1.8 and 1.9. Would you mind testing it out on your end as well? If all goes well I'll push a 0.2.0 Gem.

Thanks a lot!

-Scott

Reply to this email directly or view it on GitHub: https://github.com/scttnlsn/dandelion/pull/1#issuecomment-1016730

scttnlsn commented 13 years ago

Awesome...thanks so much for helping out with this.

Enjoy the new office!

-Scott