recurrence_ui 0.2.0 → 0.2.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 20647bab22cceca506089a2396bd2b3105a1cac2595d8fd17834e60db04fc862
|
|
4
|
+
data.tar.gz: 1c0f8adca5ab3cf2196e7bef7e5b3819b8ac263e80e9f99104b483e574595585
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19b24fe598939465aab719d3080017e0f11fed41a8fc9cd3ab70a967656b1bc45629f7278daf5d27bc1655d53522da125cd912302c77a14def6f00b289714114
|
|
7
|
+
data.tar.gz: d21393711d67f282b4431abcbed85b6eca87d2a55b1d91f7b3ab8415c9d54a1f8ddf0d7a9791cc6fdf4a960f64d052124f0a40134cdddfe14f5030642b53645d
|
|
@@ -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
|
data/lib/recurrence_ui/engine.rb
CHANGED
|
@@ -6,11 +6,11 @@ module RecurrenceUi
|
|
|
6
6
|
isolate_namespace RecurrenceUi
|
|
7
7
|
|
|
8
8
|
# 1. Add importmap support for the gem
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
initializer "recurrence_ui.importmap", before: "importmap" do |app|
|
|
10
|
+
if app.config.respond_to?(:importmap)
|
|
11
|
+
app.config.importmap.paths << Engine.root.join("config/importmap.rb")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
14
|
|
|
15
15
|
# 2. Assets (только стили и картинки, если нужны, т.к. JS обслуживает Importmap)
|
|
16
16
|
initializer "recurrence_ui.assets" do |app|
|
|
@@ -21,7 +21,7 @@ module RecurrenceUi
|
|
|
21
21
|
|
|
22
22
|
# 3. i18n locales
|
|
23
23
|
initializer "recurrence_ui.locales" do |app|
|
|
24
|
-
config.i18n.load_path += Dir[Engine.root.join("config", "locales", "*.{rb,yml}")]
|
|
24
|
+
app.config.i18n.load_path += Dir[Engine.root.join("config", "locales", "*.{rb,yml}")]
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
# Add components to the global ViewComponent / ActionView search
|
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.
|
|
4
|
+
version: 0.2.2
|
|
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
|