diff options
author | Vinicius Brasil <marcosbrasilaraujo@gmail.com> | 2019-01-27 22:30:17 -0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-27 22:30:17 -0200 |
commit | 95e00befbc2fe46aafb15046ac229884688f677d (patch) | |
tree | ce3c9f9bda3b65e3b4a8fe8b0ebcbf76a84bd0f3 | |
parent | 1d26c86b8611bb37f5641d4f3e3e94d8675eba1d (diff) | |
download | rails-95e00befbc2fe46aafb15046ac229884688f677d.tar.gz rails-95e00befbc2fe46aafb15046ac229884688f677d.tar.bz2 rails-95e00befbc2fe46aafb15046ac229884688f677d.zip |
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")
```
-rw-r--r-- | actiontext/lib/templates/installer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |