Skip to content
Back to skills

Ruby

ASecurity

Write reliable Ruby avoiding mutable string traps, block pitfalls, and metaprogramming bugs.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
developmentrubyrails

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add johnalbertini14-glitch/openclaw-skills --skill ruby --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ruby?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ruby
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/johnalbertini14-glitch-ruby/badge)](https://www.skillsdirectory.com/skills/johnalbertini14-glitch-ruby)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Ruby
slug: ruby
version: 1.0.1
description: Write reliable Ruby avoiding mutable string traps, block pitfalls, and metaprogramming bugs.
metadata: {"clawdbot":{"emoji":"πŸ’Ž","requires":{"bins":["ruby"]},"os":["linux","darwin","win32"]}}
---

## Quick Reference

| Topic | File |
|-------|------|
| Mutable strings, object equality | `objects.md` |
| Proc vs lambda, return behavior | `blocks.md` |
| Visibility, method_missing | `methods.md` |
| Array/hash mutation traps | `collections.md` |
| define_method, eval traps | `metaprogramming.md` |
| ActiveRecord, N+1, callbacks | `rails.md` |

## Critical Rules

- Strings are mutable β€” `s = "hi"; s << "!"; t = s` means t also has "!"
- `==` vs `equal?` vs `eql?` β€” `==` value, `equal?` identity, `eql?` hash equality
- Default hash value is shared β€” `Hash.new([])` shares same array, use block form
- `return` in proc returns from enclosing method β€” use lambda for local return
- Block variable shadows outer scope β€” `x = 1; [2].each { |x| }; x` is still 1 (3.0+)
- `method_missing` without `respond_to_missing?` β€” breaks `respond_to?` checks
- `private` in Ruby is per-object β€” `self.private_method` fails, implicit receiver works
- `||=` doesn't work for false/nil distinction β€” `false ||= true` replaces false
- Frozen string literals β€” `# frozen_string_literal: true` makes strings immutable
- `Symbol#to_proc` β€” `&:method_name` only works with no-argument methods
- `rescue => e` without type β€” catches StandardError, not Exception
- `ensure` always runs β€” even after return, use for cleanup

Files in this skill

  • SKILL.md1.5 KB
  • _meta.json443 B
  • blocks.md595 B
  • collections.md614 B
  • metaprogramming.md645 B
  • methods.md542 B
  • objects.md620 B
  • rails.md805 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development β†’

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.