{"id":15021347,"url":"https://github.com/jaimecgomezz/nvim-dap-ruby-rdbg","last_synced_at":"2026-01-05T03:48:28.201Z","repository":{"id":256681545,"uuid":"853978583","full_name":"jaimecgomezz/nvim-dap-ruby-rdbg","owner":"jaimecgomezz","description":"Ruby adapter for nvim-dap that uses rdbg to enable debugging capabilities without modifying the source code","archived":false,"fork":false,"pushed_at":"2024-09-12T16:27:28.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T23:11:18.607Z","etag":null,"topics":["dap","nvim","ruby"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaimecgomezz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-08T04:11:02.000Z","updated_at":"2024-09-12T16:44:56.000Z","dependencies_parsed_at":"2025-02-13T11:42:42.380Z","dependency_job_id":null,"html_url":"https://github.com/jaimecgomezz/nvim-dap-ruby-rdbg","commit_stats":null,"previous_names":["jaimecgomezz/nvim-dap-ruby-rdbg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jaimecgomezz/nvim-dap-ruby-rdbg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaimecgomezz%2Fnvim-dap-ruby-rdbg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaimecgomezz%2Fnvim-dap-ruby-rdbg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaimecgomezz%2Fnvim-dap-ruby-rdbg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaimecgomezz%2Fnvim-dap-ruby-rdbg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaimecgomezz","download_url":"https://codeload.github.com/jaimecgomezz/nvim-dap-ruby-rdbg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaimecgomezz%2Fnvim-dap-ruby-rdbg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281430966,"owners_count":26500238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dap","nvim","ruby"],"created_at":"2024-09-24T19:56:28.721Z","updated_at":"2025-10-28T11:31:54.805Z","avatar_url":"https://github.com/jaimecgomezz.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nvim-dap-ruby-rdbg\nRuby adapter for [nvim-dap](https://github.com/mfussenegger/nvim-dap) that uses\n[rdbg](https://github.com/ruby/debug) to enable debugging capabilities without\nmodifying the source code, simply use [nvim-dap breackpoints](https://github.com/mfussenegger/nvim-dap?tab=readme-ov-file#usage).\n\n## Installation\n\nFirst, install [rdbg](https://github.com/ruby/debug) in your system, via your\npackage manager or as a\n[gem](https://guides.rubygems.org/rubygems-basics/#installing-gems).\n\nUsing [lazy.nvim](https://github.com/folke/lazy.nvim):\n```lua\n{\n    \"mfussenegger/nvim-dap\",\n    dependencies = {\n        { \"rcarriga/nvim-dap-ui\", dependencies = { \"nvim-neotest/nvim-nio\" } }, -- optional, but recommended\n        {\n            \"jaimecgomezz/nvim-dap-ruby-rdbg\",\n            opts = {},\n        },\n    },\n}\n```\n\n## Configuration\n\nHere's a complete `opts` example:\n```lua\n{\n    -- The `rdbg` executable path, defaults to `rdbg`\n    rdbg_path = \"/usr/bin/rdbg\",\n    -- Indicates wheter `rdbg` should stop at program start or not. It is\n    -- applied to all configurations that don't specify it, default to `false`.\n    -- Please see the #nonstop section for more details.\n    nonstop = false,\n    -- Whether the default plugin configurations should be included or not, defaults to `true`\n    should_include_default_configurations = false,\n    -- A list of user defined debugger configurations, defaults to `{}`\n    configurations = {\n        { -- Debug a script\n            name = \"debug my test file\",\n            -- The `cwd` is optional, if it isn't provided it defaults to `vim.fn.getcwd`\n            cwd = '~/my-project',\n            -- The list of arguments that will be fed to `rdbg`\n            args = { \"ruby\", \"my-test.rb\" },\n        },\n        { -- Debug the currest rspec file\n            name = \"rspec current file\",\n            args = { \"rspec\" },\n            -- Can be any of the following\n            --      - line (line at cursor position), e.g. Debug a single spec\n            --      - file (current file), e.g. Debug all specs in a file\n            --      - workspace (current working directory), e.g. Debug all specs\n            --      - any other string will be used as provided\n            target = \"file\",\n            -- Indicates whether `rdbg` should stop at the program start for\n            -- this specific configuration, it overwrites the global `nonstop`\n            -- option and defaults to it if not provided. Please see the #nonstop\n            -- section for more details.\n            nonstop = true,\n        },\n        { \n            -- Attach a running `rdbg` instance. By providing no `args` or\n            -- `target` values, it is understood that you want to connect to a\n            -- debuggee. Please see the #attach-to-debuggee section for more details\n            name = \"attach to a debuggee\",\n            -- The `port` is optional, if isn't provided, you'll be prompted for\n            -- one at the beginning of the debug session\n            port = 1234,\n            -- The `host` is also optional, it defaults to '127.0.0.1'\n            host = \"localhost\"\n        }\n    }\n}\n```\n\n## Usage\nOpen a `Ruby` file that you wish to debug, and call the following [lua\ncommands](https://neovim.io/doc/user/lua-guide.html#lua-guide-using-Lua)\n\n```lua\n-- Set as many breakpoint as you want with the following command\nrequire(\"dap\").toggle_breakpoint()\n\n-- Start a debug session, you'll be asked to choose a debug configuration\nrequire(\"dap\").continue()\n\n-- If nvim-dap-ui is installed and properly configured, it should open its UI\n\n-- Now, move through your breackpoints\nrequire(\"dap\").continue()\n```\n\n## --nonstop\nAs stated above, this flag tells `rdbg` to stop, or not, at the beggining of the\nprogram. \n\nI've tested the behavior of this flag on Linux and MacOS, and I've seen somewhat\nconfusing results; on Linux, the flag being set to `false` allows `rdbg` to\nstart adequately and open the necesary TCP/IP connections for `nvim-dap` to\nconnect to, whilst on MacOS, setting it to `true` grants the same output.\n\nI'm sure that there's a valid explanation for this, but for now, enabling a\nglobal `opts.nonstop` option, as well as a config-specific one, should grant the\nnecessary flexibility.\n\nAdditionally, if you need to improve/modify/inspect the default configurations,\nyou can access them as follows:\n\n```lua\nlocal dap_ruby = require(\"dap-ruby-rdbg\")\n\n-- Pick the first three configs, for example\ndap_ruby.default_configurations = { unpack(dap_ruby.default_configurations, 1, 3) }\n\ndap_ruby.setup({\n    -- ... your configuration\n})\n```\n\n## Attach to debuggee\nAlthough is possible to inspect the `rdbg` output by opening the `nvim-dap`\nREPL as follows:\n\n```lua\nrequire(\"dap\").repl.toggle()\n```\n\nThere might be instances where you'd like to manually start `rdbg` in another\nterminal and follow along with your code as you debug. Here are some sample\ncommands taken from the [rdbg command\nhelp](https://github.com/ruby/debug?tab=readme-ov-file#rdbg-command-help)\nsection.\n\n```sh\n$ rdbg -O --port 1234 target.rb foo bar # starts accepts attaching with TCP/IP localhost:1234.\n$ rdbg -O --port 1234 -- -r foo -e bar  # starts accepts attaching with TCP/IP localhost:1234.\n```\n\nAfter the `rdbg` instance is running, you can then run the `attach to debugger`\ndefault config and connect to it by providing the `1234` port when prompted for\nit.\n\nPlease see:\n- https://github.com/ruby/debug?tab=readme-ov-file#use-rdbg-with-commands-written-in-ruby\n- https://github.com/ruby/debug?tab=readme-ov-file#invoke-as-a-remote-debuggee\n\n## Aknowledgements\n\n- [nvim-dap-ruby](https://github.com/suketa/nvim-dap-ruby): Served as a starting point for this project\n- [nvim-dap-python](https://github.com/mfussenegger/nvim-dap-python): Enlightened, by example, what would otherwise be a truly bumpy road\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaimecgomezz%2Fnvim-dap-ruby-rdbg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaimecgomezz%2Fnvim-dap-ruby-rdbg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaimecgomezz%2Fnvim-dap-ruby-rdbg/lists"}