pry-debugger-jruby 1.0.0-java → 1.1.0-java

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
  SHA1:
3
- metadata.gz: 81ff16ce021c8e8175681bf7680c0aaf3265d74e
4
- data.tar.gz: 7a8faa1b0040ae47666c530080924cff69541c5e
3
+ metadata.gz: c487da46079e6318b389b2f3d27685e720d7cfe9
4
+ data.tar.gz: 2bb4cbd26d84c4ac9a26f1b065ce4af41be66f20
5
5
  SHA512:
6
- metadata.gz: 4226ab1696b4932d899e25b5886ced67d816c42b4531fff5ea488a23652a02ac083522b212dc8684f055113452d405872f18abf4c3338aa04eb6c341cd821e3f
7
- data.tar.gz: 7e13eee633369b8f0ed1745e5a934ee45b5406c6c9f3c9acd055180b4ef46877f4038f1bc8adfbdd17cf68a76a4d5c0a84c255426074cb5f08050cf2efecab45
6
+ metadata.gz: f6e33901b57631b130cb2efdcacb18866967434f58f13c597795b21f5ae94de5942d7de7ed9cfc9774600f43b5c95927b1c77dd72aeb43aea8ec2df1c8da0912
7
+ data.tar.gz: 1f49db5d4716dbeb307a98ddb4b048d5ba5fec4d9401c9353b5ed6bf4d68fc43cf82cda6d8c1b8815577d5ebf2635d5e3c8e9339cce1ae0d032da4c5c40913d3
@@ -1,3 +1,8 @@
1
+ ## 1.1.0 (2016-12-02)
2
+
3
+ * Avoid stepping into pry code
4
+ * Add help text when running without `--debug`
5
+
1
6
  ## 1.0.0 (2016-12-01)
2
7
 
3
8
  * Revamp documentation for JRuby usage
@@ -1,8 +1,29 @@
1
- module PryDebuggerJRuby
2
- TRACE_IGNORE_FILES = Dir[File.join(File.dirname(__FILE__), '..', '**', '*.rb')].map { |f| File.expand_path(f) }
1
+ require 'rubygems'
2
+ require 'java'
3
3
 
4
+ module PryDebuggerJRuby
4
5
  extend self
5
6
 
7
+ private
8
+
9
+ def list_pry_files
10
+ spec = Gem::Specification.find_by_name('pry')
11
+
12
+ if spec
13
+ Dir[File.join(spec.gem_dir, '**', '*rb')]
14
+ else
15
+ []
16
+ end
17
+ end
18
+
19
+ def list_debugger_files
20
+ Dir[File.join(File.dirname(__FILE__), '..', '**', '*.rb')].map { |f| File.expand_path(f) }
21
+ end
22
+
23
+ public
24
+
25
+ TRACE_IGNORE_FILES = [*list_debugger_files, *list_pry_files].freeze
26
+
6
27
  # Checks that a binding is in a local file context. Extracted from
7
28
  # https://github.com/pry/pry/blob/master/lib/pry/default_commands/context.rb
8
29
  def check_file_context(target)
@@ -10,6 +31,23 @@ module PryDebuggerJRuby
10
31
  file == Pry.eval_path || (file !~ /(\(.*\))|<.*>/ && file != '' && file != '-e')
11
32
  end
12
33
 
34
+ def check_trace_enabled
35
+ return true if org.jruby.RubyInstanceConfig.FULL_TRACE_ENABLED
36
+ warn <<-EOS
37
+ You are currently running JRuby without the --debug flag enabled, and without it this command will not work correctly.
38
+
39
+ To fix it, either:
40
+
41
+ * add the --debug flag to your ruby/jruby command
42
+ * or add the --debug flag to the JRUBY_OPTS environment variable
43
+ * or enable the jruby.debug.fullTrace option
44
+
45
+ Do note that having this option on all the time has a performance penalty, so we recommend you only enable it while debugging.
46
+ Safe prying, fellow rubyst!
47
+ EOS
48
+ false
49
+ end
50
+
13
51
  # Reference to currently running pry-remote server. Used by the processor.
14
52
  attr_accessor :current_remote_server
15
53
  end
@@ -141,6 +141,7 @@ module PryDebuggerJRuby
141
141
  elsif args.empty?
142
142
  run 'breakpoints'
143
143
  else
144
+ return unless PryDebuggerJRuby.check_trace_enabled
144
145
  new_breakpoint
145
146
  end
146
147
  end
@@ -212,6 +213,8 @@ module PryDebuggerJRuby
212
213
 
213
214
  helpers do
214
215
  def breakout_navigation(action, times = nil)
216
+ return unless PryDebuggerJRuby.check_trace_enabled
217
+
215
218
  _pry_.binding_stack.clear # Clear the binding stack
216
219
  throw :breakout_nav, { # Break out of the REPL loop and
217
220
  action: action, # signal the tracer
@@ -1,3 +1,3 @@
1
1
  module PryDebuggerJRuby
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-debugger-jruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: java
6
6
  authors:
7
7
  - Ivo Anjo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-01 00:00:00.000000000 Z
11
+ date: 2016-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement