yhirano55 / Trace_location
Licence: mit
🔍Help you get reading the huge open souce libraries in Ruby and trace its source locations
Stars: ✭ 130
Programming Languages
ruby
36898 projects - #4 most used programming language
Labels
Projects that are alternatives of or similar to Trace location
Trestle
A modern, responsive admin framework for Ruby on Rails
Stars: ✭ 1,676 (+1189.23%)
Mutual labels: rails
Rails sortable
Easy drag & drop sorting with persisting the arranged order for rails
Stars: ✭ 127 (-2.31%)
Mutual labels: rails
Closure tree
Easily and efficiently make your ActiveRecord models support hierarchies
Stars: ✭ 1,665 (+1180.77%)
Mutual labels: rails
Boring generators
Boring generators aims to make your development faster by delegating boring setups to us.
Stars: ✭ 125 (-3.85%)
Mutual labels: rails
Sabisu Rails
Simple and powerful engine for exploring your Rails api application
Stars: ✭ 129 (-0.77%)
Mutual labels: rails
Zero Rails openapi
Concise DSL for generating OpenAPI Specification 3 (OAS3) JSON documentation for Ruby application.
Stars: ✭ 125 (-3.85%)
Mutual labels: rails
Spree auth devise
Provides authentication (user accounts, login & signup) for @spree by using Devise
Stars: ✭ 124 (-4.62%)
Mutual labels: rails
Awesome Ruby Blogs
A curated list of Awesome Ruby Blogs and Newsletters for Ruby Developers and Newbies
Stars: ✭ 127 (-2.31%)
Mutual labels: rails
Catarse
The first open source crowdfunding platform for creative projects in the world
Stars: ✭ 1,575 (+1111.54%)
Mutual labels: rails
Rails React Typescript Docker Example
An example app built on Ruby on Rails 6.1 + React.js 17 + TypeScript 4.2 + Docker Compose
Stars: ✭ 129 (-0.77%)
Mutual labels: rails
String template
A template engine for Rails, focusing on speed, using Ruby's String interpolation syntax
Stars: ✭ 122 (-6.15%)
Mutual labels: rails
Activerecord where assoc
Make ActiveRecord do conditions on your associations
Stars: ✭ 126 (-3.08%)
Mutual labels: rails
Rspec Openapi
Generate OpenAPI schema from RSpec request specs
Stars: ✭ 129 (-0.77%)
Mutual labels: rails
Master rails by actions
Rails实战之B2C商城开发 http://eggman.tv/c/s-master-rails-by-actions
Stars: ✭ 127 (-2.31%)
Mutual labels: rails
TraceLocation
TraceLocation helps you get tracing the source location of codes, and helps you can get reading the huge open souce libraries in Ruby.
Installation
Add this line to your application's Gemfile:
gem 'trace_location'
And then execute:
$ bundle
Or install it yourself as:
$ gem install trace_location
Usage
Example: Track establish connection in Active Record
config = Rails.application.config.database_configuration[Rails.env]
TraceLocation.trace do
# You just surround you want to track the process.
ActiveRecord::Base.establish_connection(config)
end
Then you can get logs like this: .md, .log, .csv
Trace method options
name | content | example |
---|---|---|
format |
:md , :log , :csv (default: :md ) |
:md |
match | Regexp, Symbol, String or Array for allow list | [:activerecord, :activesupport] |
ignore | Regexp, Symbol, String or Array for deny list | /bootsnap|activesupport/ |
More examples
Example: Track the validation process of Active Record
book = Book.new(title: "My Book Title")
TraceLocation.trace(match: /activerecord/) { book.validate }
Example: Track the lifecycle of Rails application
env = Rack::MockRequest.env_for('http://localhost:3000/books')
TraceLocation.trace do
status, headers, body = Rails.application.call(env)
end
has_secure_password
in User model
Example: Track the class User < ApplicationRecord
# temporary surrounding with TraceLocation#trace
TraceLocation.trace(format: :md, ignore: /activesupport/) do
has_secure_password
end
Example: Track the rendering process of action in controller class
class BooksController < ApplicationController
before_action :set_book, only: [:show, :update, :destroy]
# GET /books
def index
@books = Book.all
# temporary surrounding with TraceLocation#trace
TraceLocation.trace(format: :md, ignore: /activesupport|rbenv|concurrent-ruby/) do
render json: @books
end
end
License
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].