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

Disallow full identifiers from ending with a slash #1206

Merged
merged 1 commit into from Aug 22, 2017

Conversation

Projects
None yet
1 participant
@ddfreyne
Copy link
Member

ddfreyne commented Aug 22, 2017

Full identifiers (e.g. "/foo.md" — compare to legacy identifiers such as "/foo/") can never end with a slash. Nanoc does not currently enforce this, and silently allows a potentially buggy code.

This PR makes full identifiers that end with a slash explicitly invalid.

(It turns out that many of the tests cases were accidentally wrong. Yikes!)

This PR also makes Nanoc::Document#identifier= properly coerce the argument to an identifier, so that @item.identifier = 'hah' no longer turns the identifier from a Nanoc::Identifier into a String.

@ddfreyne ddfreyne force-pushed the refuse-full-identifier-ending-with-slash branch from 655c981 to fcdd7e9 Aug 22, 2017

@ddfreyne ddfreyne force-pushed the refuse-full-identifier-ending-with-slash branch from fcdd7e9 to 57fcc9e Aug 22, 2017

@ddfreyne ddfreyne merged commit df07f35 into master Aug 22, 2017

3 checks passed

codecov/patch 100% of diff hit (target 98.71%)
Details
codecov/project 98.71% (+<.01%) compared to d8232fa
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ddfreyne ddfreyne deleted the refuse-full-identifier-ending-with-slash branch Aug 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.