ruby-debug-ide 0.5.0 → 0.6.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +6 -0
- data/lib/ruby-debug-ide.rb +19 -3
- data/lib/ruby-debug-ide/command.rb +19 -1
- data/lib/ruby-debug-ide/commands/breakpoints.rb +0 -11
- data/lib/ruby-debug-ide/commands/file_filtering.rb +107 -0
- data/lib/ruby-debug-ide/version.rb +1 -1
- data/lib/ruby-debug-ide/xml_printer.rb +12 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8ed6b7923a0428da925a0e086cc8b531d3e5525
|
4
|
+
data.tar.gz: f02a6bd75cf4328743ef299063a1af56920cd623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec27e725695167ce4051c57975bb45bf753815df094add1e606e84cbf21dddb817e36370f1a6c456a022be989deda445b0d4998c523cb85a4e253a66208c5267
|
7
|
+
data.tar.gz: 300fac86743cf25e296e766841625bc7783e5c8cc5d893fab73fa7e3baea73e1074e83d5d32ad3ccbaa34dfbaf4fbea8435109357d4737dfb59a351fa1c82fdd
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## [master](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.5.0...master)
|
2
|
+
|
3
|
+
* "file-filter on|off" command added
|
4
|
+
* "include file|dir" command added
|
5
|
+
* "exclude file|dir" command added
|
6
|
+
|
1
7
|
## [0.5.0](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.33...v0.5.0)
|
2
8
|
|
3
9
|
* catchpointDeleted event added (under --catchpoint-deleted-event flag)
|
data/lib/ruby-debug-ide.rb
CHANGED
@@ -108,9 +108,7 @@ module Debugger
|
|
108
108
|
# "localhost" and nil have problems on some systems.
|
109
109
|
host ||= '127.0.0.1'
|
110
110
|
server = TCPServer.new(host, port)
|
111
|
-
|
112
|
-
RUBY_VERSION < '2.0.0' ? 'ruby-debug-base19x' : 'debase'
|
113
|
-
$stderr.printf "Fast Debugger (ruby-debug-ide #{IDE_VERSION}, #{gem_name} #{VERSION}) listens on #{host}:#{port}\n"
|
111
|
+
print_greeting_msg(host, port)
|
114
112
|
notify_dispatcher(port) if notify_dispatcher
|
115
113
|
|
116
114
|
while (session = server.accept)
|
@@ -138,8 +136,26 @@ module Debugger
|
|
138
136
|
end
|
139
137
|
end
|
140
138
|
|
139
|
+
def print_greeting_msg(host, port)
|
140
|
+
base_gem_name = if defined?(JRUBY_VERSION) || RUBY_VERSION < '1.9.0'
|
141
|
+
'ruby-debug-base'
|
142
|
+
elsif RUBY_VERSION < '2.0.0'
|
143
|
+
'ruby-debug-base19x'
|
144
|
+
else
|
145
|
+
'debase'
|
146
|
+
end
|
147
|
+
|
148
|
+
file_filtering_support = if Command.file_filter_supported?
|
149
|
+
'supported'
|
150
|
+
else
|
151
|
+
'not supported'
|
152
|
+
end
|
153
|
+
$stderr.printf "Fast Debugger (ruby-debug-ide #{IDE_VERSION}, #{base_gem_name} #{VERSION}, file filtering is #{file_filtering_support}) listens on #{host}:#{port}\n"
|
154
|
+
end
|
155
|
+
|
141
156
|
private
|
142
157
|
|
158
|
+
|
143
159
|
def notify_dispatcher(port)
|
144
160
|
return unless ENV['IDE_PROCESS_DISPATCHER']
|
145
161
|
acceptor_host, acceptor_port = ENV['IDE_PROCESS_DISPATCHER'].split(":")
|
@@ -70,6 +70,10 @@ module Debugger
|
|
70
70
|
$1 + "\n" * ($2.size / 2)
|
71
71
|
end.gsub(/\\\\/, '\\')
|
72
72
|
end
|
73
|
+
|
74
|
+
def file_filter_supported?
|
75
|
+
defined?(Debugger.file_filter)
|
76
|
+
end
|
73
77
|
end
|
74
78
|
|
75
79
|
def initialize(state, printer)
|
@@ -145,7 +149,21 @@ module Debugger
|
|
145
149
|
|
146
150
|
def get_context(thnum)
|
147
151
|
Debugger.contexts.find{|c| c.thnum == thnum}
|
148
|
-
end
|
152
|
+
end
|
153
|
+
|
154
|
+
def realpath(filename)
|
155
|
+
is_dir = filename.end_with?(File::SEPARATOR)
|
156
|
+
if filename.index(File::SEPARATOR) || File::ALT_SEPARATOR && filename.index(File::ALT_SEPARATOR)
|
157
|
+
filename = File.expand_path(filename)
|
158
|
+
end
|
159
|
+
if (RUBY_VERSION < '1.9') || (RbConfig::CONFIG['host_os'] =~ /mswin/)
|
160
|
+
filename
|
161
|
+
else
|
162
|
+
filename = File.realpath(filename) rescue filename
|
163
|
+
filename = filename + File::SEPARATOR if is_dir && !filename.end_with?(File::SEPARATOR)
|
164
|
+
filename
|
165
|
+
end
|
166
|
+
end
|
149
167
|
end
|
150
168
|
|
151
169
|
Command.load_commands
|
@@ -62,17 +62,6 @@ module Debugger
|
|
62
62
|
}
|
63
63
|
end
|
64
64
|
end
|
65
|
-
|
66
|
-
private
|
67
|
-
def realpath(filename)
|
68
|
-
filename = File.expand_path(filename) if filename.index(File::SEPARATOR) || \
|
69
|
-
File::ALT_SEPARATOR && filename.index(File::ALT_SEPARATOR)
|
70
|
-
if (RUBY_VERSION < '1.9') || (RbConfig::CONFIG['host_os'] =~ /mswin/)
|
71
|
-
filename
|
72
|
-
else
|
73
|
-
File.realpath(filename) rescue filename
|
74
|
-
end
|
75
|
-
end
|
76
65
|
end
|
77
66
|
|
78
67
|
class BreakpointsCommand < Command # :nodoc:
|
@@ -0,0 +1,107 @@
|
|
1
|
+
module Debugger
|
2
|
+
class IncludeFile < Command # :nodoc:
|
3
|
+
self.control = true
|
4
|
+
|
5
|
+
def regexp
|
6
|
+
/ ^\s*include\s+(.+?)\s*$/x
|
7
|
+
end
|
8
|
+
|
9
|
+
def execute
|
10
|
+
file = @match[1]
|
11
|
+
|
12
|
+
return if file.nil?
|
13
|
+
file = realpath(file)
|
14
|
+
|
15
|
+
if Command.file_filter_supported?
|
16
|
+
Debugger.file_filter.include(file)
|
17
|
+
print_file_included(file)
|
18
|
+
else
|
19
|
+
print_debug("file filter is not supported")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class << self
|
24
|
+
def help_command
|
25
|
+
'include'
|
26
|
+
end
|
27
|
+
|
28
|
+
def help(cmd)
|
29
|
+
%{
|
30
|
+
include file - adds file/dir to file filter (either remove already excluded or add as included)
|
31
|
+
}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class ExcludeFile < Command # :nodoc:
|
37
|
+
self.control = true
|
38
|
+
|
39
|
+
def regexp
|
40
|
+
/ ^\s*exclude\s+(.+?)\s*$/x
|
41
|
+
end
|
42
|
+
|
43
|
+
def execute
|
44
|
+
file = @match[1]
|
45
|
+
|
46
|
+
return if file.nil?
|
47
|
+
file = realpath(file)
|
48
|
+
|
49
|
+
if Command.file_filter_supported?
|
50
|
+
Debugger.file_filter.exclude(file)
|
51
|
+
print_file_excluded(file)
|
52
|
+
else
|
53
|
+
print_debug("file filter is not supported")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class << self
|
58
|
+
def help_command
|
59
|
+
'include'
|
60
|
+
end
|
61
|
+
|
62
|
+
def help(cmd)
|
63
|
+
%{
|
64
|
+
exclude file - exclude file/dir from file filter (either remove already included or add as exclude)
|
65
|
+
}
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
class FileFilterCommand < Command # :nodoc:
|
71
|
+
self.control = true
|
72
|
+
|
73
|
+
def regexp
|
74
|
+
/ ^\s*file-filter\s+(on|off)\s*$/x
|
75
|
+
end
|
76
|
+
|
77
|
+
def execute
|
78
|
+
action = @match[1]
|
79
|
+
|
80
|
+
if Command.file_filter_supported?
|
81
|
+
if 'on' == action
|
82
|
+
Debugger.file_filter.enable
|
83
|
+
print_file_filter_status(true)
|
84
|
+
elsif 'off' == action
|
85
|
+
Debugger.file_filter.disable
|
86
|
+
print_file_filter_status(false)
|
87
|
+
else
|
88
|
+
print_error "Unknown option '#{action}'"
|
89
|
+
end
|
90
|
+
else
|
91
|
+
print_debug("file filter is not supported")
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
class << self
|
96
|
+
def help_command
|
97
|
+
'file-filter'
|
98
|
+
end
|
99
|
+
|
100
|
+
def help(cmd)
|
101
|
+
%{
|
102
|
+
file-filter (on|off) - enable/disable file filtering
|
103
|
+
}
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -184,6 +184,18 @@ module Debugger
|
|
184
184
|
CGI.escapeHTML(name), kind, CGI.escapeHTML(safe_to_string(value)))
|
185
185
|
end
|
186
186
|
|
187
|
+
def print_file_included(file)
|
188
|
+
print("<fileIncluded file=\"%s\"/>", file)
|
189
|
+
end
|
190
|
+
|
191
|
+
def print_file_excluded(file)
|
192
|
+
print("<fileExcluded file=\"%s\"/>", file)
|
193
|
+
end
|
194
|
+
|
195
|
+
def print_file_filter_status(status)
|
196
|
+
print("<fileFilter status=\"%s\"/>", status)
|
197
|
+
end
|
198
|
+
|
187
199
|
def print_breakpoints(breakpoints)
|
188
200
|
print_element 'breakpoints' do
|
189
201
|
breakpoints.sort_by{|b| b.id }.each do |b|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-debug-ide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Barchfeld, Martin Krauskopf, Mark Moseley, JetBrains RubyMine Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- lib/ruby-debug-ide/commands/enable.rb
|
51
51
|
- lib/ruby-debug-ide/commands/eval.rb
|
52
52
|
- lib/ruby-debug-ide/commands/expression_info.rb
|
53
|
+
- lib/ruby-debug-ide/commands/file_filtering.rb
|
53
54
|
- lib/ruby-debug-ide/commands/frame.rb
|
54
55
|
- lib/ruby-debug-ide/commands/inspect.rb
|
55
56
|
- lib/ruby-debug-ide/commands/jump.rb
|
@@ -84,9 +85,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
85
|
version: 1.8.2
|
85
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
87
|
requirements:
|
87
|
-
- - "
|
88
|
+
- - ">"
|
88
89
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
90
|
+
version: 1.3.1
|
90
91
|
requirements: []
|
91
92
|
rubyforge_project: debug-commons
|
92
93
|
rubygems_version: 2.4.4
|