Commit 2ecec4a
Fix shakapacker hook detection to support symbol keys and prevent false positives
Improvements:
- Support both symbol and string keys in config data (shakapacker uses symbols internally)
- Use word boundary regex to prevent matching similar task names
- Add safe navigation operator for better nil handling
- Document why private :data method is accessed
- Add tests for both key types and false positive prevention
This ensures the hook detection works correctly with shakapacker's actual config format.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 922ebfb commit 2ecec4a
File tree
2 files changed
+31
-8
lines changed- lib/react_on_rails
- spec/react_on_rails
2 files changed
+31
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
175 | 177 | | |
176 | | - | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
| 180 | + | |
179 | 181 | | |
180 | | - | |
181 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
182 | 187 | | |
183 | 188 | | |
184 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
162 | 171 | | |
163 | 172 | | |
164 | 173 | | |
| |||
168 | 177 | | |
169 | 178 | | |
170 | 179 | | |
171 | | - | |
| 180 | + | |
172 | 181 | | |
173 | 182 | | |
174 | 183 | | |
| |||
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
181 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
182 | 199 | | |
183 | 200 | | |
184 | 201 | | |
| |||
191 | 208 | | |
192 | 209 | | |
193 | 210 | | |
194 | | - | |
| 211 | + | |
195 | 212 | | |
196 | 213 | | |
197 | 214 | | |
| |||
238 | 255 | | |
239 | 256 | | |
240 | 257 | | |
| 258 | + | |
0 commit comments