trix-genius 0.0.9 → 0.0.11
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 +6 -6
- 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: baaf509c27813f29f422005956926f5867d8c871d718cfdfff70758a2bbe1da4
|
4
|
+
data.tar.gz: 1285ce3f39c78cbe26baf9666e0b4c15770b010d27bafcdef827802b44018777
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0939fff0b6691f87db1c615503b9de5744e95a8b892bdfa6d666bb3025d296eca8c3baf27a709ad41430928d8c71a4949f863ebbd4f0edadf83224a0f6d27880'
|
7
|
+
data.tar.gz: 68bdea101e83fe38d68afa5d694d059d72e93bccabb508df3da351e8fcc73a33eea2b2d3e99bb8afe6a9c977bfeda9061c1a540f5eb241ac36b529f1f8efb2f8
|
@@ -20,9 +20,9 @@ module TrixGenius
|
|
20
20
|
application_lines << "import \"trix\""
|
21
21
|
application_lines << "import \"@rails/actiontext\""
|
22
22
|
|
23
|
-
if File.
|
23
|
+
if File.exist?(js_application_path)
|
24
24
|
application_file = File.read(js_application_path)
|
25
|
-
update_file application_lines, application_file
|
25
|
+
update_file application_lines, application_file, js_application_path
|
26
26
|
else
|
27
27
|
say_status("error", "Could not find #{js_application_path}", :red)
|
28
28
|
end
|
@@ -33,9 +33,9 @@ module TrixGenius
|
|
33
33
|
application_controller_lines << "import TrixController from \"controllers/trix-controller\""
|
34
34
|
application_controller_lines << "application.register(\"trix\", TrixController)"
|
35
35
|
|
36
|
-
if File.
|
36
|
+
if File.exist?(js_application_controller_path)
|
37
37
|
application_controller_file = File.read(js_application_controller_path)
|
38
|
-
update_file application_controller_lines, application_controller_file
|
38
|
+
update_file application_controller_lines, application_controller_file, js_application_controller_path
|
39
39
|
else
|
40
40
|
say_status("error", "Could not find #{js_application_path}", :red)
|
41
41
|
end
|
@@ -45,10 +45,10 @@ module TrixGenius
|
|
45
45
|
copy_file "trix_genius_controller.js", "app/javascript/controllers/trix_genius_controller.js"
|
46
46
|
end
|
47
47
|
|
48
|
-
def update_file lines, file_content
|
48
|
+
def update_file lines, file_content, path
|
49
49
|
lines.each do |line|
|
50
50
|
unless application_file.include?(line)
|
51
|
-
append_to_file
|
51
|
+
append_to_file path, "\n#{line}\n"
|
52
52
|
else
|
53
53
|
say_status("skipped", "Import already present in application.js", :yellow)
|
54
54
|
end
|