Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion binaryen.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/Shopify/binaryen-rb"
spec.platform = Gem::Platform::RUBY
spec.extensions = ["extconf.rb"]
spec.add_dependency("posix-spawn", "~> 0.3.15")
end
4 changes: 1 addition & 3 deletions lib/binaryen/command.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# frozen_string_literal: true

require "posix/spawn"
require "timeout"
require "tempfile"

module Binaryen
class Command
include POSIX::Spawn
DEFAULT_MAX_OUTPUT_SIZE = 256 * 1024 * 1024 * 1024 # 256 MiB
DEFAULT_TIMEOUT = 10
DEFAULT_ARGS_FOR_COMMAND = {}.freeze
Expand Down Expand Up @@ -44,7 +42,7 @@ def spawn_command(*args, stderr: nil, stdin: nil)

File.open(File::NULL, "w") do |devnull|
IO.pipe do |err_read, err_write|
pid = POSIX::Spawn.pspawn(
pid = Process.spawn(
*args,
"--output=#{tmpfile.path}",
in_write.path,
Expand Down