Kaminari

From HandWiki
Revision as of 11:33, 24 October 2022 by Sherlock (talk | contribs) (url)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Kaminari
DeveloperAkira Matsuda, Yuki Nishijima, Zachary Scott, Hiroshi Shibata
First appearedFeb 6, 2011
OSCross-platform
LicenseMIT license
Websiteon GitHub

Kaminari (雷) is a paginating tool written in Ruby. gem compatible with Rails versions 3.0 thunder. It was developed by Akira Matsuda[1] along with Yuki Nishijima,[2] Zachary Scott,[3] Hiroshi Shibata[4] in 2011.[5][6]

History

(kaminari, kannari, ikazuchi, narukami, rai): thunder.

The first commit to the Git repository was made by Akira Matsuda on February 5, 2011 with the comment "Initial commit to kaminari."[7] On February 6, 2011 he released the first version 0.1.0, with the commit comment "Version bump to 0.1.0".[8] The latest stable release is 1.2.1 available from May 28, 2020.[9]

Features

[10]

User-friendly

Just by bundling the gem, the models of the project can be paginated without the need for any configuration. The page function just needs to be called inside the controller.

Clean

Kaminari doesn't pollute the global namespace while using Array, Hash, Object or ActiveRecord::Base.

Simple scope based

Kaminari can be used with just an instance of the class ActiveRecord::Relation without the use of any special class, module or anything for the paginated values. It also supports method chaining and chaining can be done before or after the pagination scope. An exception to this behavior is that the per method needs to be called after the page method as the page method creates its scope.[11]

Wide support

Kaminari has active support for various ORMs like Active Record, Mongoid.[12] It also supports web-frameworks like Rails, Sinatra, Grape and template engines like eRuby, Haml, Slim.[13]

HTML5 integration

Kaminari is actively updated and as such it has support for HTML5. It outputs the HTML <nav> tag by default.

Supported software/languages

[14]

  • Ruby 2.0.0, 2.1.x, 2.2.x, 2.3.x, 2.4.x, 2.5.x, 2.6.x, 2.7.x, 2.8
  • Rails 4.1, 4.2, 5.0, 5.1, 5.2, 6.0, 6.1
  • Sinatra 1.4, 2.0
  • Haml 3+
  • Mongoid 3+
  • MongoMapper 0.9+
  • DataMapper 1.1.0+

References

  1. "amatsuda (Akira Matsuda)". GitHub. https://github.com/amatsuda. 
  2. "yuki24 (Yuki Nishijima)". GitHub. https://github.com/yuki24. 
  3. "zzak (Zachary Scott)". GitHub. https://github.com/zzak. 
  4. "hsbt (SHIBATA Hiroshi)". GitHub. https://github.com/hsbt. 
  5. "All versions of kaminari | RubyGems.org | your community gem host". http://rubygems.org/gems/kaminari/versions. Retrieved 2015-09-15. 
  6. "kaminari | RubyGems.org | your community gem host". http://rubygems.org/gems/kaminari/versions/0.16.3. Retrieved 2015-09-15. 
  7. "Initial commit to kaminari. · amatsuda/kaminari@4db3397". https://github.com/amatsuda/kaminari/commit/4db3397b4d962076bca6dd047ed15627e1f9f67d. Retrieved 2015-09-15. 
  8. "Version bump to 0.1.0 · amatsuda/kaminari@e1bd7b7". https://github.com/amatsuda/kaminari/commit/e1bd7b79855ff38abb8d27dc8d36532a468aeeb2. Retrieved 2015-09-15. 
  9. "Release v1.2.1 · kaminari/kaminari". https://github.com/kaminari/kaminari/releases/tag/v1.2.1. Retrieved 2021-03-11. 
  10. "kaminari/README.rdoc". Archived from the original on 2014-08-27. https://web.archive.org/web/20140827160720/https://github.com/amatsuda/kaminari/blob/master/README.rdoc. Retrieved 2015-09-15. 
  11. "ASCIIcasts - "Episode 254 - Pagination with Kaminari"". Archived from the original on 2015-09-26. https://web.archive.org/web/20150926053423/http://asciicasts.com/episodes/254-pagination-with-kaminari. Retrieved 2015-09-16. 
  12. "Mongoid". GitHub. https://github.com/mongoid. 
  13. "Slim Template Language". GitHub. https://github.com/slim-template. 
  14. "kaminari/README.md". https://github.com/kaminari/kaminari/blob/v1.2.1/README.md. Retrieved 2021-03-11. 

External links