coding-ruby
coding-ruby
Purpose
This skill allows the AI to generate, debug, and optimize Ruby 3.x code, focusing on advanced constructs like blocks, procs, lambdas, metaprogramming, modules, gem management with Bundler, Rails web apps, and RSpec testing.
When to Use
Use this skill for tasks involving Ruby scripting, such as building web applications with Rails, managing dependencies via Bundler, writing unit tests with RSpec, or applying metaprogramming for dynamic code generation. Apply it when users request code for e-commerce sites, API backends, or custom gems.
Key Capabilities
- Handle blocks and procs: Define and yield blocks in methods, e.g., for iterators.
- Implement metaprogramming: Use
define_methodormethod_missingfor dynamic class creation. - Manage modules: Create and include modules for namespacing, like
module MyModule; end. - Work with Bundler: Install and manage gems via Gemfiles for dependency resolution.
- Build Rails apps: Generate models, controllers, and routes for MVC architecture.
- Write RSpec tests: Create specs for behavior-driven development, including matchers and mocks.
Usage Patterns
To accomplish tasks, structure code with Ruby's idioms: use procs for callbacks, modules for reusable code, and metaprogramming for automation. For Rails, follow the MVC pattern; for RSpec, use describe/it blocks. Always check Ruby 3.x syntax, like pattern matching with case statements. To define a lambda: my_lambda = ->(x) { x * 2 }. Invoke it as my_lambda.call(5). For metaprogramming, add methods dynamically: class MyClass; define_method(:greet) { puts 'Hello' }; end. Integrate Bundler by running bundle install after editing Gemfiles.
More from alphaonedev/openclaw-graph
playwright-scraper
Playwright web scraping: dynamic content, auth flows, pagination, data extraction, screenshots
1.4Kgcp-iam
Manages identity and access control for Google Cloud resources using IAM policies and roles.
370humanize-ai-text
AI text humanization: reduce AI-detection patterns, natural phrasing, tone adjustment
260macos-automation
AppleScript, JXA, Shortcuts, Automator, osascript, System Events, accessibility API
173tavily-web-search
Tavily: web search optimized for AI agents, answer synthesis, domain filtering, depth control
155clawflows
OpenClaw workflow automation: multi-step task chains, conditional logic, triggers, schedule
102