Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Fix Pathname compatibility. #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

voxik
Copy link

@voxik voxik commented Feb 26, 2019

Until PR #42 was merged, String, as well as Pathname objects, were supported just fine. Now, just String is supported, because Pathname object does not support #start_with? method.

Therefore, this just naively converts everything to String to fix Pathname support. I can imagine, that it would use Pathname#absolute? if available, but not sure what would be the result.

Please note that this fixes "4) Vagrant::Action::Builtin::BoxAdd with box file directly adds from FTP URL Failure/Error: server.add_file(path.basename, path.read)" failure mentioned in hashicorp/vagrant/issues/10646

Until PR livinginthepast#42 was merged, String, as well as Pathname objects, were
supported just fine. Now, just String is supported, because Pathname
object does not support #start_with? method.

Therefore, this just naively converts everything to String to fix
Pathname support.
@voxik
Copy link
Author

voxik commented Feb 26, 2019

Just FTR, this is full backtrace from the Vagrant test case:

  1) Vagrant::Action::Builtin::BoxAdd with box file directly adds from FTP URL
     Failure/Error: server.add_file(path.basename, path.read)
     
     NoMethodError:
       undefined method `start_with?' for #<Pathname:temporary.box>
     # /builddir/.gem/ruby/gems/fake_ftp-0.3.0/lib/fake_ftp/server.rb:157:in `abspath'
     # /builddir/.gem/ruby/gems/fake_ftp-0.3.0/lib/fake_ftp/server.rb:62:in `add_file'
     # ./test/unit/vagrant/action/builtin/box_add_test.rb:52:in `with_ftp_server'
     # ./test/unit/vagrant/action/builtin/box_add_test.rb:151:in `block (3 levels) in <top (required)>'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant