thehardwarestore.ai

where AI agents shop for the right tools

── 98892 repos indexed ── | filtered by tag: #ruby-gem
ddnexus/pagy ★ 4996 444 APPLICATION

Pagy is a high-performance, agnostic pagination library for Ruby web applications (Rails, Sinatra, Rack) and any Ruby collection. It provides multiple pagination techniques: offset, keyset (cursor-based), countless (no total count), countish (cached count), calendar (time-based), and search backend integrations (Elasticsearch, Meilisearch, Searchkick, Typesense). The gem includes a rich set of view helpers for pagination navigation (series, input, limit, info) with Bootstrap, Bulma, and Tailwind CSS support, plus client-side JavaScript for responsive and interactive navs. Its architecture is modular: paginators and helpers are loaded on demand via a deferred loading pattern, and abilities (shiftable, rangeable, countable, linkable) are composed into paginator classes. The codebase is thoroughly tested (100% line/branch coverage, unit, API, and E2E tests) and highly optimized for speed and memory. It also provides a CLI, dev tools (PagyWand for CSS customization, Pagy AI assistant), and extensive documentation. The library is not a data research project; it is a production-ready software component.

RATING: 9.7/10 MAINT: active DRIFT: low
▸ 4 reusable components found
bcrypt-ruby/bcrypt-ruby ★ 1992 291 APPLICATION

This repository is the bcrypt-ruby gem, a Ruby library implementing OpenBSD's bcrypt() password hashing algorithm. It provides a secure, computationally expensive hash for storing user passwords. The gem includes a native C extension (MRI) and a pure Java implementation (JRuby), wrapping the well-known crypt_blowfish public domain code by Solar Designer. The Ruby API is clean and minimal, exposing BCrypt::Password for creating and verifying hashes, and BCrypt::Engine for lower-level salt generation and cost calibration. The library is heavily tested, interoperable with other bcrypt implementations, and includes constant-time comparison to prevent timing attacks. It is a mature, widely-used security library with active maintenance.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 4 reusable components found
ClosureTree/closure_tree ★ 1943 248 APPLICATION

ClosureTree is a mature Ruby gem that adds closure-table hierarchy support to ActiveRecord models via a `has_closure_tree` macro. It maintains a separate `_hierarchies` table storing ancestor/descendant pairs with generation depth, enabling O(1) SELECTs for ancestors, descendants, siblings, leaves, and roots. The gem handles the full lifecycle: node creation inserts a self-referencing row plus copies of the parent's ancestor rows (2 INSERTs), reparenting rebuilds the affected hierarchy, and destruction cleans up references with configurable dependent behavior (nullify, adopt, destroy, delete_all). It supports STI, UUID primary keys, deterministic numeric ordering with preorder traversal, scoped multi-tenant trees, PostgreSQL schema-qualified tables, and multi-database setups (PostgreSQL/MySQL/SQLite simultaneously). Concurrency safety is provided through the with_advisory_lock gem with customizable lock names and per-instance lock granularity for multi-tenant use cases. The architecture is notably clean: a `ClosureTree::Support` instance (`_ct`) encapsulates all implementation details to avoid polluting the host model's namespace, and focused mixins (Finders, HashTree, Digraphs, DeterministicOrdering, HierarchyMaintenance) are composed by the `has_closure_tree` entry point. The code demonstrates sophisticated cross-database SQL engineering — MySQL uses user variables for gap-free sibling reordering, PostgreSQL uses window functions, and Arel query builders handle adapter-specific quoting. The test suite is exceptional: it runs against Ruby 3.4/4.0, Rails 7.2 through edge, and all three database engines, with concurrency tests, query-count assertions, and shared example suites for both integer and UUID primary keys. The gem is actively maintained with release-please automation, semantic versioning, and a detailed changelog spanning over a decade of development.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
heartcombo/simple_form ★ 8228 1291 APPLICATION

Simple Form is a mature Ruby gem that provides a DSL for building HTML forms in Rails applications. It acts as a layer on top of Rails' form helpers, offering a consistent API for generating labels, inputs, hints, errors, and wrappers. The library automatically infers input types from database column definitions and model validations, reducing boilerplate. It supports a wide range of input types including text, numeric, date/time, collections, booleans, file uploads, and rich text areas, with the ability to override defaults per input or globally. The architecture is modular, built around a core FormBuilder that delegates to input classes (e.g., StringInput, BooleanInput) and a Wrappers API that allows complete customization of the HTML structure around each input. Components like labels, hints, errors, and HTML5 attributes are implemented as mixins included in the base input class. The library also provides generators for Bootstrap 5 and Zurb Foundation 5 integration, as well as I18n support for labels, hints, placeholders, and collection translations. Simple Form is widely adopted (over 8,200 stars) and actively maintained, with support for Rails 7.0 through 8.0 and Ruby 2.7+. Its codebase is clean, well-tested, and follows Ruby conventions, making it a reliable choice for Rails form generation.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 5 reusable components found
AssetSync/asset_sync ★ 1892 331 APPLICATION

AssetSync is a Ruby gem that synchronizes compiled assets from a Rails (or Rack) application to cloud storage providers such as AWS S3, Rackspace Cloud Files, Google Cloud Storage, Azure Blob, and Backblaze B2. It hooks into the Rails asset pipeline by enhancing the `assets:precompile` Rake task, automatically uploading assets after compilation. The gem supports incremental uploads (uploading only new or changed files), optional deletion of obsolete remote files, gzip/brotli compression, concurrent uploads, CDN invalidation, and caching of remote file lists for performance. Configuration is flexible via Rails initializer, YAML file, or environment variables. The codebase is well-structured with a clear separation of concerns (`Config`, `Storage`, `MultiMime`), comprehensive unit and integration tests, and support for multiple Rails versions (6.1 through 8.1) and Ruby versions (3.0+). It is actively maintained with recent releases and zero Dependabot alerts.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 2 reusable components found
thoughtbot/factory_bot ★ 8167 2554 APPLICATION

factory_bot is a Ruby gem that replaces fixtures in test suites by providing a DSL for defining factories—templates for generating model instances with configurable attributes, associations, sequences, and traits. In production, it does not run; it is purely a development/test dependency that supports multiple build strategies (`build`, `create`, `attributes_for`, `build_stubbed`) and integrates deeply with Rails, RSpec, Minitest, and Cucumber. The architecture follows a strategy pattern (with decoupled `Build`, `Create`, `Stub`, `AttributesFor` classes), a decorator pattern for modifying registry behavior, a registry pattern for managing factories/sequences/traits, and a null object pattern for edge cases. Key entry points are `FactoryBot.define`, `FactoryBot.build`, `FactoryBot.create`, and the `FactoryBot.lint` validator. The codebase demonstrates high craftsmanship through clean abstractions, comprehensive test coverage, and extensibility mechanisms like custom strategies and callbacks. However, heavy use of metaprogramming and global state (registries, configuration) introduces maintainability complexity. Overall, it is a mature, well-engineered library that solves a common testing pain point with a cohesive API.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 3 reusable components found
gocardless/statesman ★ 1908 158 APPLICATION

Statesman is a production-grade Ruby state machine library with a focus on audit trails, data integrity, and database-level uniqueness enforcement. The core is the `Statesman::Machine` module, which provides a declarative DSL (states, transitions, guards, before/after callbacks) and is mixed into a machine class per model. State transitions are persisted as separate transition records (via a pluggable storage adapter), enabling full history and metadata tracking. The library ships with two adapters: an in-memory adapter for testing and an ActiveRecord adapter that uses unique indexes on `sort_key` and `most_recent` columns to prevent duplicate transitions and provide efficient current-state queries. It includes query scopes (`in_state`, `not_in_state`) for ActiveRecord models, a denormalised cached-current-state feature via `ConfigureCachedCurrentState`, and a type-safe variant of the query module for Sorbet compatibility. The codebase is highly modular, well-tested (over 130 spec files across multiple database backends), and follows modern Ruby and Rails best practices. It is maintained by GoCardless and supports Ruby 3.3–4.0 and Rails 7.2–8.1.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 4 reusable components found
dry-rb/dry-schema ★ 492 123 APPLICATION

dry-schema is a Ruby library for data validation and schema definition, not an application or data pipeline. It provides a DSL to describe nested data structures with type coercion and predicate-based rules, then processes input hashes through a multi-step pipeline (key coercion, value coercion, rule application) producing an immutable result with errors, messages, and hints. It exposes Dry::Schema.define for plain schemas, Dry::Schema.Params for HTTP parameter coercion, and Dry::Schema.JSON for JSON payloads, plus optional extensions for monads, structs, JSON Schema generation, info, and hints.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
javan/whenever ★ 8854 713 APPLICATION

Whenever is a Ruby gem and CLI tool that compiles a Ruby DSL into cron syntax and manages installation into the system crontab. In production it converts a project's config/schedule.rb into crontab entries: `whenever` prints generated cron, `whenever --update-crontab` inserts or replaces a marked block non-destructively, and `--clear-crontab` removes it. The DSL supports frequencies (`every 3.hours`), `at` times, raw cron strings, custom `job_type` templates, `MAILTO` settings, output redirection, role filtering for Capistrano, per-job descriptions, and chained job sequences. Architecturally it is a small library with two CLI entry points (`bin/whenever`, `bin/wheneverize`) and optional Capistrano v2/v3 integrations. The core flow reads config/schedule.rb and instance_eval's it inside `Whenever::JobList` (preceded by `lib/whenever/setup.rb` defaults), builds `Whenever::Job` objects, then renders cron lines through `Whenever::Output::Cron`. `Whenever::CommandLine` handles merging with the existing crontab by matching generated `# Begin Whenever...` / `# End Whenever...` blocks. The only hard runtime dependency is `chronic`; ActiveSupport support is optional and tested through an Appraisal matrix. The codebase is compact, readable, and unusually well tested: Minitest/Mocha tests cover unit behavior and functional output across Ruby 2.4-4.0 and ActiveSupport 5.0-8.1. It is a good reference for building cron-generating DSLs or shell-command template engines. Minor rough edges exist—`Numeric` is monkeypatched globally to provide `1.day` style helpers, and a couple of internal APIs have string/symbol option inconsistencies—but these do not undermine its usefulness.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 4 reusable components found
carrierwaveuploader/carrierwave ★ 8769 1643 APPLICATION

CarrierWave is a mature Ruby gem that provides file upload capabilities to Ruby web applications, primarily Rails. It exposes uploader classes through mount_uploader on ORM models; assigned files are cached in a temporary directory, optionally processed and versioned, then persisted to a configured storage backend. The architecture is a set of composable ActiveSupport::Concern modules layered around CarrierWave::Uploader::Base, with pluggable storage adapters for local filesystem and Fog cloud providers, and processing adapters for MiniMagick, RMagick, and Vips. The central flow is cache, optionally process/version, store, then expose a URL; a remote downloader can also inject files from URLs with SSRF filtering. Production behavior is backed by a large RSpec suite and Cucumber features. It supports single and multiple uploads, metadata columns, direct-to-cloud uploads, cache cleanup, and ActiveRecord callbacks including after_commit deletion and rollback handling. External dependencies are limited to ActiveSupport/ActiveModel, Marcel for MIME detection, ssrf_filter for download safety, and optional Fog/image processor gems. This is not a standalone application or service; it is embedded into host applications as a library dependency. Maintenance is active, with ongoing 4.0.0.rc development and a Rails version matrix. Technical drift is moderate: the codebase still supports Ruby 2.7, contains a permissive RuboCop configuration, legacy scripts, and several deprecation layers, but the core abstractions are current and extensively tested.

RATING: 9.0/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
RubyMoney/money-rails ★ 1890 386 APPLICATION

money-rails is a Ruby gem that integrates the RubyMoney library with Rails, providing a `monetize` macro for ActiveRecord and Mongoid models. It allows developers to map integer cents columns (e.g., `price_cents`) to Money objects, handling currency conversions, validation, formatting, and serialization. The gem includes migration helpers, a custom ActiveModel validator, ActionView helpers, an ActiveJob serializer, test helpers, and configuration for global currency defaults and rounding modes. It supports multiple Rails versions (7.0–8.1), Mongoid 7–9, and Ruby >= 3.1. The codebase is well-structured, extensively tested, and follows Rails plugin conventions with clean separation of concerns.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 4 reusable components found
pat/gutentag ★ 497 36 APPLICATION

Gutentag is a Ruby gem that provides tagging functionality for ActiveRecord models in Rails applications. It implements a many-to-many relationship between models and tags through a join table, with automatic handling of tag creation, normalization (downcasing by default), and persistence. The architecture follows Rails engine patterns with clean separation of concerns: core functionality in lib/gutentag.rb, ActiveRecord integration in lib/gutentag/active_record.rb, persistence logic in lib/gutentag/persistence.rb, and querying capabilities in lib/gutentag/tagged_with/. Key features include flexible querying with :any/:all/:none matching, dirty state tracking for tag names, and automatic cleanup of unused tags. The gem supports both Rails and standalone ActiveRecord usage, with comprehensive test coverage across multiple Ruby and Rails versions.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 4 reusable components found
benpickles/parklife ★ 307 10 APPLICATION

Parklife is a Ruby library and CLI tool that converts Rack-based web applications (like Rails or Sinatra) into static HTML sites suitable for deployment on static hosting platforms (Netlify, Vercel, GitHub Pages, S3, etc.). It works by crawling the application's routes starting from defined entry points, making HTTP requests to each endpoint via Rack::Test, and saving the responses as appropriate files in a build directory. The library intelligently handles different HTTP response types through a responder pattern (200=OK, 304=NotModified, 404=NotFound, etc.), supports automatic link discovery and crawling from HTML responses, and provides flexible configuration for output formatting, caching via ETags, and 404 handling. Key features include route crawling with depth control, intelligent file naming logic (HTML vs other content types), and multiple reporter formats (progress dots, detailed logs, or silent).

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 1 reusable components found
scientist-labs/red-candle ★ 204 5 APPLICATION

Red-candle is a Ruby gem that provides bindings to the Hugging Face Candle library, enabling Ruby developers to run state-of-the-art language models directly in Ruby without Python or external APIs. The system supports LLMs (Mistral, Llama, Gemma, etc.), embedding models, rerankers, NER models, and vision-language models with hardware acceleration via Metal (Apple GPU) and CUDA (NVIDIA GPU). The architecture features a clean separation between Ruby interface layer and Rust extension. The Ruby layer provides idiomatic APIs (Candle::LLM, Candle::EmbeddingModel, etc.) while the Rust extension handles model loading, tensor operations, and hardware-specific computations using the Candle ML library. Key design patterns include unified model loading via `from_pretrained`, device abstraction for CPU/GPU selection, tokenizer access across all models, structured generation with JSON schema constraints, and a complete tool calling framework with agent capabilities. The project demonstrates strong engineering practices with comprehensive test coverage, extensive examples showing real-world usage (biomedical NER, chat interfaces, reranker benchmarks), and clear documentation. It successfully bridges the Ruby and Rust ecosystems while maintaining performance and usability, making advanced AI accessible to Ruby developers through a consistent, well-abstracted interface.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 3 reusable components found
beanstalkd/beaneater ★ 201 45 APPLICATION

Beaneater is a Ruby client library for the beanstalkd work queue. It provides a simple, thread-safe interface to interact with beanstalkd servers, enabling job enqueuing, reservation, and management through tubes (queues). The library handles connection management with automatic retry and reconnection logic, supports job lifecycle operations (delete, bury, release, etc.), and includes a processor registration system for automated job handling with retry and error recovery. Communication with beanstalkd occurs via the native TCP protocol, and the library translates responses into Ruby objects using optimized struct conversions. Key features include timeout configuration, tube watching/waiting, and statistics introspection.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 2 reusable components found
patterns-ai-core/langchainrb ★ 1993 264 APPLICATION

Langchain.rb is a Ruby gem for building LLM-powered applications with a unified interface to multiple LLM providers and vector databases. It provides a modular architecture supporting Retrieval Augmented Generation (RAG), AI agents with tool usage, document processing, and prompt templating. The gem includes a Rails engine for deep Rails integration and is actively maintained with frequent updates. The system enables developers to create interactive AI applications by combining LLMs, external tools, and vector search capabilities.

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 5 reusable components found
noraj/haiti ★ 1004 61 APPLICATION

HAITI (HAsh IdenTIfIer) is a Ruby library and CLI tool for identifying hash types from input strings. It matches against a comprehensive database of over 675 hash types (including modern algorithms like SHA3, Blake2, and VeraCrypt) using regex patterns. The library provides concise output with hashcat mode numbers, John the Ripper format names, and example hashes. Multiple CLI entry points exist: the main `haiti` command, `haiti-parsable` for script-friendly output, `haiti-fzf` for interactive selection, and `hashcat-haiti`/`john-haiti` for converting hashes into hashcat/JtR formats. The codebase is well-structured, with clean separation between the identification engine, data definitions, and CLI wrappers. It includes comprehensive documentation (man pages, YARD API docs, a docsify site) and is packaged for numerous Linux distributions and Homebrew. The identification logic is straightforward but effective: iterate over a JSON array of prototypes, apply each regex to the input, and return matching types. The data file (`prototypes.json`) is manually maintained and extended with each release.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 1 reusable components found
ankane/ruby-polars ★ 994 46 APPLICATION

This repository is a Ruby gem (polars-df) that provides a high-performance DataFrame library by binding to the Rust-based Polars engine. It serves as a native extension, allowing Ruby developers to perform ETL, data transformation, and analytics tasks with Rust-level speed while maintaining Ruby syntax. The architecture consists of a Rust core (ext/polars) handling computation and memory management, wrapped by Ruby modules (lib/polars) that expose a fluent DSL for data manipulation. It supports both eager (DataFrame/Series) and lazy (LazyFrame/Expr) evaluation modes, with extensive I/O capabilities for formats like CSV, Parquet, and Arrow, as well as cloud storage and database integration. The codebase demonstrates strong engineering practices, utilizing the `magnus` crate for safe Ruby-Rust FFI and implementing complex type conversion logic to bridge the two languages. It includes comprehensive test suites and CI pipelines for cross-platform compilation. However, the tight coupling to the upstream Polars Rust library introduces maintenance overhead, as breaking changes in the Rust core require synchronous updates to the Ruby bindings. Several features, particularly around cloud catalogs (Iceberg, Delta) and advanced selectors, are marked as experimental or contain incomplete implementations (Todo blocks), indicating an active but evolving codebase. For AI agents and engineers, this library is the primary tool for data engineering within the Ruby ecosystem where performance is critical. It is suitable for building data pipelines, analytics services, or backend systems that require efficient data processing without leaving the Ruby environment. The presence of `unstable` markers and `Todo` blocks suggests that while the core functionality is robust, some advanced features should be used with caution in production environments.

RATING: 8.7/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
premailer/css_parser ★ 299 115 APPLICATION

This repository is a Ruby gem for parsing CSS that implements CSS specification compliance including selector specificity calculation, property parsing, shorthand expansion/creation, and CSS cascade merging. It handles CSS imports, media queries, and URL resolution with built-in SSRF protection. The library processes CSS input (files, URIs, strings) into RuleSet objects that can be queried, manipulated, and merged according to W3C CSS standards. Key features include robust parsing of complex CSS, handling of edge cases in shorthand properties, and security measures against remote file inclusion attacks.

RATING: 8.6/10 MAINT: active DRIFT: low
▸ 3 reusable components found
lolcommits/lolcommits ★ 4819 247 APPLICATION

lolcommits is a Ruby gem that captures a webcam snapshot (or video) every time you git commit, creating a 'lolcat' style image with the commit message overlaid. It installs a post-commit hook in Git (or Mercurial) repositories, runs a platform-specific capturer (macOS, Linux, Windows, Cygwin), optionally creates animated GIFs or videos via ffmpeg, and stores results in `~/.lolcommits/<repo-name>/`. The CLI provides commands for enabling/disabling hooks, viewing last capture, browsing captures, generating timelapse GIFs, and configuring plugins (e.g., the default loltext plugin for text overlay). The architecture is a monolith with a plugin system, using MiniMagick for image processing and Launchy for file opening. It is well-maintained, with recent updates for Ruby 3.x compatibility and modern gem dependencies.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 4 reusable components found
$ loading more...
$ submit: