debug_socket 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b7f1a18c4ecb7f04d0f17e7c26e3b8d2e0265207989726816e3e9bcd089040f
4
- data.tar.gz: ad6e65c6e9c9c081f49b22a2cefb4a3a0811af1eaed3e65afce632d701d1262e
3
+ metadata.gz: 92e2954364c7dd4e35377fcf428a18359e1f0e08155976d3991d39b9c64445ae
4
+ data.tar.gz: 5c970a58fca9e9c995b0223b988c48b2aea894906161bd336e566b4fbbdcab5f
5
5
  SHA512:
6
- metadata.gz: 5eda6e53855205fb1567255e66d104f1b3705b177035502af5b24d1e0bedd429933fd6f1c554d6672809185f2531373137bc0eb7d915a820863b5e85de81e156
7
- data.tar.gz: 0db71fb30f270ca9eb4bbc6c39463d17119f453c37a390983f7b08235fb940ae02f97cfb90c6bb94b1b57c2810e0173bc159524b3a6672355eb4b49bfedd2de1
6
+ metadata.gz: 603356c14c52452afcd8453a26dd657a0ef033b09f7b3df3ad0f50425ef9ea08d14998f430aceb1e85dc57d7819f7391acce142efc1466bbd4ede6ed758e1ac2
7
+ data.tar.gz: 11ff34cbba7b9a01f7632fa59b5893427c8eeb2782387198946eb792724791c6c0cd7f9dded065c8934e8e3dc43b601d6cef6db081d2abf3b19113630ac05a1c
data/CHANGES.md CHANGED
@@ -1,4 +1,9 @@
1
- ### 0.1.7 20202-01-09
1
+ ### 0.1.8 2022-10-10
2
+
3
+ - [#15](https://github.com/square/debug_socket/pull/15)
4
+ Remove socat dependency in debug-socket script.
5
+
6
+ ### 0.1.7 2020-01-09
2
7
 
3
8
  - [#11](https://github.com/square/debug_socket/pull/11)
4
9
  Properly escape command when sent to socket.
data/README.md CHANGED
@@ -63,9 +63,9 @@ spec/debug_socket_spec.rb:48:in `sleep'
63
63
  spec/debug_socket_spec.rb:48:in `block (4 levels) in <top (required)>'
64
64
  ```
65
65
 
66
- The gem also provides a helper script that wraps the above command. The
67
- `debug-socket` script takes one argument, the path to the unix socket, and it
68
- will run the `backtrace` command through that socket.
66
+ The gem also provides a script. The `debug-socket` script takes one argument,
67
+ the path to the unix socket, and it will run the `backtrace` command through
68
+ that socket.
69
69
 
70
70
  ```
71
71
  % debug-socket ~/tmp/puma-debug-1234.sock
data/exe/debug-socket CHANGED
@@ -2,16 +2,21 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "shellwords"
5
+ require "socket"
5
6
 
6
7
  if ARGV[0].nil? || ARGV[0].empty? || ARGV[0] == "-h" || ARGV[0] == "--help"
7
8
  puts "\nUsage: debug-socket <socket-path> [<command>=backtrace]"
8
9
  exit 1
9
10
  end
10
11
 
11
- socket = ARGV[0]
12
+ socket_path = ARGV[0]
12
13
  command = ARGV[1] || "backtrace"
13
14
 
14
- warn "\nSending `#{command}` to the following socket: #{socket}"\
15
+ warn "\nSending `#{command}` to the following socket: #{socket_path}"\
15
16
  "----------------------------------------------------------\n\n"
16
17
 
17
- Kernel.exec("echo #{Shellwords.escape(command)} | socat - UNIX-CONNECT:#{socket}")
18
+ UNIXSocket.open(socket_path) do |socket|
19
+ socket.write(command)
20
+ socket.close_write
21
+ puts socket.read
22
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DebugSocket
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debug_socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Lazarus
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-09 00:00:00.000000000 Z
11
+ date: 2022-10-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description:
14
14
  email:
15
15
  - lazarus@squareup.com
16
16
  executables:
@@ -36,7 +36,7 @@ files:
36
36
  homepage: https://github.com/square/debug_socket
37
37
  licenses: []
38
38
  metadata: {}
39
- post_install_message:
39
+ post_install_message:
40
40
  rdoc_options: []
41
41
  require_paths:
42
42
  - lib
@@ -51,8 +51,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  requirements: []
54
- rubygems_version: 3.0.3
55
- signing_key:
54
+ rubygems_version: 3.3.3
55
+ signing_key:
56
56
  specification_version: 4
57
57
  summary: Debug Socket for running ruby processes
58
58
  test_files: []