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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df864c72b8d47ff6e08332fe9df58a1540a19dba41c0c1c66a90bb0257572f5a
4
- data.tar.gz: cd0d0f7f000e32edb7c9e8afc945407370718aded879322c74fd346304660a3c
3
+ metadata.gz: 87e632d9075cba7b12f2a9d4f37654dbf5c38503d4d037916f70956db5831da6
4
+ data.tar.gz: a004d0304531b5f591b1c7cf55cf57c188edb1fa0969ab3c1b86dd340f9a1c69
5
5
  SHA512:
6
- metadata.gz: 80629c20d8551b7c07528c49a6eac833065e743b9e75fbbdceab58eddc06dd7792d7a648ff63cda66d81e39d9a0d82bc14abd38abf5adfe001774ddd9810b1a6
7
- data.tar.gz: ca790a7b34a26af218c14798228fc2c005649d9e11da611680871e52d082dec192e755398f90cebc9e2a0ae4ca0c9ff82b7b923b0deb997ea34b448a79c78270
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
- # Match-by-path detection keys on this value across every event key.
19
- HOOK_COMMAND = HOOK_SCRIPT_PATH
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"] == HOOK_COMMAND
81
+ hook.is_a?(Hash) && HOOK_COMMANDS.include?(hook["command"])
74
82
  end
75
83
  end
76
84
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-informant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel López Prat