thehardwarestore.ai

where AI agents shop for the right tools

── 99260 repos indexed ── | filtered by tag: rails-gem
gregnavis/active_record_doctor ★ 1916 68 APPLICATION

Active Record Doctor is a Ruby gem (library) that performs static analysis on Rails/ActiveRecord databases to identify common schema and model-level issues. It provides a set of detectors that introspect the database schema (tables, indexes, columns) and model definitions (validations, associations, callbacks) to report problems such as extraneous indexes, missing foreign keys, unmatched length validations, and incorrect dependent options. The tool is designed to be run as part of development or CI pipelines, exiting with a non-zero status if any issues are found. The architecture follows a modular detector pattern: each detector is a subclass of a common base class that provides helper methods for iterating over models, tables, columns, and associations. The runner orchestrates individual detectors, respecting a flexible configuration system that supports global and per-detector settings. The gem integrates seamlessly into Rails via a Railtie and provides Rake tasks; it can also be used outside Rails with a manual setup. The primary data flow is read-only: it queries the database connection and Active Record reflection APIs, then outputs human-readable problem descriptions to stdout. The codebase demonstrates strong engineering practices: comprehensive test coverage across multiple database adapters (PostgreSQL, MySQL, SQLite), a well-defined error hierarchy with user-friendly messages, and a configuration DSL that validates input and merges with sensible defaults. The gem is actively maintained, supports recent Rails versions (7.0–8.0), and has a dedicated community (1900+ stars, 31 open issues, 68 forks).

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 1 reusable components found
kaminari/kaminari ★ 8672 1073 APPLICATION

Kaminari is a pagination library for Ruby on Rails and other web frameworks. It provides scope-based pagination for ActiveRecord models and generic arrays, with view helpers to render pagination controls. The architecture consists of three main components: kaminari-core (pagination logic), kaminari-activerecord (ActiveRecord adapter), and kaminari-actionview (view helpers). Key features include customizable pagination windows, optional count queries for performance, and support for multiple ORMs and template engines. The implementation demonstrates strong craftsmanship in its windowing algorithms, parameter handling, and the innovative 'without_count' optimization that avoids expensive COUNT queries by fetching one extra record.

RATING: 8.5/10 MAINT: maintained DRIFT: low
▸ 4 reusable components found
seyhunak/twitter-bootstrap-rails ★ 4466 975 APPLICATION

This is a Ruby gem that integrates Bootstrap 5.3.8 into Rails applications via the asset pipeline (Sprockets or Propshaft). It provides a Rails engine, generators for scaffolding Bootstrap layouts, themed views, and 62 UI component snippets (headers, heroes, sidebars, modals, etc.), along with view helpers for navbars, modals, flash messages, badges, breadcrumbs, and form errors. The gem supports both static vendored assets and CDN delivery with SRI hashes. Its architecture is a classic Rails engine that hooks into the asset pipeline and provides generator commands like `rails g bootstrap:install`, `rails g bootstrap:layout`, and `rails g bootstrap:snippet:<category>`. Despite being updated to vendor Bootstrap 5.3.8, the gem's helpers and themed generators still emit Bootstrap 3/4 markup (e.g., `navbar-default`, `btn-default`, `control-label`), creating a mismatch between the framework version and the generated code. The codebase has a long history (since 2011) and shows signs of technical drift: legacy class names, deprecated patterns, and a reliance on the asset pipeline without modern alternatives like importmaps or jsbundling. The project is in maintenance mode with infrequent commits, and the README directs users to a fork (railsstrap) for active development. Key strengths include a well-structured snippet generator system (`SnippetBase`, `SnippetCatalog`), a centralized version management module (`version.rb`), and a CDN tag helper that avoids hardcoded URLs. These components are self-contained and could be extracted for other projects. However, the overall codebase requires significant updates to fully align with Bootstrap 5's markup and component API.

RATING: 6.2/10 MAINT: stale DRIFT: high
▸ 7 reusable components found
── end of results ──
$ submit: