Skip to content
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

Use Pathname throughout gollum-lib for consistent pathname handling #216

Open
bartkamphorst opened this issue Aug 14, 2016 · 7 comments
Open

Comments

@bartkamphorst
Copy link
Member

bartkamphorst commented Aug 14, 2016

My proposal is that all path and dir variables will be Pathname objects, and that name will remain a String.

@dometto
Copy link
Member

dometto commented Aug 15, 2016

I assume this will also solve the Windows problems caused by hardcoded slashes?

@bartkamphorst
Copy link
Member Author

Hopefully, although we might run into other issues as well.

@bartkamphorst
Copy link
Member Author

@dometto For the test suite, would you prefer
assert_equal 'Mordor/Eye-Of-Sauron.md', map[3].path.to_s or
assert_equal Pathname.new('Mordor/Eye-Of-Sauron.md'), map[3].path?

@bartkamphorst
Copy link
Member Author

ping @dometto .

@dometto
Copy link
Member

dometto commented Nov 15, 2018

Sorry, missed this! I think I would prefer
assert_equal Pathname.new('Mordor/Eye-Of-Sauron.md'), map[3].path
Because map[3].path.to_s doesn't make explicit that map[3].path is a Pathname (since ordinary strings also respond to #to_s).

@bartkamphorst
Copy link
Member Author

👍

@dometto dometto added this to the 5.0 milestone Aug 21, 2019
@bartkamphorst bartkamphorst removed this from the 5.0 milestone Oct 3, 2019
@dometto
Copy link
Member

dometto commented Aug 1, 2023

#437 makes sure Pathname is used throughout page.rb and file.rb. There may be some other cases where switching to Pathname is preferred.

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

No branches or pull requests

2 participants