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

Materialize parent HRX directories if necessary #1408

Merged
merged 1 commit into from
Jun 19, 2019
Merged

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Jun 18, 2019

If an HRX directory is being materialized with #with_real_files and it
contains a file that reaches outside itself (with ../), materialize
its parent directory as well. This allows individual tests to share
utility libraries that are defined in the same HRX archive.

If an HRX directory is being materialized with #with_real_files and it
contains a file that reaches outside itself (with `../`), materialize
its parent directory as well. This allows individual tests to share
utility libraries that are defined in the same HRX archive.
@nex3 nex3 requested a review from rambleraptor June 18, 2019 20:29
# Returns whether `file` contains enough `../` references to reach outside
# this directory.
def _reaches_out?(file)
depth = file.path.count("/")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know if file paths have trailing slashes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HRX spec guarantees that they won't; otherwise they'd be parsed as HRX::Directorys instead.

@nex3 nex3 merged commit f5c83c0 into master Jun 19, 2019
@nex3 nex3 deleted the materialize-parent branch June 19, 2019 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants