You can use strace on a specific pid to figure out what a specific process is doing, e.g.:
strace -fp <pid>
You might see something like:
select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)
| module Where | |
| class <<self | |
| attr_accessor :editor | |
| def is_proc(proc) | |
| source_location(proc) | |
| end | |
| def is_method(klass, method_name) | |
| source_location(klass.method(method_name)) |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
| Here is a list of scopes to use in Sublime Text 2 snippets - | |
| ActionScript: source.actionscript.2 | |
| AppleScript: source.applescript | |
| ASP: source.asp | |
| Batch FIle: source.dosbatch | |
| C#: source.cs | |
| C++: source.c++ | |
| Clojure: source.clojure | |
| CoffeeScript: source.coffee |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| # No flash messages are set with this controller. | |
| # | |
| # This is a fairly basic / bare controller which does only the basic CRUD. | |
| class BooksController < ApplicationController | |
| respond_to :html, :xml, :json | |
| before_action :set_book, only: [:show, :edit, :update, :destroy] | |
| def index | |
| respond_with @books = Book.all |
Note: This guide works with Ruby 2.6+ through Ruby 3.x, with modern Ruby 3.x features highlighted where applicable. Core metaprogramming concepts remain consistent across Ruby versions.
This document has been collaboratively updated and modernized through an interactive process with Claude Code, revised with examples, visual diagrams, and Ruby 3.x compatibility.