{"id":13878273,"url":"https://github.com/yhirano55/trace_location","last_synced_at":"2025-05-15T06:08:59.672Z","repository":{"id":38705637,"uuid":"184399456","full_name":"yhirano55/trace_location","owner":"yhirano55","description":"🔍Help you get reading the huge open souce libraries in Ruby and trace its source locations ","archived":false,"fork":false,"pushed_at":"2025-01-02T23:18:32.000Z","size":319,"stargazers_count":257,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-13T20:13:00.732Z","etag":null,"topics":["codereader","rails","tracepoints"],"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/yhirano55.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-05-01T10:15:29.000Z","updated_at":"2025-05-08T16:14:59.000Z","dependencies_parsed_at":"2024-12-20T15:03:35.593Z","dependency_job_id":"37df7d2b-fc14-4019-9686-c7ae7212e86a","html_url":"https://github.com/yhirano55/trace_location","commit_stats":{"total_commits":99,"total_committers":10,"mean_commits":9.9,"dds":0.202020202020202,"last_synced_commit":"f02c0ae6ab6a039c0ccd87acb3bcf28f736d883c"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirano55%2Ftrace_location","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirano55%2Ftrace_location/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirano55%2Ftrace_location/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirano55%2Ftrace_location/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yhirano55","download_url":"https://codeload.github.com/yhirano55/trace_location/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254029718,"owners_count":22002431,"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":["codereader","rails","tracepoints"],"created_at":"2024-08-06T08:01:44.786Z","updated_at":"2025-05-15T06:08:59.621Z","avatar_url":"https://github.com/yhirano55.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# TraceLocation\n\n[![Gem Version](https://badge.fury.io/rb/trace_location.svg)](https://badge.fury.io/rb/trace_location)\n\nTraceLocation helps you trace the source location to ease reading huge open-source libraries in Ruby.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'trace_location'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install trace_location\n\n## Usage\n\n### Example: Track establish connection in Active Record\n\n```ruby\nconfig = Rails.application.config.database_configuration[Rails.env]\n\nTraceLocation.trace do\n  # You just surround you want to track the process.\n  ActiveRecord::Base.establish_connection(config)\nend\n```\n\nThen you can get logs like this: [.md](https://github.com/yhirano55/trace_location/blob/master/examples/active_record_establish_connection/result.md), [.log](https://github.com/yhirano55/trace_location/blob/master/examples/active_record_establish_connection/result.log), [.csv](https://github.com/yhirano55/trace_location/blob/master/examples/active_record_establish_connection/result.csv)\n\n### Trace method options\n\n| name | content | example |\n|:-----|:--------|:--------|\n| format | `:md`, `:log`, `:csv` (default: `:md`) | `:md` |\n| match | Regexp, Symbol, String or Array for allow list | `[:activerecord, :activesupport]` |\n| ignore | Regexp, Symbol, String or Array for deny list | `/bootsnap\\|activesupport/` |\n| methods | Symbol or Array of method names | `[:call]` |\n\n## More examples\n\n### Example: Track the validation process of Active Record\n\n```ruby\nbook = Book.new(title: \"My Book Title\")\nTraceLocation.trace(match: /activerecord/) { book.validate }\n```\n\nResults: [.md](https://github.com/yhirano55/trace_location/blob/master/examples/active_record_validation_process/result.md), [.log](https://github.com/yhirano55/trace_location/blob/master/examples/active_record_validation_process/result.log), [.csv](https://github.com/yhirano55/trace_location/blob/master/examples/active_record_validation_process/result.csv)\n\n### Example: Track the lifecycle of Rails application\n\n```ruby\nenv = Rack::MockRequest.env_for('http://localhost:3000/books')\n\nTraceLocation.trace do\n  status, headers, body = Rails.application.call(env)\nend\n```\n\nResults: [.md](https://github.com/yhirano55/trace_location/blob/master/examples/lifecycle_of_rails_application/result.md), [.log](https://github.com/yhirano55/trace_location/blob/master/examples/lifecycle_of_rails_application/result.log), [.csv](https://github.com/yhirano55/trace_location/blob/master/examples/lifecycle_of_rails_application/result.csv)\n\n### Example: Track the `has_secure_password` in User model\n\n```ruby\nclass User \u003c ApplicationRecord\n  # temporary surrounding with TraceLocation#trace\n  TraceLocation.trace(format: :md, ignore: /activesupport/) do\n    has_secure_password\n  end\n```\n\nResults: [.md](https://github.com/yhirano55/trace_location/blob/master/examples/has_secure_password/result.md), [.log](https://github.com/yhirano55/trace_location/blob/master/examples/has_secure_password/result.log), [.csv](https://github.com/yhirano55/trace_location/blob/master/examples/has_secure_password/result.csv)\n\n### Example: Track the rendering process of action in controller class\n\n```ruby\nclass BooksController \u003c ApplicationController\n  before_action :set_book, only: [:show, :update, :destroy]\n\n  # GET /books\n  def index\n    @books = Book.all\n\n    # temporary surrounding with TraceLocation#trace\n    TraceLocation.trace(format: :md, ignore: /activesupport|rbenv|concurrent-ruby/) do\n      render json: @books\n    end\n  end\n```\n\nResults: [.md](https://github.com/yhirano55/trace_location/blob/master/examples/rendering_process/result.md), [.log](https://github.com/yhirano55/trace_location/blob/master/examples/rendering_process/result.log), [.csv](https://github.com/yhirano55/trace_location/blob/master/examples/rendering_process/result.csv)\n\n## License\n\n[MIT License](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhirano55%2Ftrace_location","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyhirano55%2Ftrace_location","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhirano55%2Ftrace_location/lists"}