New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No More Angry Jessie #69
Conversation
@@ -12,6 +12,10 @@ def initialize(id, location, name, size, mtime, container, type=nil) | |||
@type = type || @container ? 'application/x-directory' : Rack::Mime.mime_type(File.extname(name)) | |||
end | |||
|
|||
def is_relative_path? | |||
name =~ /^\.\.?$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only matches the strings "." and "..". It does not match "../foo". Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. There is never a case where a driver would generate the path ../foo
. In fact, it should never generate .
. We included ..
as a way to navigate back up the tree when the UI was a single-directory view. Now that it's a tree, it's no longer needed. But I left it in the drivers in case we establish a custom view-switching thing later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may I suggest the name of the method be changed to is_relative_parent_path?
or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/is_//
since the '?' on the end already implies a boolean.
An angry @jcoyne enters the room! |
:squirrel: |
@jkeck would have responded but he's busy at Candlestick: |
👌 |
LMFAO |
😆 |
Address @Jeck's comments from #68