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

crystal doc checks is_crystal_repo based on any remote #3896

Merged
merged 1 commit into from
Jan 16, 2017

Conversation

MaxLap
Copy link
Contributor

@MaxLap MaxLap commented Jan 14, 2017

In crystal doc, instead of checking only the origin remote to detect if we are in the crystal repo, check any of the remotes.
I find this useful because I prefer to have my fork as 'origin', and keep the crystal-lang repo as 'lang'. However, doing this means when I make doc, i don't get the Crystal section with all the builtins.

@@ -283,6 +283,8 @@ class Crystal::Doc::Generator

github_remote_pattern = /github\.com(?:\:|\/)((?:\w|-|_)+)\/((?:\w|-|_|\.)+)/
github_remotes = remotes.lines.select &.match(github_remote_pattern)
@is_crystal_repo = github_remotes.any? { |gr| gr =~ %r{github\.com[/:]crystal-lang/crystal} }
Copy link
Member

Choose a reason for hiding this comment

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

I think the forward slash should be escaped.

... { |gr| gr =~ %r{github\.com[/:]crystal-lang\/crystal} }
                                               ^

Copy link
Member

Choose a reason for hiding this comment

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

I think that's only needed when using the /..../ syntax, but with %r{...} that's OK

Copy link
Contributor

Choose a reason for hiding this comment

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

Not having to espace forward slashes is why I use %r over /.../ in the first place.

Copy link
Member

Choose a reason for hiding this comment

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

Oops my bad then

@bcardiff bcardiff merged commit ff314f9 into crystal-lang:master Jan 16, 2017
@bcardiff bcardiff added this to the Next milestone Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants