recurrence_ui 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3df8d60f0c4274076f2e881c01637bae82eb69fa93f487142ba2d266baf08d5f
4
- data.tar.gz: 0dc39c04c65ada3574d5dc65bf94b9ba3bd85360c3fcdeaed01286940a2392ef
3
+ metadata.gz: 3e6f3005d6cd808a8fe574323a864f24fb6c17936e0e162227787cbbcf07d5ce
4
+ data.tar.gz: 687543fd54f2ff1e9a6e867734b19baf01be6d111bee6a5ded59268c75a8c5ec
5
5
  SHA512:
6
- metadata.gz: 93d48bf14b7ca821735df60e1daf8b2ea1fa96ad3c3c149ee5c7e07a3b43eb73e9c13a271b07f38bb34529d6caf0df7daf17ef65e3e301f9d7611ecfed9babe8
7
- data.tar.gz: e228889d001f2cc4cfb99635ac6d2c97d565ea300dcecdd0f019a5624bb8ae6f1437a1a73f30247b34b54ca161416a35edf403c688e1dae2adcf369498d6bcf9
6
+ metadata.gz: 1cb389646f40f9ec058b2f1c6cfa97f7986804a1c0751a3b815ff35c1468443df43334879476d17fe2546bb0a0b03be1b112b3be2e2e27756eb078f432a09e1b
7
+ data.tar.gz: 706ee82b13e5cd4e5208ed47060f70b6de1360c35a75ca44242bd3911af8e6727a2cd5cdc7bbe5cef82750c97afe376079aff243bc2935d8ba04afa622aa5f17
@@ -0,0 +1,30 @@
1
+ # recurrence_ui/lib/generators/recurrence_ui/install/install_generator.rb
2
+ module RecurrenceUi
3
+ module Generators
4
+ class InstallGenerator < Rails::Generators::Base
5
+ source_root File.expand_path("templates", __dir__)
6
+
7
+ desc "Installs RecurrenceUi JavaScript integration into the application"
8
+
9
+ def register_controller
10
+ app_js_path = Rails.root.join("app/javascript/application.js")
11
+
12
+ if File.exist?(app_js_path)
13
+ unless File.read(app_js_path).include?("recurrence_ui")
14
+ append_to_file "app/javascript/application.js", <<~JS
15
+
16
+ // Register RecurrenceUi Stimulus controller
17
+ import { registerRecurrenceUiController } from "recurrence_ui"
18
+ registerRecurrenceUiController(application)
19
+ JS
20
+ say "Added RecurrenceUi registration to app/javascript/application.js", :green
21
+ else
22
+ say "RecurrenceUi is already registered in app/javascript/application.js", :yellow
23
+ end
24
+ else
25
+ say "Could not find app/javascript/application.js. Please register RecurrenceUi manually.", :red
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,3 +1,3 @@
1
1
  module RecurrenceUi
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurrence_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katerina German
@@ -167,7 +167,7 @@ files:
167
167
  - config/locales/recurrence_ui.ru.yml
168
168
  - config/locales/recurrence_ui.uk.yml
169
169
  - config/routes.rb
170
- - lib/generators/recurrence_ui/install_generator.rb
170
+ - lib/generators/recurrence_ui/install/install_generator.rb
171
171
  - lib/generators/recurrence_ui/views_generator.rb
172
172
  - lib/recurrence_ui.rb
173
173
  - lib/recurrence_ui/configuration.rb
@@ -1,27 +0,0 @@
1
- # recurrence_ui/lib/generators/recurrence_ui/install_generator.rb
2
- module RecurrenceUi
3
- class InstallGenerator < Rails::Generators::Base
4
- desc "Installs RecurrenceUi JavaScript integration into the application"
5
-
6
- def register_controller
7
- app_js_path = Rails.root.join("app/javascript/application.js")
8
-
9
- if File.exist?(app_js_path)
10
- # Проверяем, не добавлен ли уже импорт, чтобы не дублировать
11
- unless File.read(app_js_path).include?("recurrence_ui")
12
- append_to_file "app/javascript/application.js", <<~JS
13
-
14
- // Register RecurrenceUi Stimulus controller
15
- import { registerRecurrenceUiController } from "recurrence_ui"
16
- registerRecurrenceUiController(application)
17
- JS
18
- say "Added RecurrenceUi registration to app/javascript/application.js", :green
19
- else
20
- say "RecurrenceUi is already registered in app/javascript/application.js", :yellow
21
- end
22
- else
23
- say "Could not find app/javascript/application.js. Please register RecurrenceUi manually.", :red
24
- end
25
- end
26
- end
27
- end