From 29bd9d94bf95d4d07c07181a95b03cdaf2f90826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 26 Feb 2019 09:40:17 +0100 Subject: [PATCH] Fix Pathname compatibility. 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. --- lib/fake_ftp/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fake_ftp/server.rb b/lib/fake_ftp/server.rb index a1b80ce..3f88f7b 100644 --- a/lib/fake_ftp/server.rb +++ b/lib/fake_ftp/server.rb @@ -154,7 +154,7 @@ def absolute=(value) private :options def abspath(filename) - return filename if filename.start_with?('/') + return filename if filename.to_s.start_with?('/') [@workdir.to_s, filename].join('/').gsub('//', '/') end