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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 955281614bf30144cc9ab808bc425aa3ef9a7217f54fda216fbc1666e159a282
4
- data.tar.gz: 4dcfafc1e22d19472464da79de5765b02a4f9e0540e9d2ff16ee7527110d2924
3
+ metadata.gz: 52c961b4ce8e667ce8e728098f63a210fb82aaee03d63d573ef87d692c007875
4
+ data.tar.gz: 6e33c899e93f039bf5d318a0ac1492efa45329b99bbe4e700f17b37d4240818e
5
5
  SHA512:
6
- metadata.gz: 1dbbd4877f1a84a8770f5b9175920ca5060e7b26b7acf23f1006094a33287ff41525ebef847ee0ebf50f22e94f14f2c20755621f503df9941cf2b8649b82e110
7
- data.tar.gz: 0be714620546fc53ba039b417b0b6d85627346da8bb60acd6432f6e058ab650f20c3b0ec70f367972056dd0a7c1731244da5732bb0a572ae0047d6d1a46d535e
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 (runs before each request in development)
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
- view_path = Magick::AdminUI::Engine.root.join('app', 'views').to_s
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)
@@ -1,19 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'admin_ui/engine'
4
- # Controllers are in app/controllers and will be auto-loaded by Rails engine
5
- # But we explicitly require them to ensure they're available when needed
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Magick
4
- VERSION = '0.9.25'
4
+ VERSION = '0.9.26'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magick-feature-flags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.25
4
+ version: 0.9.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Lobanov