Skip to content

Commit 4967229

Browse files
authored
feat(ruby): inject bash into builtin ways of running system commands (#14372)
1 parent 68f11f9 commit 4967229

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

runtime/queries/ruby/injections.scm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,15 @@
2121
(#set! injection.language "erb"))
2222
(#eq? @name "ERB"))
2323

24+
; `<command>`
25+
; %x{<command>}
26+
(subshell
27+
(string_content) @injection.content
28+
(#set! injection.language "bash"))
29+
30+
(call
31+
method: (identifier) @_method (#any-of? @_method "system" "spawn" "exec")
32+
arguments: (argument_list
33+
(string
34+
(string_content) @injection.content))
35+
(#set! injection.language "bash"))

0 commit comments

Comments
 (0)