legionio 1.6.30 → 1.6.31

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: 397996eada137bc261c132386c1ec4e5a09e8c560e1ce39566719140fd045778
4
- data.tar.gz: 4bedc4d2a46f064481aeba9cd29546600e585f29137861b95bc0a57fa9764d6e
3
+ metadata.gz: 56ff571f5c8480be8a6e783549dd9cd377805dd5590e0e07a7fa60f2f0da39da
4
+ data.tar.gz: 6d6251a3b04602caffb8e76b12fc1677c7caf1981a5e7f9cd73c1bea52bf97d6
5
5
  SHA512:
6
- metadata.gz: f407b39baba1f70752bb06c0cd83d5a757e14494a99c20e38fffa09197dbd0671ec25fe29974cafc9879138e1fa790272b0353bc73e92da46740515a23e827bc
7
- data.tar.gz: bfd023f353db135a04ce05871e097465210633fb8c8c85fe27403056051f19452c7eb883e9a4b6631826b5f766d82a16591e59aeafec466856e6608f56d334bd
6
+ metadata.gz: 9b40b7e385bfa89fd4642ea18bc0bc014ba6407dc182f3ffbb8462963e45c9afffa0471015cda08a77c78ad71eabb31709cfe69a967653ae531c3457e5b90419
7
+ data.tar.gz: c6fa233e90846bf0296f1f9ba3adf171d9ccfa34d224de96fcd721e1e013218c3cfc778988a80d661d57a93ca1002a1b57ffba0a75033aa40b657b1f92c2e9f3
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.6.31] - 2026-03-28
6
+
7
+ ### Fixed
8
+ - `build_hook_list` in `Builders::Hooks` now calls `runner_class` on a hook instance (instance method) instead of the class, preventing the `TypeError: no implicit conversion of nil into String` boot crash caused by `Helpers::Base#runner_class` being inherited at the class level and calling `sub!` on a string that contains no `'Actor'` substring
9
+ - `Helpers::Base#runner_class` changed `sub!` to `sub` (non-destructive) as a defensive fix — `sub!` returns `nil` when no substitution is made, which caused `Kernel.const_get(nil)` to raise `TypeError`
10
+ - Runner reference returned by `hook_class.new.runner_class` is now resolved safely: string class names are resolved via `Kernel.const_defined?` + `Kernel.const_get`; Class objects are used directly; `nil` falls back to `hook_class`
11
+
5
12
  ## [1.6.30] - 2026-03-28
6
13
 
7
14
  ### Fixed
@@ -29,7 +29,7 @@ module Legion
29
29
  next unless hook_class < Legion::Extensions::Hooks::Base
30
30
 
31
31
  route_path = "#{extension_name}/#{hook_name}"
32
- runner = hook_class.respond_to?(:runner_class) ? hook_class.runner_class : nil
32
+ runner = resolve_hook_runner(hook_class)
33
33
 
34
34
  @hooks[hook_name.to_sym] = {
35
35
  extension: lex_class.to_s.downcase,
@@ -61,6 +61,17 @@ module Legion
61
61
  def hook_files
62
62
  @hook_files ||= find_files('hooks')
63
63
  end
64
+
65
+ private
66
+
67
+ def resolve_hook_runner(hook_class)
68
+ ref = hook_class.new.runner_class
69
+ if ref.is_a?(String)
70
+ Kernel.const_defined?(ref) ? Kernel.const_get(ref) : nil
71
+ elsif ref.is_a?(Class)
72
+ ref
73
+ end
74
+ end
64
75
  end
65
76
  end
66
77
  end
@@ -83,7 +83,7 @@ module Legion
83
83
  end
84
84
 
85
85
  def runner_class
86
- @runner_class ||= Kernel.const_get(actor_class.to_s.sub!('Actor', 'Runners'))
86
+ @runner_class ||= Kernel.const_get(actor_class.to_s.sub('Actor', 'Runners'))
87
87
  end
88
88
 
89
89
  def runner_name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Legion
4
- VERSION = '1.6.30'
4
+ VERSION = '1.6.31'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legionio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.30
4
+ version: 1.6.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity