Don't require bootsnap in gen'ed Rails 5.2+ apps
[Bootsnap][1] is a new gem that speeds up load times for Rails apps and is included by default in Rails 5.2+ apps. However, this somehow messes with Zeus, which we use often to run tests locally. We don't need it in the Rails apps that the tests generate, so make sure it's not required in those apps. [1]: https://github.com/Shopify/bootsnap
This commit is contained in:
parent
43f4252561
commit
0f36e3c5c0
|
@ -75,6 +75,7 @@ module UnitTests
|
|||
def generate
|
||||
rails_new
|
||||
fix_available_locales_warning
|
||||
remove_bootsnap
|
||||
write_database_configuration
|
||||
|
||||
if bundle.version_of("rails") >= 5
|
||||
|
@ -98,6 +99,16 @@ end
|
|||
end
|
||||
end
|
||||
|
||||
def remove_bootsnap
|
||||
# Rails 5.2 introduced bootsnap, which is helpful when you're developing
|
||||
# or deploying an app, but we don't really need it (and it messes with
|
||||
# Zeus anyhow)
|
||||
fs.comment_lines_matching(
|
||||
'config/boot.rb',
|
||||
%r{\Arequire 'bootsnap/setup'},
|
||||
)
|
||||
end
|
||||
|
||||
def write_database_configuration
|
||||
YAML.dump(database.config.to_hash, fs.open('config/database.yml', 'w'))
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue