debugger-ide 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/rdebug-ide +88 -0
  2. metadata +65 -0
data/bin/rdebug-ide ADDED
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'optparse'
5
+ require "ostruct"
6
+ if RUBY_VERSION < "1.9"
7
+ require 'ruby-debug-ide'
8
+ else
9
+ require_relative '../lib/ruby-debug-ide'
10
+ end
11
+
12
+ $stdout.sync=true
13
+
14
+ options = OpenStruct.new(
15
+ 'frame_bind' => false,
16
+ 'host' => nil,
17
+ 'load_mode' => false,
18
+ 'port' => 1234,
19
+ 'stop' => false,
20
+ 'tracing' => false
21
+ )
22
+
23
+ opts = OptionParser.new do |opts|
24
+ opts.banner = <<EOB
25
+ Using ruby-debug-base #{Debugger::VERSION}
26
+ Usage: rdebug-ide is supposed to be called from RDT, NetBeans or RubyMine. The
27
+ command line interface to ruby-debug is rdebug.
28
+ EOB
29
+ opts.separator ""
30
+ opts.separator "Options:"
31
+ opts.on("-h", "--host HOST", "Host name used for remote debugging") {|host| options.host = host}
32
+ opts.on("-p", "--port PORT", Integer, "Port used for remote debugging") {|port| options.port = port}
33
+ opts.on('--stop', 'stop when the script is loaded') {options.stop = true}
34
+ opts.on("-x", "--trace", "turn on line tracing") {options.tracing = true}
35
+ opts.on("-l", "--load-mode", "load mode (experimental)") {options.load_mode = true}
36
+ opts.on("-d", "--debug", "Debug self - prints information for debugging ruby-debug itself") do
37
+ Debugger.cli_debug = true
38
+ end
39
+ opts.on("--xml-debug", "Debug self - sends information <message>s for debugging ruby-debug itself") do
40
+ Debugger.xml_debug = true
41
+ end
42
+ opts.on("-I", "--include PATH", String, "Add PATH to $LOAD_PATH") do |path|
43
+ $LOAD_PATH.unshift(path)
44
+ end
45
+
46
+ opts.on("--keep-frame-binding", "Keep frame bindings") {options.frame_bind = true}
47
+ opts.separator ""
48
+ opts.separator "Common options:"
49
+ opts.on_tail("-v", "--version", "Show version") do
50
+ puts "Using ruby-debug-base #{Debugger::VERSION}"
51
+ exit
52
+ end
53
+ end
54
+
55
+ begin
56
+ Debugger::ARGV = ARGV.clone
57
+ rdebug_path = File.expand_path($0)
58
+ if RUBY_PLATFORM =~ /mswin/
59
+ rdebug_path += ".cmd" unless rdebug_path =~ /\.cmd$/i
60
+ end
61
+ Debugger::RDEBUG_SCRIPT = rdebug_path
62
+ opts.parse! ARGV
63
+ rescue StandardError => e
64
+ puts opts
65
+ puts
66
+ puts e.message
67
+ exit(1)
68
+ end
69
+
70
+ if ARGV.empty?
71
+ puts opts
72
+ puts
73
+ puts "Must specify a script to run"
74
+ exit(1)
75
+ end
76
+
77
+ # save script name
78
+ Debugger::PROG_SCRIPT = ARGV.shift
79
+
80
+ # install interruption handler
81
+ trap('INT') { Debugger.interrupt_last }
82
+
83
+ # set options
84
+ Debugger.keep_frame_binding = options.frame_bind
85
+ Debugger.tracing = options.tracing
86
+
87
+ Debugger.debug_program(options)
88
+
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: debugger-ide
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Markus Barchfeld, Martin Krauskopf, Mark Moseley, Anton Astashov
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-10-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: debugger
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.2.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 1.2.1
30
+ description: ! 'An interface which glues ruby-debug to IDEs like Eclipse (RDT) and
31
+ NetBeans.
32
+
33
+ '
34
+ email: anton.astashov@gmail.com
35
+ executables:
36
+ - rdebug-ide
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - bin/rdebug-ide
41
+ homepage: http://github.com/astashov/debugger-ide
42
+ licenses: []
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: 1.8.2
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ requirements: []
60
+ rubyforge_project: debug-commons
61
+ rubygems_version: 1.8.24
62
+ signing_key:
63
+ specification_version: 3
64
+ summary: IDE interface for debugger.
65
+ test_files: []