Skip to content

Commit 703df4d

Browse files
authored
Merge pull request #820 from puremourning/ruby-rdbg
Update ruby example to rdbg
2 parents 4b07a56 + 30af90d commit 703df4d

File tree

6 files changed

+73
-14
lines changed

6 files changed

+73
-14
lines changed

support/test/ruby/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Gemfile.lock
22
vendor/
3+
bin/

support/test/ruby/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2.2

support/test/ruby/.vimspector.json

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,60 @@
11
{
2+
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json",
3+
"adapters": {
4+
"rdbg-script": {
5+
"variables": {
6+
"port": "${unusedLocalPort}"
7+
},
8+
"launch": {
9+
"remote": {
10+
"runCommand": [
11+
"${workspaceRoot}/bin/rdbg",
12+
"--open",
13+
"--port", "${port}",
14+
"--",
15+
"%CMD%"
16+
]
17+
}
18+
},
19+
"port": "${port}"
20+
},
21+
"rdbg-command": {
22+
"variables": {
23+
"port": "${unusedLocalPort}"
24+
},
25+
"launch": {
26+
"remote": {
27+
"runCommand": [
28+
"${workspaceRoot}/bin/rdbg",
29+
"--open",
30+
"--port", "${port}",
31+
"-c",
32+
"--",
33+
"%CMD%"
34+
]
35+
}
36+
},
37+
"port": "${port}"
38+
}
39+
},
240
"configurations": {
3-
"launch current file": {
4-
"adapter": "cust_vscode-ruby",
41+
"run current script": {
42+
"adapter": "rdbg-script",
43+
"remote-cmdLine": [
44+
"${file}"
45+
],
46+
"configuration": {
47+
"request": "launch"
48+
}
49+
},
50+
"run rails": {
51+
"adapter": "rdbg-command",
52+
"remote-cmdLine": [
53+
"rails",
54+
"server"
55+
],
556
"configuration": {
6-
"request": "launch",
7-
"program": "${file}",
8-
"args": [ "*${args}" ],
9-
"useBundler": true,
10-
"trace": true,
11-
"showDebuggerOutput": true
57+
"request": "launch"
1258
}
1359
}
1460
}

support/test/ruby/Gemfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6-
75
# gem "rails"
86

9-
gem "ruby-debug-ide", "~> 0.7.2"
10-
11-
gem "debase", "~> 0.2.4"
7+
gem "debug", "~> 1.9"

support/test/ruby/install

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# First, make sure that ruby 3 is in your path
2+
3+
bundle install
4+
bundle binstubs --force debug

support/test/ruby/test.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
print 'hello' 'world'
1+
class Foo
2+
def initialize
3+
@bar = 'bar'
4+
end
5+
6+
def bar
7+
@bar
8+
end
9+
end
10+
11+
f = Foo.new
12+
puts f.bar

0 commit comments

Comments
 (0)