[RUBY] Method definition location Summary of how to check When defined in the project and Rails / Gem

Motivation

When I joined a new project, I had a lot of trouble finding out where it was defined, full of methods. In order to catch up quickly, I felt that "the ability to quickly investigate and understand" was very important, so I asked senior engineers to summarize it. There are advantages and disadvantages to checking.

For methods defined in the project

1. git grep -n <method name>

2. Enter in the search window of Github with a browser and search for "in this repository"

3. Use the show-source function of pry-docs

4. Use Pry's "step" feature

Pikawaka [Rails] Pry is thoroughly explained!

When defined outside the project such as Gem

1. Search by Dash

2. bundle show <gem name>

3. Use Pry's "step" feature

4. Enter in the search window of Github with a browser and search for "in this repository"

Other

1. Use the Rubymine definition source jump

2. Use Solargraph, an extension of VS Code

Finally

Recommended Posts

Method definition location Summary of how to check When defined in the project and Rails / Gem
How to check Rails commands in the terminal
Summary of how to use the proxy set in IE when connecting with Java
How to check the extension and size of uploaded files
[Rails] How to get the URL of the transition source and redirect
I tried to understand how the rails method "redirect_to" is defined
[Rails] How to omit the display of the character string of the link_to method
[jOOQ] How to CASE WHEN in the WHERE / AND / OR clause
How to delete large amounts of data in Rails and concerns
I tried to understand how the rails method "link_to" is defined
How to write the view when Vue is introduced in Rails?
[Rails] How to use the map method
How to change the maximum and maximum number of POST data in Spark
How to find the total number of pages when paging in Java
How to constrain the action of the transition destination when not logged in
Android development, how to check null in the value of JSON object
How to reference a column when overriding the column name method in ActiveRecord
[Rails] How to solve the time lag of created_at after save method
[Ruby on Rails] How to log in with only your name and password using the gem devise
How to operate IGV using socket communication, and the story of making a Ruby Gem using that method
Summary of how to select elements in Selenium
[Order method] Set the order of data in Rails
How to check the logs in the Docker container
Output of how to use the slice method
How to use JQuery in js.erb of Rails6
How to check the latest version of io.spring.platform to describe in pom.xml of Spring (STS)
[Ruby on Rails] Rails tutorial Chapter 14 Summary of how to implement the status feed
[Rails] How to operate the helper method used in the main application with Administrate
How to make a unique combination of data in the rails intermediate table
Summary of frequently used commands in Rails and Docker
How to set the display time to Japan time in Rails
How to install Docker in the local environment of an existing Rails application [Rails 6 / MySQL 8]
How to use UsageStatsManager in Android Studio (How to check the startup time of other apps)
How to get the class name of the argument of LoggerFactory.getLogger when using SLF4J in Java
[Rails] How to change the column name of the table
Summary of copy and paste commands used when you want to delete the cache in iOS application development anyway
Library not loaded when trying to upgrade the version of ruby and rails s
[Rough explanation] How to separate the operation of the production environment and the development environment with Rails
[Rails] How to get the contents of strong parameters
Summary of how to implement default arguments in Java
[Rails] How to solve the error "undefined method` visit'" when using Capybara with Rspec
[Rails] How to display an image in the view
[Rails] How to display the weather forecast of the registered address in Japanese using OpenWeatherMap
[Ruby On Rails] How to search and save the data of the parent table from the child table
How to specify an array in the return value / argument of the method in the CORBA IDL file
How to write comments in the schema definition file in GraphQL Java and reflect them in GraphQL and GraphQL Playground
Check how to set the timeout when connecting with Spring + HikariCP + MySQL and executing SQL
How to get the class name / method name running in Java
How to correctly check the local HTML file in the browser
How to use the getter / setter method (in object orientation)
How to set chrony when the time shifts in CentOS7
[Rails] How to define macros in Rspec and standardize processing
Let's summarize how to extend the expiration date of Rails
[Rails] How to display the list of posts by category
How to derive the last day of the month in Java
How to run React and Rails on the same server
[Rails] Where to be careful in the description of validation
[Rails] How to display information stored in the database in view
How to check the database of apps deployed on Heroku
[Rails] How to temporarily save the request URL of a user who is not logged in and return to that URL after logging in
[Rails] How to convert the URI of the image sent by http to https when using Twitter API