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

Add Lucky.root redirection to Dir.current through exception. #1206

Merged
merged 2 commits into from
Jun 24, 2020
Merged

Add Lucky.root redirection to Dir.current through exception. #1206

merged 2 commits into from
Jun 24, 2020

Conversation

stephendolan
Copy link
Member

@stephendolan stephendolan commented Jun 22, 2020

Purpose

Adds Lucky.root method which, when used in an application will raise a compile-time error redirecting users to leverage Dir.current. Resolves #1198.

Description

Context can be found in #1198, including around the decision to make this a compile-time error.

No specs added since it's raised at compile-time, and not post-build.

Not 100% sure about how this will look in code documentation with just the single comment, please let me know if I need to improve that.

Didn't add a CHANGELOG entry since I didn't see an existing "UNRELEASED" section, but happy to help add that in.

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

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

Suggestion to add a bit more background info in the docs. Other than that this looks great!

src/lucky.cr Outdated Show resolved Hide resolved
Co-authored-by: Paul Smith <paulcsmith@users.noreply.github.com>
Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

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

This looks good to me 👍

Also, don't worry about the CHANGELOG entry. I think we should just remove that mention. I'd rather just handle adding in all of the entries at once than having each PR go adding their own in.

@stephendolan
Copy link
Member Author

Cool, sounds good. @jwoertink / @paulcsmith I'll make a note in #1205 to discuss removing the CHANGELOG entry requirement.

@paulcsmith
Copy link
Member

This looks great. Thanks @stephendolan!

@paulcsmith paulcsmith merged commit 4fd3dd4 into luckyframework:master Jun 24, 2020
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.

Create a Lucky.root method to allow intuitive access to project folder
3 participants