{"id":19557173,"url":"https://github.com/gingray/damn-legacy","last_synced_at":"2025-06-22T03:41:04.040Z","repository":{"id":61696762,"uuid":"553749026","full_name":"gingray/damn-legacy","owner":"gingray","description":"Tool to help with legacy code and fix bugs","archived":false,"fork":false,"pushed_at":"2022-10-19T17:48:09.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T16:45:42.222Z","etag":null,"topics":[],"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/gingray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-18T17:52:25.000Z","updated_at":"2022-10-18T17:53:45.000Z","dependencies_parsed_at":"2022-10-20T06:45:12.592Z","dependency_job_id":null,"html_url":"https://github.com/gingray/damn-legacy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gingray/damn-legacy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gingray%2Fdamn-legacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gingray%2Fdamn-legacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gingray%2Fdamn-legacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gingray%2Fdamn-legacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gingray","download_url":"https://codeload.github.com/gingray/damn-legacy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gingray%2Fdamn-legacy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261232844,"owners_count":23128169,"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":[],"created_at":"2024-11-11T04:40:39.553Z","updated_at":"2025-06-22T03:40:59.019Z","avatar_url":"https://github.com/gingray.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Damn::Legacy\nQuite a lot of time I have to work with huge legacy code bases. When I face a bug I create small ruby script to put everything I've found or related information.\nI create small DSL to describe \"stacktraces\" which I create by hand. Main goal of this gem is provide a nice DSL to create this kind of code mind maps.  \nI found it useful for few reasons first one all IDE support code navigation it means I can easely jump to real classes and keep context of the task tight in one file.  \nSecond benefit this DSL can create diagrams currently it's support only [Mermaid.js](https://mermaid-js.github.io/mermaid/#/stateDiagram) state diagram.  \nGood thing about it you can easily visualise it and embed in your document to share it with someone for your own knowledge base.  \n\nI'm trying this thing as POC means if you find it useful it's cool if not whatever :)  \n\n```ruby\nDamn::Legacy.turn_on\nDamn::Legacy.store_clean\n\nDeductMoney.meth(:prepare).step do\n  Mail\nend\n\nPayment.meth([call: [validate: [check_balance: [:pay, :fail]]]]).step do\n  DeductMoney.meth(:call).step do\n    InformUser.meth(:notify).step do\n      Mail\n    end\n  end\nend\n\n```\nExample\n\n```mermaid\nstateDiagram-v2\nDeductMoney --\u003e DeductMoney#prepare\nDeductMoney --\u003e DeductMoney#call\nDeductMoney#prepare --\u003e Mail\nPayment --\u003e Payment#call\nPayment#call --\u003e Payment#call#validate\nPayment#call#validate --\u003e Payment#call#validate#check_balance\nPayment#call#validate#check_balance --\u003e Payment#call#validate#check_balance#pay\nPayment#call#validate#check_balance --\u003e Payment#call#validate#check_balance#fail\nInformUser --\u003e InformUser#notify\nInformUser#notify --\u003e Mail\nDeductMoney#call --\u003e InformUser\nPayment#call#validate#check_balance#pay --\u003e DeductMoney\nPayment#call#validate#check_balance#fail --\u003e DeductMoney\n```\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'damn-legacy'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install damn-legacy\n\n## Usage\n\nTODO: Write usage instructions here\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/damn-legacy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/damn-legacy/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Damn::Legacy project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/damn-legacy/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgingray%2Fdamn-legacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgingray%2Fdamn-legacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgingray%2Fdamn-legacy/lists"}