debugger-xml 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZmYyODkwMzhjODQxNWYxYmQ2YTdiYjA0Zjc4YWVlOGIxOGUxYzQyNA==
5
+ data.tar.gz: !binary |-
6
+ YmJjMDVkOGY4OGRkNTBiY2FiZGY5ZmZlNzFlM2VlZDliYzBlMzUyYQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NDM4ZWNjMGY5M2RiMGNmZWU5MjgyMDNmYWYxYzM1ZThjZjYwODFmNDg2ZWJm
10
+ N2U3ZjYxYmY4ZDk4ODkwY2Y0MDQ4ZTE1NmE5MWQ0YzM4OWUzNmQ2NmNiNjQz
11
+ N2MxMjU4YmExNzBhY2ZmNmU1NmE1ZTg2MGEyY2RiODJhOTY4NTM=
12
+ data.tar.gz: !binary |-
13
+ YzUxY2MzOWQyOWNhZDg0ZmQyMWM0YWFkNWU4Y2U5N2I4OGUxNDkxNWQ1MTQ2
14
+ MmMzMmNlODY4MmU3ZTQyODQ4NTMzOGIxM2JkM2RiOWRiZTNkMDAzOTAyMDJk
15
+ YjYzMmIwODAwOGFhNmRkZjVjMWU5N2Q2NTlkODUyNTEyNWQ4OGQ=
@@ -0,0 +1,24 @@
1
+ module Debugger
2
+ class InspectCommand < Command
3
+ # reference inspection results in order to save them from the GC
4
+ @@references = []
5
+ def self.reference_result(result)
6
+ @@references << result
7
+ end
8
+ def self.clear_references
9
+ @@references = []
10
+ end
11
+
12
+ def regexp
13
+ /^\s*v(?:ar)?\s+inspect\s+/
14
+ end
15
+
16
+ def execute
17
+ run_with_binding do |binding|
18
+ obj = debug_eval(@match.post_match, binding)
19
+ InspectCommand.reference_result(obj)
20
+ print prv({eval_result: obj}, "local")
21
+ end
22
+ end
23
+ end
24
+ end
@@ -81,6 +81,7 @@ module Debugger
81
81
  @file = nil
82
82
  @context = nil
83
83
  @last_breakpoint = nil
84
+ InspectCommand.clear_references
84
85
  end
85
86
 
86
87
  def stop_thread
@@ -1,5 +1,5 @@
1
1
  module Debugger
2
2
  module Xml
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
@@ -0,0 +1,44 @@
1
+ require_relative 'test_helper'
2
+
3
+ describe "Inspect Command" do
4
+ include TestDsl
5
+ temporary_change_method_value(Debugger, :printer, Printers::Xml.new)
6
+
7
+ it "must inspect ENV" do
8
+ enter 'break 25', 'cont', 'v inspect ENV'
9
+ debug_file 'variables'
10
+ check_output_includes(Regexp.new(
11
+ '<variables>' +
12
+ %{<variable name="eval_result" kind="local" value="ENV" type="Object" hasChildren="false" objectId=".*"/>} +
13
+ '</variables>'
14
+ ))
15
+ end
16
+
17
+ it "must inspect an arithmetic expression" do
18
+ enter 'break 25', 'cont', 'v inspect 1 + 2'
19
+ debug_file 'variables'
20
+ check_output_includes(Regexp.new(
21
+ '<variables>' +
22
+ %{<variable name="eval_result" kind="local" value="3" type="Fixnum" hasChildren="false" objectId=".*"/>} +
23
+ '</variables>'
24
+ ))
25
+ end
26
+
27
+ it "must inspect a hash" do
28
+ enter 'break 25', 'cont', 'v inspect {a: 1, b: [2, 3] }'
29
+ debug_file 'variables'
30
+ check_output_includes(Regexp.new(
31
+ '<variables>' +
32
+ %{<variable name="eval_result" kind="local" value="Hash \\(2 element\\(s\\)\\)" type="Hash" hasChildren="true" objectId=".*"/>} +
33
+ '</variables>'
34
+ ))
35
+ end
36
+
37
+ it "must evaluate with error" do
38
+ enter 'break 25', 'cont', 'v inspect blabla'
39
+ debug_file 'variables'
40
+ check_output_includes(
41
+ %{<processingException type="NameError" message="undefined local variable or method `blabla' for main:Object"/>},
42
+ interface.error_queue)
43
+ end
44
+ end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debugger-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
5
- prerelease:
4
+ version: 0.1.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Anton Astashov
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-09 00:00:00.000000000 Z
11
+ date: 2013-09-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: debugger
@@ -18,15 +17,13 @@ dependencies:
18
17
  - - ! '>='
19
18
  - !ruby/object:Gem::Version
20
19
  version: 1.5.0
21
- none: false
22
- prerelease: false
23
20
  type: :runtime
21
+ prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
23
  requirements:
26
24
  - - ! '>='
27
25
  - !ruby/object:Gem::Version
28
26
  version: 1.5.0
29
- none: false
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: builder
32
29
  requirement: !ruby/object:Gem::Requirement
@@ -34,15 +31,13 @@ dependencies:
34
31
  - - ! '>='
35
32
  - !ruby/object:Gem::Version
36
33
  version: 2.0.0
37
- none: false
38
- prerelease: false
39
34
  type: :runtime
35
+ prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
37
  requirements:
42
38
  - - ! '>='
43
39
  - !ruby/object:Gem::Version
44
40
  version: 2.0.0
45
- none: false
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
@@ -50,15 +45,13 @@ dependencies:
50
45
  - - ~>
51
46
  - !ruby/object:Gem::Version
52
47
  version: 0.9.2.2
53
- none: false
54
- prerelease: false
55
48
  type: :development
49
+ prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - ~>
59
53
  - !ruby/object:Gem::Version
60
54
  version: 0.9.2.2
61
- none: false
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: minitest
64
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,15 +59,13 @@ dependencies:
66
59
  - - ~>
67
60
  - !ruby/object:Gem::Version
68
61
  version: 2.12.1
69
- none: false
70
- prerelease: false
71
62
  type: :development
63
+ prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
65
  requirements:
74
66
  - - ~>
75
67
  - !ruby/object:Gem::Version
76
68
  version: 2.12.1
77
- none: false
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: mocha
80
71
  requirement: !ruby/object:Gem::Requirement
@@ -82,15 +73,13 @@ dependencies:
82
73
  - - ~>
83
74
  - !ruby/object:Gem::Version
84
75
  version: 0.13.0
85
- none: false
86
- prerelease: false
87
76
  type: :development
77
+ prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
79
  requirements:
90
80
  - - ~>
91
81
  - !ruby/object:Gem::Version
92
82
  version: 0.13.0
93
- none: false
94
83
  description: XML interface for debugger
95
84
  email:
96
85
  - anton.astashov@gmail.com
@@ -116,6 +105,7 @@ files:
116
105
  - lib/debugger/xml/extensions/commands/frame.rb
117
106
  - lib/debugger/xml/extensions/commands/help.rb
118
107
  - lib/debugger/xml/extensions/commands/info.rb
108
+ - lib/debugger/xml/extensions/commands/inspect.rb
119
109
  - lib/debugger/xml/extensions/commands/irb.rb
120
110
  - lib/debugger/xml/extensions/commands/kill.rb
121
111
  - lib/debugger/xml/extensions/commands/tmate.rb
@@ -166,6 +156,7 @@ files:
166
156
  - test/ide/control_command_processor_test.rb
167
157
  - test/ide/processor_test.rb
168
158
  - test/info_test.rb
159
+ - test/inspect_test.rb
169
160
  - test/irb_test.rb
170
161
  - test/jump_test.rb
171
162
  - test/kill_test.rb
@@ -186,6 +177,7 @@ files:
186
177
  - test/vim/processor_test.rb
187
178
  homepage: ''
188
179
  licenses: []
180
+ metadata: {}
189
181
  post_install_message:
190
182
  rdoc_options: []
191
183
  require_paths:
@@ -195,18 +187,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
187
  - - ! '>='
196
188
  - !ruby/object:Gem::Version
197
189
  version: '0'
198
- none: false
199
190
  required_rubygems_version: !ruby/object:Gem::Requirement
200
191
  requirements:
201
192
  - - ! '>='
202
193
  - !ruby/object:Gem::Version
203
194
  version: '0'
204
- none: false
205
195
  requirements: []
206
196
  rubyforge_project:
207
- rubygems_version: 1.8.25
197
+ rubygems_version: 2.0.7
208
198
  signing_key:
209
- specification_version: 3
199
+ specification_version: 4
210
200
  summary: Implements XML interface for the 'debugger' gem, compatible with ruby-debug-ide
211
201
  gem
212
202
  test_files:
@@ -244,6 +234,7 @@ test_files:
244
234
  - test/ide/control_command_processor_test.rb
245
235
  - test/ide/processor_test.rb
246
236
  - test/info_test.rb
237
+ - test/inspect_test.rb
247
238
  - test/irb_test.rb
248
239
  - test/jump_test.rb
249
240
  - test/kill_test.rb