pry-shell 0.4.1 → 0.5.0

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: 7ca5d9147b6818a50cab7d99b12452420053564e4fd09f25b007693a043e9ab7
4
- data.tar.gz: e1aef7a03b4c1ed8b7cbe786da99335ed34014995c0abf045cee1f21a359bed4
3
+ metadata.gz: 4b7c98d15684726ac960299f6b91bce6e5baae12c6c72d97c211150647026fce
4
+ data.tar.gz: 6b39ad64506fdc162e6f19220067aaad25a44e431d8f93533a4ae6a0f1f90b3a
5
5
  SHA512:
6
- metadata.gz: fdd570f82dd49a3ef2436cb4d355f8dbf8093fe2e67e9d7de665642c919b9aa8ffa946fec75e273a51c2005f5755f14f3bb5e1adacb3a21f9d1b220d2f5b621b
7
- data.tar.gz: 055d2e42e2ee36529f0f6c44de96b49953ada94caea806d02e847f79e46b4bcffb314fe343acdc340cda7b43f55fb421305d9f77157732dd874ddf6ab1d3ecc2
6
+ metadata.gz: d534b80562457c6005d49be9551b59dcc26127d1cdace9426fe17d76aeb45cd4bf1ff784d6cd8d1de3ca90390c699f0835c7f17573f216310840ee6aa5df5313
7
+ data.tar.gz: 0a82202c3e05b20767d063cb6537b687bf5eafc96a29928e6a51a92a95068a319c3251e5b58d0808639231caa86fbc4c8eb36f13daf8775176816e3ea119c967
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pry-shell (0.4.1)
4
+ pry-shell (0.5.0)
5
5
  pry (~> 0.13.0)
6
6
  tty-markdown
7
7
  tty-prompt
data/bin/console CHANGED
@@ -12,7 +12,7 @@ require "pry/shell"
12
12
  # Pry.start
13
13
 
14
14
  def foo1
15
- binding.pry_shell(with_byebug: true)
15
+ binding.pry_shell
16
16
 
17
17
  foo2
18
18
  end
data/lib/pry-shell.rb ADDED
@@ -0,0 +1 @@
1
+ require 'pry/shell'
data/lib/pry/shell/cli.rb CHANGED
@@ -29,8 +29,8 @@ class Pry
29
29
  Shell.configuration.port = arg
30
30
  end
31
31
 
32
- o.on "-a", "--auto-connect", "Connect automatically to the first Pry session" do
33
- Shell.configuration.auto_connect = true
32
+ o.on "--disable-auto-connect", "Disable auto connect feature" do
33
+ Shell.configuration.auto_connect = false
34
34
  end
35
35
 
36
36
  o.on "-v", "--version", "Print version and exit" do
@@ -6,7 +6,7 @@ class Pry
6
6
  CONFIG_KEYS = {
7
7
  host: "localhost",
8
8
  port: "1881",
9
- auto_connect: false
9
+ auto_connect: true
10
10
  }.freeze
11
11
 
12
12
  CONFIG_KEYS.each do |config_key, default_value|
@@ -4,7 +4,7 @@ class Pry
4
4
  class Shell
5
5
  module Patches
6
6
  module Object
7
- def pry_shell(host: DEFAULT_HOST, port: DEFAULT_PORT, with_byebug: false)
7
+ def pry_shell(host: DEFAULT_HOST, port: DEFAULT_PORT, with_byebug: true)
8
8
  Session.run(self, host: host, port: port, with_byebug: with_byebug)
9
9
  end
10
10
  end
@@ -58,7 +58,7 @@ begin
58
58
  end
59
59
 
60
60
  def start_with_pry_shell(target)
61
- if Shell.active_shell_options[:with_byebug]
61
+ if Shell.active_shell_options[:enable_byebug?]
62
62
  ::Byebug::PryShellProcessor.start
63
63
  else
64
64
  start_without_pry_byebug(target, Shell.active_shell_options)
@@ -37,7 +37,7 @@ class Pry
37
37
  # to setup the Byebug.
38
38
  # We are clearing this options in `PryShellProcessor` to ensure
39
39
  # they do not leak.
40
- Shell.clear_shell_options! unless with_byebug
40
+ Shell.clear_shell_options! unless enable_byebug?
41
41
  end
42
42
 
43
43
  private
@@ -47,7 +47,7 @@ class Pry
47
47
  def pry_options
48
48
  {
49
49
  remove_connection: -> { registry.remove(client) },
50
- with_byebug: with_byebug,
50
+ enable_byebug?: enable_byebug?,
51
51
  driver: Pry::Shell::Repl,
52
52
  pager: false,
53
53
  input: client.input,
@@ -57,6 +57,12 @@ class Pry
57
57
  }
58
58
  end
59
59
 
60
+ # Setting the `with_byebug` option as `true` is not enough as the
61
+ # `pry-byebug` gem can be missing which we are currently depending on.
62
+ def enable_byebug?
63
+ with_byebug && defined?(::Byebug::PryShellProcessor)
64
+ end
65
+
60
66
  def client
61
67
  @client ||= registry.register(id: id, **attributes)
62
68
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Pry
4
4
  class Shell
5
- VERSION = "0.4.1"
5
+ VERSION = "0.5.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Emin INAC
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-19 00:00:00.000000000 Z
11
+ date: 2021-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -71,6 +71,7 @@ files:
71
71
  - bin/console
72
72
  - bin/setup
73
73
  - exe/pry-shell
74
+ - lib/pry-shell.rb
74
75
  - lib/pry/shell.rb
75
76
  - lib/pry/shell/cli.rb
76
77
  - lib/pry/shell/client.rb