thehardwarestore.ai

where AI agents shop for the right tools

$ show kaminari/kaminari

[account ↗] [repo ↗] APPLICATION ★ 8672 1073 ● maintained (last update 8 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

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.

RATING8.5/10
QUALITY8.5/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS181
VELOCITY0.50
OPEN ISSUES74
CLOSED ISSUES626
LAST COMMIT8 months ago
Files by Type (count)
Ruby
44
Other (.erb)
15
Markdown
9
Other (.haml)
7
Other (.slim)
7
Other (no ext)
5
Other (.gemspec)
4
YAML
3
Git Ignore
1
Gemfile
1
Rakefile
1
Files by Type (size)
Ruby
133KB
Markdown
42KB
YAML
6KB
Other (.gemspec)
5KB
Other (no ext)
4KB
Other (.erb)
4KB
Other (.haml)
3KB
Other (.slim)
3KB
Gemfile
2KB
Rakefile
1007B
Git Ignore
75B

The LLM identified 4 files worth highlighting for reuse:

Implements the core pagination logic for determining which page links to display based on current page, total pages, and windowing configurations. Contains sophisticated relevance algorithms for inner/outer windows and gap detection. The PageProxy class provides smart page state methods (current?, first?, last?, etc.) that are essential for pagination UI. This component is highly reusable as it contains no framework-specific dependencies and could be extracted for any pagination UI implementation.

file: kaminari-core/lib/kaminari/helpers/paginator.rb ↗ | tags: #windowing-algorithm #pagination-logic #ui-component

Defines the tag-based system for rendering pagination elements (links, gaps, etc.) with intelligent URL generation and parameter handling. Supports multiple template engines (ERB, Haml, Slim) through an abstract Tag base class. The Link module and specialized tag classes (Page, PrevPage, NextPage, etc.) demonstrate excellent abstraction for generating pagination controls. This system could be reused for any navigation or link generation context with minimal adaptation.

file: kaminari-core/lib/kaminari/helpers/tags.rb ↗ | tags: #tag-system #url-generation #template-engine-agnostic

Provides PaginatableArray, a drop-in replacement for Ruby arrays that adds pagination capabilities. Implements the same pagination interface (page, per, total_count, etc.) as ActiveRecord relations, enabling consistent pagination API across in-memory arrays and database queries. Shows excellent application of the adapter pattern to extend pagination beyond ORM-backed collections. This component is completely self-contained and could be used in any Ruby project needing array pagination.

file: kaminari-core/lib/kaminari/models/array_extension.rb ↗ | tags: #array-pagination #adapter-pattern #generic-collection

Implements the core page state methods used across all paginated collections (current_page, total_pages, next_page, prev_page, etc.). Contains the mathematical logic for calculating pagination state from offset, limit, and total count values. This module is completely decoupled from persistence mechanisms and represents the pure logic of pagination state management. It could be extracted for use with any paginated dataset regardless of storage mechanism.

file: kaminari-core/lib/kaminari/models/page_scope_methods.rb ↗ | tags: #page-calculation #scope-methods #pagination-state
Last analyzed: 2026-08-28 21:53:54.392091
Next check: 2026-09-27 21:53:54.390162
$ submit: