command_deck 0.3.0 → 0.3.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: 403635cfced62de1e01f415368f926475937db69e83dda253283113d4f76f9cb
4
- data.tar.gz: edf5c2cc7371c6dd4da4a4a577292db53a821f2345c54631c16340323c20a7e6
3
+ metadata.gz: 990b9baead655bf1d768061f4df0d19491dd85b4834e9f6989b7a6a81a866ca1
4
+ data.tar.gz: 5864197d0b142338c5183f0a2fbd8ba4a0952fe20d011fbd88c9922305a561ce
5
5
  SHA512:
6
- metadata.gz: d27d8c3b933ea5069861055644f5db6122fde71de4207ad2fd7c32ff6fbb56110de8c3632983cc0cd387680c6c88d8d65d6ef10ca634ea6904e4d797d533d9bd
7
- data.tar.gz: 31a9bab9bd5bf4025b292c565c0f04118fc09eb51d3473dabe671b523885966f91374a5c840d4fce710a10132ff3c276cba670ccb8cf4169efcae1107cea30ae
6
+ metadata.gz: 1c7c1d4813248bb98accc8a5068c981e03ea5230ba7bb34de805edff11e860978c93d7e8d8885f0bce954b4b03db0409e92e1fe90b79e73c9e5ec98e770056c4
7
+ data.tar.gz: 0bb4c80779c05f94eefbc66e6f9182e64004f2c991b137b270c7d0a97f55d2a6ea80faf29ce0029f857881965187ec92ef1ad7be1818d6b2b5746533b07c07ce
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## [0.3.1] - 2025-10-10
4
+
5
+ ### Fixed
6
+
7
+ - Fixed bugs related to the load of panels and middleware insertion.
8
+
3
9
  ## [0.3.0] - 2025-10-10
4
10
 
5
11
  ### Added
@@ -9,7 +9,7 @@ module CommandDeck
9
9
  isolate_namespace CommandDeck
10
10
 
11
11
  initializer "command_deck.add_autoload_paths", before: :set_autoload_paths do |app|
12
- discover_panel_paths.each do |path|
12
+ Engine.discover_panel_paths.each do |path|
13
13
  app.config.autoload_paths << path.to_s unless app.config.autoload_paths.include?(path.to_s)
14
14
  end
15
15
  end
@@ -27,28 +27,35 @@ module CommandDeck
27
27
  next unless Rails.env.development?
28
28
  next unless ENV.fetch("COMMAND_DECK_ENABLED", "false") == "true"
29
29
 
30
- unless app.config.middleware.include?(CommandDeck::Middleware)
31
- app.config.middleware.insert_after(
32
- ActionDispatch::DebugExceptions,
33
- CommandDeck::Middleware
34
- )
35
- end
30
+ app.config.middleware.insert_after(
31
+ ActionDispatch::DebugExceptions,
32
+ CommandDeck::Middleware
33
+ )
36
34
  end
37
35
 
38
36
  config.to_prepare do
39
37
  next unless Rails.env.development?
40
38
 
41
39
  CommandDeck::Registry.clear!
40
+
41
+ Engine.discover_panel_paths.each do |path|
42
+ Dir.glob(path.join("**/*.rb")).each do |file|
43
+ require_dependency file
44
+ rescue LoadError, NameError => e
45
+ Rails.logger.warn "[CommandDeck] Could not load panel #{file}: #{e.message}"
46
+ end
47
+ end
48
+
42
49
  CommandDeck.register_all_panels!
43
50
  end
44
51
 
45
52
  class << self
46
- private
47
-
48
53
  def discover_panel_paths
49
54
  [discover_app_panels, discover_pack_panels].flatten.compact.uniq
50
55
  end
51
56
 
57
+ private
58
+
52
59
  def discover_app_panels
53
60
  path = Rails.root.join("app/command_deck")
54
61
  path if path.exist?
@@ -58,7 +65,10 @@ module CommandDeck
58
65
  packs_path = Rails.root.join("packs")
59
66
  return [] unless packs_path.exist?
60
67
 
61
- Dir.glob(packs_path.join("**/command_deck")).select { |dir| Pathname.new(dir).directory? }
68
+ Dir.glob(packs_path.join("**/command_deck")).each_with_object([]) do |dir, result|
69
+ path = Pathname.new(dir)
70
+ result << path if path.directory?
71
+ end
62
72
  end
63
73
  end
64
74
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CommandDeck
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: command_deck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - crowrojas