pry-shell 0.2.0 → 0.2.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/pry/shell/client.rb +10 -3
- data/lib/pry/shell/registry.rb +2 -2
- data/lib/pry/shell/session.rb +6 -1
- data/lib/pry/shell/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f9a629aa438ee37cbeba5f9f4773b188e8df465c78847509c3892257408fa1d
|
4
|
+
data.tar.gz: '082b79f813e2e9d96fdf459f4d92113d5ec112897ddc4e04bda79c687e832fbb'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64daa0a9fc25ade4ed370e3940b60030afa3340856db5a28f7ff3c79c9b7533ce3579a9ed3f72faff4614b620b7c670c6d85814ac993867818f376b978f0dd7b
|
7
|
+
data.tar.gz: 19055e234eefd7d82e7c95dd1bc329e57b423a3bb85e4f88fa0c86e8fee164c73e5784b07fccd272766cb0f0991c2256f810720016ae3452ad1fb714dd0e9f0b
|
data/Gemfile.lock
CHANGED
data/lib/pry/shell/client.rb
CHANGED
@@ -9,13 +9,16 @@ class Pry
|
|
9
9
|
# we should make sure the instance lives on the server.
|
10
10
|
include DRb::DRbUndumped
|
11
11
|
|
12
|
+
MAX_PROCESS_NAME = 50
|
13
|
+
|
12
14
|
attr_reader :id
|
13
15
|
|
14
|
-
def initialize(id, process_name, host, location)
|
16
|
+
def initialize(id, process_name, host, pid, location)
|
15
17
|
@id = id
|
16
18
|
@process_name = process_name
|
17
19
|
@host = host
|
18
20
|
@location = location
|
21
|
+
@pid = pid
|
19
22
|
@created_at = Time.now
|
20
23
|
end
|
21
24
|
|
@@ -36,7 +39,7 @@ class Pry
|
|
36
39
|
end
|
37
40
|
|
38
41
|
def to_s
|
39
|
-
"#{
|
42
|
+
"[#{pid}] \"#{humanized_process_name}\" @\"#{host}\" - #{full_location}"
|
40
43
|
end
|
41
44
|
|
42
45
|
def current?
|
@@ -45,11 +48,15 @@ class Pry
|
|
45
48
|
|
46
49
|
private
|
47
50
|
|
48
|
-
attr_reader :process_name, :host, :location, :created_at
|
51
|
+
attr_reader :process_name, :host, :pid, :location, :created_at
|
49
52
|
|
50
53
|
def full_location
|
51
54
|
location.join(":")
|
52
55
|
end
|
56
|
+
|
57
|
+
def humanized_process_name
|
58
|
+
process_name.length > MAX_PROCESS_NAME ? "#{process_name[0..50]}..." : process_name
|
59
|
+
end
|
53
60
|
end
|
54
61
|
end
|
55
62
|
end
|
data/lib/pry/shell/registry.rb
CHANGED
@@ -15,8 +15,8 @@ class Pry
|
|
15
15
|
@mutex = Mutex.new
|
16
16
|
end
|
17
17
|
|
18
|
-
def register(id:, name:, host:, location:)
|
19
|
-
Client.new(id, name, host, location).tap do |client|
|
18
|
+
def register(id:, name:, host:, pid:, location:)
|
19
|
+
Client.new(id, name, host, pid, location).tap do |client|
|
20
20
|
Logger.debug("New client connected - #{client}")
|
21
21
|
|
22
22
|
@clients[id] = client
|
data/lib/pry/shell/session.rb
CHANGED
@@ -65,7 +65,12 @@ class Pry
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def attributes
|
68
|
-
{
|
68
|
+
{
|
69
|
+
name: $PROGRAM_NAME,
|
70
|
+
host: Socket.gethostname,
|
71
|
+
pid: Process.pid,
|
72
|
+
location: object.source_location
|
73
|
+
}
|
69
74
|
end
|
70
75
|
|
71
76
|
def uri
|
data/lib/pry/shell/version.rb
CHANGED