Share Ruby code with CodeThis
Ruby still reads like pseudocode. Paste a Rails snippet, a Sinatra endpoint, or a metaprogramming trick.
Paste Ruby nowWhat you get
- Ruby-aware syntax highlighting via CodeMirror
- Instant shareable link — no signup required
- Optional expiration (7 days, 30 days, permanent)
- Password protection for private pastes
- Works with the REST API and MCP server
- Rich markdown and MDC components alongside code
Common use cases for Ruby pastes
- Rails controllers and models
- Sidekiq workers
- One-off scripts
- Rake tasks and migrations
Example
class Array
def chunk_by_size(n)
each_slice(n).to_a
end
end
[1, 2, 3, 4, 5].chunk_by_size(2)
# => [[1, 2], [3, 4], [5]]
Related languages
Ready to share some Ruby?