magick-feature-flags 0.9.25 → 0.9.26
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/magick/admin_ui/engine.rb +22 -2
- data/lib/magick/admin_ui.rb +2 -13
- data/lib/magick/version.rb +1 -1
- 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: 52c961b4ce8e667ce8e728098f63a210fb82aaee03d63d573ef87d692c007875
|
|
4
|
+
data.tar.gz: 6e33c899e93f039bf5d318a0ac1492efa45329b99bbe4e700f17b37d4240818e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f854aa3d288dd2bf137fb56e69c58c2092ff1b5d76a8ce2c429f416416b758ab5d99e680efd3c704f084d08dc7b2a4bc2f161bed9431446609de1ebddec40f22
|
|
7
|
+
data.tar.gz: 98e43b058ed905b6bed109911e6649b8644c401681e269a6e406f41e49689992bed804488ab81f0ccafe4db7dcbc68ab45a88686a93f0ee10213f35b8a8f1c36
|
|
@@ -25,6 +25,16 @@ module Magick
|
|
|
25
25
|
# to ensure controllers are found
|
|
26
26
|
config.autoload_paths += %W[#{root}/app/controllers] if root.join('app', 'controllers').exist?
|
|
27
27
|
|
|
28
|
+
# Explicitly require controllers early to ensure they're loaded when gem is from RubyGems
|
|
29
|
+
# This initializer runs before routes are drawn
|
|
30
|
+
initializer 'magick.admin_ui.require_controllers', before: :load_config_initializers do
|
|
31
|
+
controller_path = root.join('app', 'controllers', 'magick', 'adminui', 'features_controller.rb')
|
|
32
|
+
require controller_path.to_s if controller_path.exist?
|
|
33
|
+
|
|
34
|
+
stats_controller_path = root.join('app', 'controllers', 'magick', 'adminui', 'stats_controller.rb')
|
|
35
|
+
require stats_controller_path.to_s if stats_controller_path.exist?
|
|
36
|
+
end
|
|
37
|
+
|
|
28
38
|
# Explicitly add app/views to view paths
|
|
29
39
|
# Rails engines should do this automatically, but we ensure it's configured
|
|
30
40
|
initializer 'magick.admin_ui.append_view_paths', after: :add_view_paths do |app|
|
|
@@ -39,9 +49,19 @@ module Magick
|
|
|
39
49
|
end
|
|
40
50
|
end
|
|
41
51
|
|
|
42
|
-
# Ensure view paths are added in to_prepare
|
|
52
|
+
# Ensure controllers are loaded and view paths are added in to_prepare
|
|
53
|
+
# This runs before each request in development and once at boot in production
|
|
43
54
|
config.to_prepare do
|
|
44
|
-
|
|
55
|
+
# Explicitly require controllers first to ensure they're loaded
|
|
56
|
+
# This is necessary when the gem is loaded from RubyGems
|
|
57
|
+
controller_path = root.join('app', 'controllers', 'magick', 'adminui', 'features_controller.rb')
|
|
58
|
+
require controller_path.to_s if controller_path.exist?
|
|
59
|
+
|
|
60
|
+
stats_controller_path = root.join('app', 'controllers', 'magick', 'adminui', 'stats_controller.rb')
|
|
61
|
+
require stats_controller_path.to_s if stats_controller_path.exist?
|
|
62
|
+
|
|
63
|
+
# Then add view paths
|
|
64
|
+
view_path = root.join('app', 'views').to_s
|
|
45
65
|
if File.directory?(view_path)
|
|
46
66
|
if defined?(Magick::AdminUI::FeaturesController)
|
|
47
67
|
Magick::AdminUI::FeaturesController.append_view_path(view_path)
|
data/lib/magick/admin_ui.rb
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative 'admin_ui/engine'
|
|
4
|
-
# Controllers are
|
|
5
|
-
#
|
|
6
|
-
if defined?(Rails) && Rails.env
|
|
7
|
-
# In Rails, controllers are auto-loaded from app/controllers
|
|
8
|
-
# But we can explicitly require them if needed for console access
|
|
9
|
-
engine_root = Magick::AdminUI::Engine.root
|
|
10
|
-
if engine_root.join('app', 'controllers', 'magick', 'adminui', 'features_controller.rb').exist?
|
|
11
|
-
require engine_root.join('app', 'controllers', 'magick', 'adminui', 'features_controller').to_s
|
|
12
|
-
end
|
|
13
|
-
if engine_root.join('app', 'controllers', 'magick', 'adminui', 'stats_controller.rb').exist?
|
|
14
|
-
require engine_root.join('app', 'controllers', 'magick', 'adminui', 'stats_controller').to_s
|
|
15
|
-
end
|
|
16
|
-
end
|
|
4
|
+
# Controllers are explicitly required in the Engine's config.to_prepare block
|
|
5
|
+
# This ensures they're loaded when the gem is used from RubyGems
|
|
17
6
|
require_relative 'admin_ui/helpers'
|
|
18
7
|
|
|
19
8
|
module Magick
|
data/lib/magick/version.rb
CHANGED