{"id":18103147,"url":"https://github.com/janlelis/debugging","last_synced_at":"2025-10-18T05:04:10.868Z","repository":{"id":13366581,"uuid":"16054212","full_name":"janlelis/debugging","owner":"janlelis","description":"Improve your Print Debugging","archived":false,"fork":false,"pushed_at":"2022-12-25T21:51:40.000Z","size":48,"stargazers_count":42,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-27T09:46:09.914Z","etag":null,"topics":["debugging","developer-tools","print","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janlelis.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-19T20:57:29.000Z","updated_at":"2023-08-02T15:50:23.000Z","dependencies_parsed_at":"2023-01-13T17:26:26.823Z","dependency_job_id":null,"html_url":"https://github.com/janlelis/debugging","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlelis%2Fdebugging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlelis%2Fdebugging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlelis%2Fdebugging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlelis%2Fdebugging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janlelis","download_url":"https://codeload.github.com/janlelis/debugging/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766733,"owners_count":21158301,"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","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":["debugging","developer-tools","print","ruby"],"created_at":"2024-10-31T22:10:35.159Z","updated_at":"2025-10-18T05:04:05.819Z","avatar_url":"https://github.com/janlelis.png","language":"Ruby","readme":"# Ruby Print Debugging [![version](https://badge.fury.io/rb/debugging.svg)](https://badge.fury.io/rb/debugging) [\u003cimg src=\"https://github.com/janlelis/debugging/workflows/Test/badge.svg\" /\u003e](https://github.com/janlelis/debugging/actions?query=workflow%3ATest)\n\nHelps you to introspect and debug your code.\n\n\n## Setup\n\nInstall gem:\n\n```\n$ gem install debugging\n```\n\n\nIn Ruby:\n\n```ruby\nrequire 'debugging/all'\n```\n\nInstead of requiring all, you can also require only one function, e.g:\n\n```ruby\nrequire 'debugging/q'\n```\n\nIn a bundler project, you will need to add the gem to your project's `Gemfile`:\n\n```ruby\ngem 'debugging', require: 'debugging/all'\n```\n\n## Methods\n### at(label = nil)\n\nPrints out that a specific point in a script has been reached.\n\n```\n[label] @ method `...', line ... of file ....\n```\n\n### beep\n\nLets your terminal bell ring.\n\n### callstack\n\nPrints out your current callstack. For example:\n\n```\n\u003cmain\u003e\n  start\n    catch\n      block in start\n        eval_input\n          each_top_level_statement\n            catch\n              block in each_top_level_statement\n                loop\n                  block (2 levels) in each_top_level_statement\n                    block in eval_input\n                      signal_status\n                        block (2 levels) in eval_input\n                          evaluate\n                            evaluate\n                              eval\n                                irb_binding\n```\n\n### howtocall(obj = self, method_or_proc)\n\nDisplays parameter names and types for a proc or method (identified by a symbol):\n\n```ruby\ndef function(a, b = 3, \u0026c)\nend\nhowtocall :function #=\u003e function(a, b, \u0026c)\n```\n\nWhat is not visible in the example above: All optional parameters are displayed underlined.\n\nIf you want to access a function that is defined on an other object than the current one,\nyou can pass it as an optional parameter:\n\n```ruby\nhowtocall FileUtils, :cd #=\u003e cd(dir, options, \u0026block)\nhowtocall Open3, :popen3 #=\u003e popen3(*cmd, **opts, \u0026block)\n\n```\n\nAn example with lambdas and keyword arguments:\n\n```ruby\na = -\u003e(filter: /\\A.*\\z/, string:){ string[filter] }\nhowtocall a #=\u003e call(string:, filter:)\n```\n\n### q(*args)\n\nLike `Kernel#p`, but with colors on one line:\n\n```ruby\nq :is_like, ?p, \"but on one line\"\n```\n\n### re(string, regex, groups = nil)\n\nAssists you when matching regexes againts strings. Try this one:\n\n```ruby\nre \"mail@janlelis.de\", /\\b([A-Z0-9._%+-]+)@([A-Z0-9.-]+\\.[A-Z]{2,10})\\b/i, 0..2\n```\n\n## J-_-L\n\nCopyright (c) 2010-2022 Jan Lelis. MIT License. Originated from the\n[zucker](https://github.com/janlelis/sugar_refinery) gem.\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanlelis%2Fdebugging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanlelis%2Fdebugging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanlelis%2Fdebugging/lists"}