Sha256: 925b83d143cf23ff85313c7e4b15e0e60ef5b9b4836dfd4c95c0b42b861fe927

Contents?: true

Size: 551 Bytes

Versions: 1

Compression:

Stored size: 551 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "shellwords"
require "socket"

if ARGV[0].nil? || ARGV[0].empty? || ARGV[0] == "-h" || ARGV[0] == "--help"
  puts "\nUsage: debug-socket <socket-path> [<command>=backtrace]"
  exit 1
end

socket_path = ARGV[0]
command = ARGV[1] || "backtrace"

warn "\nSending `#{command}` to the following socket: #{socket_path}"\
  "----------------------------------------------------------\n\n"

UNIXSocket.open(socket_path) do |socket|
  socket.write(command)
  socket.close_write
  puts socket.read
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
debug_socket-0.1.8 exe/debug-socket