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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f78367d80e34ffed27c18d3dfea89c22f3efc65fde39b043ac07628d6715b9c
4
- data.tar.gz: 5b0e36dfdefe005810de67b5b41dcf4472b8e71744b325a2bdeab9be7bb42c6f
3
+ metadata.gz: 2f9a629aa438ee37cbeba5f9f4773b188e8df465c78847509c3892257408fa1d
4
+ data.tar.gz: '082b79f813e2e9d96fdf459f4d92113d5ec112897ddc4e04bda79c687e832fbb'
5
5
  SHA512:
6
- metadata.gz: d7d03a089b432e1e91c0a4210965d8faca9ef584d06d633fda07c8abace3e671962d38bff45b6d328fc3728075591a08c280659a5094714a66acaf42c5e4bd8e
7
- data.tar.gz: 392014b4371beace17450468b5d2000ea1fb48419a5af4dc39c6d9ad346ff91ddf4ff38d20b3a259608463dabe4220d61cf181eaa566f78a2d7cbe3f6fe4c93a
6
+ metadata.gz: 64daa0a9fc25ade4ed370e3940b60030afa3340856db5a28f7ff3c79c9b7533ce3579a9ed3f72faff4614b620b7c670c6d85814ac993867818f376b978f0dd7b
7
+ data.tar.gz: 19055e234eefd7d82e7c95dd1bc329e57b423a3bb85e4f88fa0c86e8fee164c73e5784b07fccd272766cb0f0991c2256f810720016ae3452ad1fb714dd0e9f0b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pry-shell (0.2.0)
4
+ pry-shell (0.2.1)
5
5
  pry (~> 0.13.0)
6
6
  tty-markdown
7
7
  tty-prompt
@@ -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
- "#{process_name} @#{host} - #{full_location}"
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
@@ -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
@@ -65,7 +65,12 @@ class Pry
65
65
  end
66
66
 
67
67
  def attributes
68
- { name: $PROGRAM_NAME, host: Socket.gethostname, location: object.source_location }
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Pry
4
4
  class Shell
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Emin INAC