Skip to content

Commit e07c944

Browse files
committed
fix: output method to use IO.popen for better handling of arguments
1 parent c25040e commit e07c944

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
cr-exec (0.2.0)
4+
cr-exec (0.2.1)
55

66
GEM
77
remote: https://rubygems.org/

lib/cr/exec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ def code(...)
2121
127
2222
end
2323

24-
def output(*args, chomp: true)
25-
command = args.join(" ")
26-
output = `#{command}`
24+
def output(*args, chomp: true, **options)
25+
output = IO.popen(*args, **options).read
2726
return output.chomp if chomp
2827

2928
output

lib/cr/exec/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Cr
44
module Exec
5-
VERSION = "0.2.0"
5+
VERSION = "0.2.1"
66
end
77
end

0 commit comments

Comments
 (0)