惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
WordPress大学
WordPress大学
罗磊的独立博客
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security
S
SegmentFault 最新的问题
C
Check Point Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
Engineering at Meta
Engineering at Meta
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
D
DataBreaches.Net
雷峰网
雷峰网
GbyAI
GbyAI
宝玉的分享
宝玉的分享

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built a Ruby gem so I don't have to squint at hash dump...
Ender Ahmet · 2026-05-08 · via DEV Community
Cover image for I built a Ruby gem so I don't have to squint at hash dumps anymore

Ender Ahmet Yurt

I love Ruby. I love the console. I do not love this:

{:name=>"Alice", :score=>100, :active=>true}
{:name=>"Bob", :score=>42, :active=>false}

Enter fullscreen mode Exit fullscreen mode

When you have 20 of these in a row, good luck reading anything.

So I built a tiny gem called typed_print.

What does it do?

One thing. Just one.

It turns hashes into clean, aligned tables.

require 'typed_print'

data = [
  { name: "Alice", score: 100, active: true },
  { name: "Bob", score: 42, active: false }
]

TypedPrint.print(data)

Enter fullscreen mode Exit fullscreen mode

Output

 Name  Score Active 
------+------+-------
Alice   100 true   
Bob      42 false  

Enter fullscreen mode Exit fullscreen mode

That's it. No magic. No mental parsing.

Why not just use pp or awesome_print?

  • pp is fine, but still hard to scan.
  • awesome_print is great, but sometimes you don't want colors, JSON support, or 10 dependencies.

I wanted something that:

  • Has zero required dependencies
  • Only does tables
  • Works everywhere (Rails, Rake tasks, plain Ruby scripts, even minimal Docker containers)

What can you do with it?

1. Align columns

TypedPrint.print(data, align: { score: :right })

Enter fullscreen mode Exit fullscreen mode

2. Show only what you need

TypedPrint.print(data, only: [:name, :score])

Enter fullscreen mode Exit fullscreen mode

3. Custom headers

TypedPrint.print(data, headers: { name: "User", score: "Points" })

Enter fullscreen mode Exit fullscreen mode

4. Markdown output (great for docs)

TypedPrint.print(data, format: :markdown)

Enter fullscreen mode Exit fullscreen mode

Outputs a proper markdown table you can copy into GitHub READMEs.

5. Colors! (v0.3.0)

TypedPrint.print(data, color: true)

Enter fullscreen mode Exit fullscreen mode

Or full control:

TypedPrint.print(data, colors: { name: :cyan, score: :green, active: :yellow })

Enter fullscreen mode Exit fullscreen mode

  • Pastel is optional. If you don't have it, colors are ignored. No errors.

Example with different data types

mixed = [
  { name: "Product A", price: 29.99, in_stock: true, notes: nil },
  { name: "Product B", price: 49.99, in_stock: false, notes: "Limited" }
]

TypedPrint.print(mixed)

Enter fullscreen mode Exit fullscreen mode

Output:

   Name      Price In_stock Notes        
----------+-------+---------+-------------
Product A   29.99 true                  
Product B   49.99 false    Limited edition

Enter fullscreen mode Exit fullscreen mode

It handles nil, booleans, numbers, and strings automatically.

What about performance?

It's lightweight. Zero dependencies means no hidden bloat.
I've tested it with 10,000 rows. Still fast enough for CLI tools and debugging.
For massive datasets? You probably shouldn't print them to the terminal anyway.

Who is this for?

  • Rails developers who debug in the console
  • CLI tool authors who want clean output
  • Anyone who logs hashes and wants them readable
  • People who are tired of pp

Links

What's next?

I'm keeping it simple. No roadmap to become a bloated framework.

But if you have an idea that fits the "zero-dependency, just tables" philosophy – open an issue. I shipped markdown support within hours of a user request (that was v0.2.0).

Try it

gem install typed_print

Enter fullscreen mode Exit fullscreen mode

That's it. You're done.

If you find it useful, let me know. If you find a bug, also let me know.

Thanks for reading 🙏