Skip to content

Instantly share code, notes, and snippets.

@siassaj
Created November 14, 2016 09:16
Show Gist options
  • Select an option

  • Save siassaj/b9aee59b0ff5be9f3ab55bae63eb9f3d to your computer and use it in GitHub Desktop.

Select an option

Save siassaj/b9aee59b0ff5be9f3ab55bae63eb9f3d to your computer and use it in GitHub Desktop.
def start
write_webpack_config
stdin, stdout_and_stderr, _ = Open3.popen2e(webpack_command)
begin
Timeout::timeout(1) {
while !stdout_and_stderr.eof?
puts stdout_and_stderr.read_nonblock(128)
end
}
rescue Timeout::Error
Signal.trap("INT") { exit }
retry
end
ensure
stdin.close
stdout_and_stderr.close
File.delete config_path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment