Skip to content

Commit f74f531

Browse files
Merge pull request #1182 from rails/use-inject_into_file
Use inject_into_file to support rails 4.2
2 parents e5a3cd2 + c1275f2 commit f74f531

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/install/template.rb

+4-8
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@
1717
run "bundle binstubs webpacker"
1818

1919
say "Adding configurations"
20-
environment <<CONFIG, env: :development
21-
# Verifies that versions and hashed value of the package contents in the project's package.json
22-
config.webpacker.check_yarn_integrity = true
23-
CONFIG
24-
environment <<CONFIG, env: :production
25-
# Verifies that versions and hashed value of the package contents in the project's package.json
26-
config.webpacker.check_yarn_integrity = false
27-
CONFIG
20+
21+
# Verifies that versions and hashed value of the package contents in the project's package.json
22+
inject_into_file "config/environments/development.rb", " config.webpacker.check_yarn_integrity = true", after: "Rails.application.configure do\n", verbose: false
23+
inject_into_file "config/environments/production.rb", " config.webpacker.check_yarn_integrity = false", after: "Rails.application.configure do\n", verbose: false
2824

2925
if File.exists?(".gitignore")
3026
append_to_file ".gitignore", <<-EOS

0 commit comments

Comments
 (0)