You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me that there's some strange behavior with trailing slashes. In case if you are working on remote machine, it uses local filesystem to determine whether this is file or not?!
Here's the code:
...
def self.factory(full_path, box=nil)
if full_path.tail(1) == '/'
Rush::Dir.new(full_path, box)
# No matter is it remote box or local, it
# always uses local filesystem!
elsif File.directory?(full_path)
Rush::Dir.new(full_path, box)
else
Rush::File.new(full_path, box)
end
end
...
Maybe it's better to use something like that?
...
def self.factory(full_path, box=nil)
if full_path.tail(1) == '/'
Rush::Dir.new(full_path, box)
elsif box.host == "localhost"
File.directory?(full_path) ? make_dir : make_file
else
RemoteFile.directory?(full_path) ? make_dir : make_file
# or, if it's expensive to query remote PC, just return file whithout any check?
just_make_file
end
end
...
P.S.
I think this tool deserves much more adoption, maybe some people tried but then have been stopping using it because of the need to start the rushd process.
Maybe it's worth to add ability for it to works with limited functionality but without starting rushd processes?
The text was updated successfully, but these errors were encountered:
Hi Adam, thanks for another cool tool.
It seems to me that there's some strange behavior with trailing slashes. In case if you are working on remote machine, it uses local filesystem to determine whether this is file or not?!
Here's the code:
Maybe it's better to use something like that?
P.S.
I think this tool deserves much more adoption, maybe some people tried but then have been stopping using it because of the need to start the rushd process.
Maybe it's worth to add ability for it to works with limited functionality but without starting rushd processes?
The text was updated successfully, but these errors were encountered: