{"id":13835652,"url":"https://github.com/jamesmoriarty/call-graph","last_synced_at":"2025-04-13T13:51:14.653Z","repository":{"id":146928133,"uuid":"80278347","full_name":"jamesmoriarty/call-graph","owner":"jamesmoriarty","description":"Capture execution and create dependency graphs.","archived":false,"fork":false,"pushed_at":"2020-10-27T11:21:39.000Z","size":136,"stargazers_count":17,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T04:51:17.521Z","etag":null,"topics":["graph","graphviz","instrumentation","ruby"],"latest_commit_sha":null,"homepage":"","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/jamesmoriarty.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-28T10:29:39.000Z","updated_at":"2023-09-24T07:39:12.000Z","dependencies_parsed_at":"2024-01-20T20:19:12.134Z","dependency_job_id":"75754968-f01b-4099-ba10-3663e52bdb2e","html_url":"https://github.com/jamesmoriarty/call-graph","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesmoriarty%2Fcall-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesmoriarty%2Fcall-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesmoriarty%2Fcall-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesmoriarty%2Fcall-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesmoriarty","download_url":"https://codeload.github.com/jamesmoriarty/call-graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724588,"owners_count":21151559,"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":["graph","graphviz","instrumentation","ruby"],"created_at":"2024-08-04T14:01:07.548Z","updated_at":"2025-04-13T13:51:14.632Z","avatar_url":"https://github.com/jamesmoriarty.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# CallGraph\n\n[![Build Status](https://travis-ci.org/jamesmoriarty/call-graph.svg?branch=master)](https://travis-ci.org/jamesmoriarty/call-graph)\n\nCapture execution and create dependency graphs.\n\n## Why\n\n\u003e The Law of Demeter (LoD) or principle of least knowledge is a design guideline for developing software, particularly object-oriented  programs. In its general form, the LoD is a specific case of loose coupling. The guideline was proposed by Ian Holland at Northeastern  University towards the end of 1987, and can be succinctly summarized in each of the following ways:[1]\n\n\u003e - Each unit should have only limited knowledge about other units: only units \"closely\" related to the current unit.\n\u003e - Each unit should only talk to its friends; don't talk to strangers.\n\u003e - Only talk to your immediate friends.\n\n## Install\n\n[![Gem Version](https://badge.fury.io/rb/call_graph.svg)](https://badge.fury.io/rb/call_graph)\n\n```\ngem install call_graph\n```\n\n## Usage\n\nCapture the execution you want to graph between `CallGraph.trace { }`.\n\n```ruby\nclass A\n  def self.x\n    B.new.y\n  end\nend\n\nclass B\n  def y\n    1 + C.z do\n      1\n    end\n  end\nend\n\nclass C\n  def self.z\n    yield\n  end\nend\n```\n\n```ruby\nrequire 'call_graph'\n\nCallGraph.config do |config|\n  config.file_path = \"examples/call-graph\"\nend\n\nCallGraph.trace do\n  A.x\nend\n```\n\nPrint the captured execution with the provided rake tasks.\n\n```ruby\n# Rakefile\nload 'call_graph/tasks/printer.rake'\n```\n\n```shell\n$ rake -T\n...\nrake call_graph:printer:dot  # write dot file\nrake call_graph:printer:png  # write png file from dot file\n```\n\n[![Example Graph](https://github.com/jamesmoriarty/call-graph/raw/master/examples/call-graph.png)](https://github.com/jamesmoriarty/call-graph/blob/master/examples/call-graph.png)\n\n\n## Configuration\n\n```ruby\nCallGraph.config do |config|\n  config.file_path = \"examples/call-graph\"\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` 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 tags, 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 \u003chttps://github.com/jamesmoriarty/call_graph\u003e. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmoriarty%2Fcall-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesmoriarty%2Fcall-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmoriarty%2Fcall-graph/lists"}