Ruby

Share Ruby code online.

Share Ruby scripts, Rails controller code, or Enumerable chains: syntax-highlighted and shareable with a single link.

textdrop.sh/xk4mR2
1# Group users by subscription tier and compute summary stats2def subscription_summary(users)3  users4    .group_by(&:plan)5    .transform_values do |group|6      {7        count:   group.size,8        revenue: group.sum(&:monthly_revenue),9        churn:   group.count { |u| u.churned_at.present? }.fdiv(group.size),10      }11    end12    .sort_by { |_, v| -v[:revenue] }13    .to_h14end1516# Usage17summary = subscription_summary(User.active.includes(:subscriptions))18summary.each do |plan, stats|19  puts "#{plan}: #{stats[:count]} users, $#{stats[:revenue]}/mo"20end
Every paste includes

Ruby syntax highlighting

Paste Ruby code and get a shareable link with full syntax highlighting, server-side rendered with no JavaScript overhead.

Burn after read

Deleted on first open. Can't be viewed twice.

Password protection

Add a password for end-to-end encryption with no raw key stored.

Configurable expiry

Set pastes to expire after 1 hour, 1 day, 7 days, or up to 30 days. Gone when you say so.

No account needed

No sign-up, no email, no ads. Paste and share in seconds.

How it works
Plain Text
Markdown
Code
DB_HOST=db-01.prod.internal
DB_USER=api_svc
DB_PASS=xK9$mP2!qR7nLw2
REDIS_URL=redis://:abc@cache:6379
delete after setup — expires 1hr
7 days
Share
textdrop.sh/
7 days · plain text
Use cases
  • 01Share Rails controller or service object code
  • 02Send Enumerable / functional patterns
  • 03Share Rake task implementations
  • 04Distribute Ruby gem code snippets
  • 05Send ActiveRecord query examples
FAQ
Does the Ruby grammar support ERB templates?+

For ERB, paste as HTML: it won't highlight Ruby inside ERB tags but the HTML structure will be highlighted.

Is there a size limit?+

Pastes up to 5 MB are supported.

Can I share Gemfile content?+

Yes. Select Ruby as the language for Gemfile content.

Other languages
Drop your code