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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/generators/shopify_app/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def mount_engine
def insert_hosts_into_development_config
inject_into_file(
'config/environments/development.rb',
" config.hosts = (config.hosts rescue []) << /\\h+.ngrok.io/\n",
" config.hosts = (config.hosts rescue []) << /\\w+\\.ngrok\\.io/\n",
after: "Rails.application.configure do\n"
)
end
Expand Down
2 changes: 1 addition & 1 deletion test/generators/install_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,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.

end
end
end