rails-informant 0.5.2 → 0.5.3
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/rails_informant/claude_integration_content.rb +11 -3
- 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: 87e632d9075cba7b12f2a9d4f37654dbf5c38503d4d037916f70956db5831da6
|
|
4
|
+
data.tar.gz: a004d0304531b5f591b1c7cf55cf57c188edb1fa0969ab3c1b86dd340f9a1c69
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 938408a0098cc497a2498bd6ac34ff70b1b69740d81647f5a32b997c227d5e2bee260d6f7d7737d26ae92dff5aeb17ba70c78fc530d4b146732b3f0bd251c137
|
|
7
|
+
data.tar.gz: 2e8a5894b1c1c9f3e4129c813c3717d78c2ecf0c31a338bbf15843044684123d614f465ebf1fe389bf0d433b6ae453d83c4fb1927e8a46f594c790f1270c035b
|
|
@@ -15,8 +15,16 @@ module RailsInformant
|
|
|
15
15
|
MCP_PATH = ".mcp.json"
|
|
16
16
|
|
|
17
17
|
# The command string a settings.json hook entry uses to invoke the script.
|
|
18
|
-
#
|
|
19
|
-
|
|
18
|
+
# Absolute via Claude Code's $CLAUDE_PROJECT_DIR because the hook's cwd is
|
|
19
|
+
# not guaranteed to be the app root: a bare relative path fails on every
|
|
20
|
+
# prompt with "No such file or directory". Quoted as written — the expansion
|
|
21
|
+
# can contain spaces.
|
|
22
|
+
HOOK_COMMAND = %("$CLAUDE_PROJECT_DIR"/#{HOOK_SCRIPT_PATH})
|
|
23
|
+
|
|
24
|
+
# Every command form informant has ever written. Match-by-path detection
|
|
25
|
+
# keys on this list across every event key, so a re-run migrates an install
|
|
26
|
+
# registered by an older gem instead of appending a second entry beside it.
|
|
27
|
+
HOOK_COMMANDS = [ HOOK_COMMAND, HOOK_SCRIPT_PATH ].freeze
|
|
20
28
|
|
|
21
29
|
# The event key the current gem registers the hook under.
|
|
22
30
|
HOOK_EVENT = "UserPromptSubmit"
|
|
@@ -70,7 +78,7 @@ module RailsInformant
|
|
|
70
78
|
# registrations) and detection (to extract the informant fragment).
|
|
71
79
|
def informant_hook_entry?(entry)
|
|
72
80
|
entry.is_a?(Hash) && Array(entry["hooks"]).any? do |hook|
|
|
73
|
-
hook.is_a?(Hash) && hook["command"]
|
|
81
|
+
hook.is_a?(Hash) && HOOK_COMMANDS.include?(hook["command"])
|
|
74
82
|
end
|
|
75
83
|
end
|
|
76
84
|
end
|