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

Update ngrok template #1098

Merged
merged 2 commits into from
Oct 23, 2020
Merged

Update ngrok template #1098

merged 2 commits into from
Oct 23, 2020

Conversation

tjoyal
Copy link
Member

@tjoyal tjoyal commented Oct 19, 2020

Originally added here: #802

It took me a long while to understand that \h in ruby is not the same as some other languages.....

/\h/ - A hexdigit character ([0-9a-fA-F])
https://ruby-doc.org/core-2.7.1/Regexp.html

That being said, paid ngrok account and use more characters in their premium domains.

Also adding some \. to make sure we treat them as dots and not wildcards.

@@ -90,7 +90,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
test "adds host config to development.rb" do
run_generator
assert_file "config/environments/development.rb" do |config|
assert_match "config.hosts = (config.hosts rescue []) << /\\h+.ngrok.io/", config
assert_match "config.hosts = (config.hosts rescue []) << /\\w+\\.ngrok\\.io/", config
Copy link
Member Author

Choose a reason for hiding this comment

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

Would it be easier to read if the test was like that?

assert_match 'config.hosts = (config.hosts rescue []) << /\w+\.ngrok\.io/', config

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks the same to me, I think it's fine as is.

@tjoyal tjoyal marked this pull request as ready for review October 19, 2020 23:15
@tjoyal tjoyal requested a review from a team as a code owner October 19, 2020 23:15
@tjoyal tjoyal merged commit 2401342 into master Oct 23, 2020
@tjoyal tjoyal deleted the update-ngrok-template branch October 23, 2020 11:29
@jgray7019 jgray7019 temporarily deployed to rubygems December 10, 2020 20:54 Inactive
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.

4 participants