debug_socket 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d939e097db34d5c7709ceb2f664ea2cf22b4563ab98dbb27de42c8fb1a504299
4
- data.tar.gz: 9ec57072163a47f15f1d85d024f08b5f8e665d7e50ff8f98443a676ea0513a03
3
+ metadata.gz: 92e2954364c7dd4e35377fcf428a18359e1f0e08155976d3991d39b9c64445ae
4
+ data.tar.gz: 5c970a58fca9e9c995b0223b988c48b2aea894906161bd336e566b4fbbdcab5f
5
5
  SHA512:
6
- metadata.gz: 60ed0860c5525b41357aa9210f0341ee1dc07b9140bf51326d7d140a0e56aadd856117e2a21e2c50aa2666a9e9ee3161cb4daed8121478ef0b943a04ba5e3bce
7
- data.tar.gz: 61520fe5be839d09dd9623ca0b9e376da3f0faef80c2ec040413c9eea97e885d1c978bad96038319fc146942faa784add4ee6b4b949f061797e19dabee49f000
6
+ metadata.gz: 603356c14c52452afcd8453a26dd657a0ef033b09f7b3df3ad0f50425ef9ea08d14998f430aceb1e85dc57d7819f7391acce142efc1466bbd4ede6ed758e1ac2
7
+ data.tar.gz: 11ff34cbba7b9a01f7632fa59b5893427c8eeb2782387198946eb792724791c6c0cd7f9dded065c8934e8e3dc43b601d6cef6db081d2abf3b19113630ac05a1c
data/CHANGES.md CHANGED
@@ -1,3 +1,14 @@
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
7
+
8
+ - [#11](https://github.com/square/debug_socket/pull/11)
9
+ Properly escape command when sent to socket.
10
+ ([@drcapulet])
11
+
1
12
  ### 0.1.6 2018-09-20
2
13
  - Update rubocop
3
14
  - Check socket existence before closing
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
@@ -1,15 +1,22 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ require "shellwords"
5
+ require "socket"
6
+
4
7
  if ARGV[0].nil? || ARGV[0].empty? || ARGV[0] == "-h" || ARGV[0] == "--help"
5
8
  puts "\nUsage: debug-socket <socket-path> [<command>=backtrace]"
6
9
  exit 1
7
10
  end
8
11
 
9
- socket = ARGV[0]
12
+ socket_path = ARGV[0]
10
13
  command = ARGV[1] || "backtrace"
11
14
 
12
- warn "\nSending `#{command}` to the following socket: #{socket}"\
15
+ warn "\nSending `#{command}` to the following socket: #{socket_path}"\
13
16
  "----------------------------------------------------------\n\n"
14
17
 
15
- Kernel.exec("echo #{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.6"
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.6
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: 2018-09-20 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,9 +51,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  requirements: []
54
- rubyforge_project:
55
- rubygems_version: 2.7.6
56
- signing_key:
54
+ rubygems_version: 3.3.3
55
+ signing_key:
57
56
  specification_version: 4
58
57
  summary: Debug Socket for running ruby processes
59
58
  test_files: []