From 95e00befbc2fe46aafb15046ac229884688f677d Mon Sep 17 00:00:00 2001 From: Vinicius Brasil Date: Sun, 27 Jan 2019 22:30:17 -0200 Subject: Add line break to Action Text installation outputs The Action Text installations appends `require("trix")` to the application.js file. The problem is that there isn't a line break in the beginning of the installation output, leading to syntax errors, e.g.: ``` import './application.scss'require("trix") ``` This commit moves the line break from the end to the beginning of the output, fixing it to: ``` import './application.scss' require("trix") ``` --- actiontext/lib/templates/installer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actiontext/lib') diff --git a/actiontext/lib/templates/installer.rb b/actiontext/lib/templates/installer.rb index 990e41ca00..a8000eb9fc 100644 --- a/actiontext/lib/templates/installer.rb +++ b/actiontext/lib/templates/installer.rb @@ -26,7 +26,7 @@ if APPLICATION_PACK_PATH.exist? line = %[require("#{name}")] unless APPLICATION_PACK_PATH.read.include? line say "Adding #{name} to #{APPLICATION_PACK_PATH}" - append_to_file APPLICATION_PACK_PATH, "#{line}\n" + append_to_file APPLICATION_PACK_PATH, "\n#{line}" end end end -- cgit v1.2.3