trix-genius 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/trix_genius/install_generator.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5fefe1165c4da04776c26bd111fd8d8c1cff35f02ec09a6701c73b73b5f73d4
|
4
|
+
data.tar.gz: 1b999ec5cd7a8f222ba686bb13d69f05fe568e220f84edc5f3b54da8fb0f2775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c90aa3173acc0ee03069c14b1631f335e526b06961e760b7a8112d9cdd45c3589953fd1141f24db71f00f8765298467174b18b0aa8e9c5fceac6c3911109e2fa
|
7
|
+
data.tar.gz: 954827de8a41678ed79e986d9553e6bbeacbe93b4e2bc1269f2e1afcb3b3f071f193566c6b587acb2c8d953954075fc247eb557fb3a632f606f50854bd88b1d9
|
@@ -15,7 +15,10 @@ module TrixGenius
|
|
15
15
|
|
16
16
|
def add_import_to_application_js
|
17
17
|
js_application_path = "app/javascript/application.js"
|
18
|
-
application_lines = [
|
18
|
+
application_lines = []
|
19
|
+
application_lines << "import \"controllers\""
|
20
|
+
application_lines << "import \"trix\""
|
21
|
+
application_lines << "import \"@rails/actiontext\""
|
19
22
|
|
20
23
|
if File.exists?(js_application_path)
|
21
24
|
application_file = File.read(js_application_path)
|
@@ -24,9 +27,11 @@ module TrixGenius
|
|
24
27
|
say_status("error", "Could not find #{js_application_path}", :red)
|
25
28
|
end
|
26
29
|
|
27
|
-
|
28
30
|
js_application_controller_path ="app/javascript/controllers/application.js"
|
29
|
-
|
31
|
+
|
32
|
+
application_controller_lines = []
|
33
|
+
application_controller_lines << "import TrixController from \"controllers/trix-controller\""
|
34
|
+
application_controller_lines << "application.register(\"trix\", TrixController)"
|
30
35
|
|
31
36
|
if File.exists?(js_application_controller_path)
|
32
37
|
application_controller_file = File.read(js_application_controller_path)
|