trix-genius 0.0.10 → 0.0.12
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 +5 -5
- 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: 12c330540b0ad83c3419f7f3504189f7990b6bc69d28d721e35265bb1f252d30
|
4
|
+
data.tar.gz: e7014dd5db388632445e0c362cf4430ce89106cfe8b1e309edd8150ff186889b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b284e6d6b25567262adc270289b393a2d64752592e80ca8bca0a96b2ec7d6b7ca464a6dd5dc98a30cf6381f0e1e7de2853478a13d76b834b6bb5723c51bd4f27
|
7
|
+
data.tar.gz: 0705a76cc11e399ec8951c39616de7344d6f1acd415ef2accc81a482611fa3e2e4b160478a4087f07fcfe7eb45d76c6e3e2abe995b552426ea1ad8130537d6ea
|
@@ -22,7 +22,7 @@ module TrixGenius
|
|
22
22
|
|
23
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
|
@@ -35,7 +35,7 @@ module TrixGenius
|
|
35
35
|
|
36
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,
|
48
|
+
def update_file lines, content, path
|
49
49
|
lines.each do |line|
|
50
|
-
unless
|
51
|
-
append_to_file
|
50
|
+
unless content.include?(line)
|
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
|