Ruby Gems Library

Browse our comprehensive collection of 45 documented Ruby gems with detailed version histories, statistics, and upgrade guidance.

playwright-ruby-client

playwright-ruby-client provides Ruby bindings to Microsoft's Playwright browser automation framework, enabling reliable end-to-end testing across Chromium, Firefox, and WebKit browsers. Playwright offers a modern alternative to Selenium with built-in waiting mechanisms, auto-wait for elements, and reliable event handling that reduces flaky tests. The gem wraps Playwright's Node.js implementation, bringing its capabilities to Ruby testing environments. The library provides high-level APIs for browser control, page navigation, element interaction, and screenshot/PDF generation with automatic waiting for elements to be ready before acting on them. It supports multiple browser contexts for parallel test execution, mobile device emulation, network interception for mocking APIs, and geolocation/permissions control. playwright-ruby-client handles authentication state persistence, iframe handling, file uploads/downloads, and WebSocket communication. The gem includes built-in retry logic and sophisticated selectors supporting text, CSS, XPath, and accessibility tree queries. playwright-ruby-client is ideal for comprehensive browser testing, visual regression testing, web scraping requiring JavaScript execution, and automated testing of single-page applications. It excels in scenarios requiring cross-browser testing, mobile device testing, or testing of complex JavaScript-heavy applications where simpler tools struggle. The gem's reliability improvements over Selenium make it particularly valuable for continuous integration pipelines where test stability matters. Its support for modern web features and comprehensive automation capabilities make it suitable for both testing and browser automation tasks.

poppler

poppler provides Ruby bindings to the Poppler PDF rendering library, enabling PDF document parsing, rendering, and manipulation. Poppler, derived from Xpdf, is a widely-used PDF engine that powers many PDF viewers on Linux and other platforms. The gem brings Poppler's comprehensive PDF capabilities to Ruby, allowing applications to extract text, render pages to images, and access PDF document structures programmatically. The library supports loading PDF documents and accessing their content including text extraction with position information, image extraction, metadata reading, and outline/bookmark navigation. It provides page rendering to various surfaces including Cairo contexts for high-quality rasterization, supports PDF form reading and filling, and handles encrypted PDFs with password protection. poppler exposes PDF annotations, embedded file extraction, and page-level operations like size and orientation detection. The gem integrates with the ruby-gnome ecosystem, particularly cairo-gobject for rendering, enabling PDF to image conversion and custom PDF viewers. poppler is valuable for Ruby applications requiring PDF processing beyond simple viewing, such as PDF text extraction tools, thumbnail generators, document management systems, and custom PDF viewers. It's used in search indexing systems extracting text from PDFs, document conversion pipelines rendering PDFs to images, and applications analyzing PDF structure or content. The gem provides comprehensive PDF access without external dependencies beyond Poppler itself, making it suitable for server-side PDF processing where rendering or text extraction is required.

rdkafka

rdkafka provides Ruby bindings to librdkafka, a high-performance C library for Apache Kafka clients. The gem offers both producer and consumer interfaces for working with Kafka message streams, handling the complexity of Kafka protocol operations, connection management, and message delivery guarantees. It brings librdkafka's production-grade reliability and performance characteristics to Ruby applications. The library supports Kafka's key features including partitioning, consumer groups, offset management, and exactly-once semantics. It provides asynchronous message production with delivery callbacks, configurable acknowledgment modes, and automatic retry logic. For consumers, rdkafka handles partition assignment, rebalancing, and offset commits with options for both manual and automatic control. The gem includes comprehensive configuration options for tuning performance, reliability, and resource usage, exposing librdkafka's extensive parameter set through Ruby-friendly interfaces. rdkafka is essential for Ruby applications integrating with Kafka-based data pipelines, event streaming platforms, and message-driven architectures. It's used in microservices for asynchronous communication, in data processing systems for consuming and producing Kafka streams, and in event sourcing architectures. The gem's librdkafka foundation provides production-ready reliability and performance, making it suitable for high-throughput scenarios where message delivery guarantees and low latency matter.

re2

re2 provides Ruby bindings to Google's RE2 regular expression library, which guarantees linear time execution regardless of input or pattern complexity. Unlike Ruby's default Onigmo engine, RE2 trades some features for predictable performance and protection against catastrophic backtracking. The gem offers a safer alternative for processing untrusted input or patterns where execution time guarantees are critical. The library implements a subset of the PCRE syntax, supporting most common regular expression features while excluding constructs that could cause exponential matching time. It provides a drop-in replacement interface similar to Ruby's Regexp class, with methods for matching, scanning, and substitution. RE2 uses a DFA-based matching algorithm that ensures O(n) time complexity regardless of pattern complexity, making it immune to ReDoS (Regular Expression Denial of Service) attacks that can affect traditional backtracking engines. re2 is essential for applications processing user-supplied regular expressions or matching patterns against untrusted input, particularly in web applications, log processors, and text analysis systems. It's commonly used in scenarios where regex execution time must be bounded, such as API input validation, rate-limited services, and systems processing high volumes of pattern matching. While it doesn't support all Perl-compatible features like backreferences, its performance guarantees make it the right choice when reliability and security matter more than feature completeness.

rsvg2

rsvg2 provides Ruby bindings to librsvg, the GNOME library for rendering SVG (Scalable Vector Graphics) images. librsvg handles parsing SVG files and rendering them to various output surfaces with support for most SVG 1.1 features. The gem enables Ruby applications to load, render, and manipulate SVG images, converting vector graphics to raster formats or displaying them in GTK applications. The library supports loading SVG from files or memory, rendering to Cairo surfaces at arbitrary resolutions without quality loss, and extracting SVG elements by ID for partial rendering. It handles SVG features including paths, gradients, filters, text, transformations, and embedded images, with support for CSS styling and animations. rsvg2 integrates with the ruby-gnome ecosystem, particularly cairo for rendering operations, allowing SVG rendering to images, PDFs, or screen display. The gem provides dimension queries, DPI control for output resolution, and handles SVG viewBox and aspect ratio preservation. rsvg2 is essential for Ruby applications rendering icons or illustrations from SVG sources, image conversion tools supporting SVG input, and GTK applications displaying vector graphics. It's used in web application backends converting SVG to raster formats, icon processing pipelines, diagram generators, and any system requiring high-quality scalable graphics rendering. The gem's ability to render SVG at any resolution makes it valuable for generating thumbnails, print-quality images, or responsive graphics from a single SVG source, common in modern web and desktop applications.