{"id":21572004,"url":"https://github.com/krzyzak/nazar","last_synced_at":"2025-07-16T18:32:03.092Z","repository":{"id":46809859,"uuid":"407532067","full_name":"krzyzak/nazar","owner":"krzyzak","description":"Nazar improves default output for console applications (supports IRB and Pry).","archived":false,"fork":false,"pushed_at":"2022-10-12T07:34:23.000Z","size":82,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T19:42:34.520Z","etag":null,"topics":["console","introspection","irb","pry","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krzyzak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-17T12:27:16.000Z","updated_at":"2023-09-20T07:49:49.000Z","dependencies_parsed_at":"2022-08-21T00:20:26.348Z","dependency_job_id":null,"html_url":"https://github.com/krzyzak/nazar","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzak%2Fnazar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzak%2Fnazar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzak%2Fnazar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzak%2Fnazar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krzyzak","download_url":"https://codeload.github.com/krzyzak/nazar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226154649,"owners_count":17582001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["console","introspection","irb","pry","rails","ruby"],"created_at":"2024-11-24T11:17:55.803Z","updated_at":"2024-11-24T11:17:56.414Z","avatar_url":"https://github.com/krzyzak.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nazar [![Build Status](https://github.com/krzyzak/nazar/actions/workflows/main.yml/badge.svg)](https://github.com/krzyzak/nazar/actions) [![Gem Version](https://badge.fury.io/rb/nazar.svg)](https://badge.fury.io/rb/nazar) [![Code Climate](https://codeclimate.com/github/krzyzak/nazar/badges/gpa.svg)](https://codeclimate.com/github/krzyzak/nazar) [![Test Coverage](https://api.codeclimate.com/v1/badges/f89b8bfdf557900e1f9f/test_coverage)](https://codeclimate.com/github/krzyzak/nazar/test_coverage)\n\nTurn this:\n```ruby\n\u003e\u003e User.all\n  User Load (0.4ms)  SELECT \"users\".* FROM \"users\" /* loading for inspect */ LIMIT ?  [[\"LIMIT\", 11]]\n=\u003e #\u003cActiveRecord::Relation [#\u003cUser id: 1, email: \"delma@goldner.co\", name: \"Mrs. Charis Brown\", description: \"Quasi atque ea. Beatae corporis quia. Eveniet veli...\", created_at: \"2021-09-01 05:42:24.341344000 +0000\", updated_at: \"2021-09-20 09:36:29.289078000 +0000\", active: false, last_login_at: nil\u003e, #\u003cUser id: 2, email: \"markpfeffer@wunschbraun.info\", name: \"Ms. Sherice Champlin\", description: \"Omnis ut illum. Non velit mollitia. Expedita facil...\", created_at: \"2021-09-10 07:27:00.182298000 +0000\", updated_at: \"2021-09-20 09:36:29.292065000 +0000\", active: true, last_login_at: \"2021-09-19 16:25:32.094418000 +0000\"\u003e, #\u003cUser id: 3, email: \"nathansimonis@kunde.org\", name: \"Florentino Gleason\", description: \"Non recusandae eos. Et voluptates iusto. Commodi e...\", created_at: \"2021-09-07 18:24:45.608164000 +0000\", updated_at: \"2021-09-20 09:36:29.293572000 +0000\", active: false, last_login_at: nil\u003e, #\u003cUser id: 4, email: \"edwardowilkinson@walkerschiller.info\", name: \"Judie Boehm\", description: \"Ut ea eum. Tempore voluptates praesentium. Animi s...\", created_at: \"2021-09-05 02:11:36.564693000 +0000\", updated_at: \"2021-09-20 09:36:29.295763000 +0000\", active: true, last_login_at: \"2021-09-19 20:17:24.074515000 +0000\"\u003e, #\u003cUser id: 5, email: \"isaiahebert@brauncarroll.net\", name: \"Mari Ullrich\", description: \"Aperiam quas voluptas. Autem alias quia. Aut persp...\", created_at: \"2021-09-09 05:23:03.229860000 +0000\", updated_at: \"2021-09-20 09:36:29.296928000 +0000\", active: nil, last_login_at: nil\u003e, #\u003cUser id: 6, email: \"alexander@anderson.io\", name: \"Sam Larson DDS\", description: \"Sed velit consectetur. Quas cupiditate enim. Neque...\", created_at: \"2021-09-03 02:52:14.055696000 +0000\", updated_at: \"2021-09-20 09:36:29.299157000 +0000\", active: true, last_login_at: \"2021-09-20 05:01:39.019563000 +0000\"\u003e, #\u003cUser id: 7, email: \"chirunolfon@keler.io\", name: \"Ying Kub I\", description: \"Cupiditate ut consequatur. Eos ab laboriosam. Ipsa...\", created_at: \"2021-09-10 05:52:32.005877000 +0000\", updated_at: \"2021-09-20 09:36:29.301469000 +0000\", active: true, last_login_at: \"2021-09-19 21:30:48.854010000 +0000\"\u003e, #\u003cUser id: 8, email: \"johnny@anderson.net\", name: \"Johnie Corwin II\", description: \"Suscipit itaque adipisci. Assumenda ad error. Quas...\", created_at: \"2021-09-12 13:05:49.845361000 +0000\", updated_at: \"2021-09-20 09:36:29.302657000 +0000\", active: nil, last_login_at: nil\u003e, #\u003cUser id: 9, email: \"yahairakuhn@schneider.com\", name: \"Sharie Weber\", description: \"Sapiente voluptatum mollitia. Dolores voluptatum a...\", created_at: \"2021-09-19 03:03:39.360526000 +0000\", updated_at: \"2021-09-20 09:36:29.304929000 +0000\", active: true, last_login_at: \"2021-09-20 06:46:05.846685000 +0000\"\u003e, #\u003cUser id: 10, email: \"tommye@schuppe.biz\", name: \"Yoshiko Mohr\", description: \"Similique laborum totam. Non cum atque. Placeat qu...\", created_at: \"2021-09-08 05:41:36.588541000 +0000\", updated_at: \"2021-09-20 09:36:29.306120000 +0000\", active: nil, last_login_at: nil\u003e, ...]\u003e\n```\nInto this:\n\n```ruby\n\u003e\u003e User.all\n   (0.6ms)  SELECT sqlite_version(*)\n  User Load (0.8ms)  SELECT \"users\".* FROM \"users\"\n┏━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ id    │ email                                │ name                  │ description                                                                             │ created_at              │ updated_at              │ active │ last_login_at           ┃\n┣═══════╪══════════════════════════════════════╪═══════════════════════╪═════════════════════════════════════════════════════════════════════════════════════════╪═════════════════════════╪═════════════════════════╪════════╪═════════════════════════┫\n┃ 1     │ delma@goldner.co                     │ Mrs. Charis Brown     │ Quasi atque ea. Beatae corporis quia. Eveniet velit ad.                                 │ 2021-09-01 05:42:24 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 2     │ markpfeffer@wunschbraun.info         │ Ms. Sherice Champlin  │ Omnis ut illum. Non velit mollitia. Expedita facilis dignissimos.                       │ 2021-09-10 07:27:00 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-19 16:25:32 UTC ┃\n┃ 3     │ nathansimonis@kunde.org              │ Florentino Gleason    │ Non recusandae eos. Et voluptates iusto. Commodi est in.                                │ 2021-09-07 18:24:45 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 4     │ edwardowilkinson@walkerschiller.info │ Judie Boehm           │ Ut ea eum. Tempore voluptates praesentium. Animi sapiente distinctio.                   │ 2021-09-05 02:11:36 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-19 20:17:24 UTC ┃\n┃ 5     │ isaiahebert@brauncarroll.net         │ Mari Ullrich          │ Aperiam quas voluptas. Autem alias quia. Aut perspiciatis eos.                          │ 2021-09-09 05:23:03 UTC │ 2021-09-20 09:36:29 UTC │ ∅      │ ∅                       ┃\n┃ 6     │ alexander@anderson.io                │ Sam Larson DDS        │ Sed velit consectetur. Quas cupiditate enim. Neque facere harum.                        │ 2021-09-03 02:52:14 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-20 05:01:39 UTC ┃\n┃ 7     │ chirunolfon@keler.io                 │ Ying Kub I            │ Cupiditate ut consequatur. Eos ab laboriosam. Ipsam ut veritatis.                       │ 2021-09-10 05:52:32 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-19 21:30:48 UTC ┃\n┃ 8     │ johnny@anderson.net                  │ Johnie Corwin II      │ Suscipit itaque adipisci. Assumenda ad error. Quas enim beatae.                         │ 2021-09-12 13:05:49 UTC │ 2021-09-20 09:36:29 UTC │ ∅      │ ∅                       ┃\n┃ 9     │ yahairakuhn@schneider.com            │ Sharie Weber          │ Sapiente voluptatum mollitia. Dolores voluptatum accusamus. Veniam voluptatem deserunt. │ 2021-09-19 03:03:39 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-20 06:46:05 UTC ┃\n┃ 10    │ tommye@schuppe.biz                   │ Yoshiko Mohr          │ Similique laborum totam. Non cum atque. Placeat quia velit.                             │ 2021-09-08 05:41:36 UTC │ 2021-09-20 09:36:29 UTC │ ∅      │ ∅                       ┃\n┃ 11    │ derekbeier@hermankuhlman.co          │ Lavern Feil           │ Itaque molestias et. Iure tempora minus. Dolore autem omnis.                            │ 2021-09-05 04:04:51 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 12    │ lavernwillms@runolfsdottirbogan.org  │ Marcy Gottlieb Sr.    │ Mollitia quia dolor. Libero laborum aperiam. Velit est eum.                             │ 2021-09-08 19:22:49 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 13    │ earlhills@mclaughlingreenholt.info   │ Adina Luettgen        │ In qui rem. Illum itaque dignissimos. Enim vitae tenetur.                               │ 2021-09-08 10:16:12 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 14    │ larry@rice.com                       │ Carolina Kuhlman II   │ Ipsum ut fuga. Sunt id a. Rerum nulla sint.                                             │ 2021-09-03 23:11:42 UTC │ 2021-09-20 09:36:29 UTC │ ∅      │ ∅                       ┃\n┃ 15    │ randy@kuhicfritsch.name              │ Harvey Runolfsdottir  │ Dolorum officiis sed. Ut recusandae culpa. Odit aut nostrum.                            │ 2021-09-08 04:28:38 UTC │ 2021-09-20 09:36:29 UTC │ ∅      │ ∅                       ┃\n┃ 16    │ lashaun@mooreleannon.co              │ Lucio Raynor          │ Et expedita rerum. Autem nesciunt labore. Suscipit aut eum.                             │ 2021-09-06 20:47:51 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 17    │ omeryost@becker.com                  │ Rocky Hettinger       │ Ut deleniti voluptas. Explicabo voluptas rerum. Illum sapiente quo.                     │ 2021-09-14 23:05:33 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-20 09:35:14 UTC ┃\n┃ 18    │ nilsa@corwinkub.name                 │ Serena Brakus         │ Qui non provident. Omnis excepturi quasi. Ratione suscipit dolor.                       │ 2021-09-14 01:06:02 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 19    │ berniebednar@spinkamiller.co         │ Merlin Predovic       │ Omnis et minus. Tempore in laboriosam. Molestiae aut eveniet.                           │ 2021-09-16 18:34:20 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-19 12:01:59 UTC ┃\n┃ 20    │ claude@smithamhaley.io               │ Claudette Thompson MD │ Aut consectetur soluta. Laborum quia qui. Vel incidunt minima.                          │ 2021-09-10 03:53:24 UTC │ 2021-09-20 09:36:29 UTC │ ∅      │ ∅                       ┃\n┃ 21    │ matilde@cormierstroman.name          │ Dalton Witting        │ Voluptatum provident earum. Ad esse odit. Quasi non ut.                                 │ 2021-09-10 04:51:53 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 22    │ randistrosin@littel.io               │ Miss Lucio Kub        │ Ea quia sapiente. Reprehenderit esse ut. Veritatis magnam quia.                         │ 2021-08-31 18:33:02 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 23    │ noah@kuphal.co                       │ Alonzo Stroman        │ Officia fugit eos. Qui quo et. Ducimus harum dignissimos.                               │ 2021-09-13 14:36:31 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 24    │ cristinaschneider@cole.biz           │ Dr. Newton Ritchie    │ Corporis suscipit recusandae. Voluptas voluptas quo. Non perferendis fugiat.            │ 2021-09-02 20:54:38 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-20 02:35:39 UTC ┃\n┃ 25    │ mirtha@spinkabayer.co                │ Kory Cummings         │ Aut ut aut. Quis voluptas sit. Consequatur quia voluptatibus.                           │ 2021-09-17 08:45:02 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┠───────┼──────────────────────────────────────┴───────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────┴─────────────────────────┴────────┴─────────────────────────┨\n┃ Total │ 25                                                                                                                                                                                                                                            ┃\n┗━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n```\n\n## Installation\n\n### Per-project installation\n\nWhile nothing stops you from adding Nazar to each project separately, I find it cumbersome to add it to every project I'm working on - it also alters REPL behaviour for other teammates, which is another reason why personally I don't recommend that approach. Anyway, here's quick how-to:\n\nAdd `nazar` to Gemfile:\n```ruby\ngroup :development, :test do\n  gem 'nazar', require: false\nend\n```\nThen, you have to call `Nazar.enable!`. If you're using Rails, you might want to add this snippet to `config/application.rb`:\n\n```ruby\nconsole do\n  require 'nazar'\n\n  Nazar.enable! # See configuration section for more options and\n                # Opt-in setup section if you don't want to enable it for every item\nend\n```\nOtherwise, call it in `bin/console` or any other script that launches your REPL.\n\n### Global installation\n\nThis is my recommended way to install this gem - that way it works automatically in all your projects, even in standalone `irb` or `pry` sessions.\n\n- **Create global gems path**\n\n  `mkdir -p ~/.gem/ruby/global` - You're welcome to use any other path for your global gemset\n- **Install nazar in your global gemset**\n\n  `gem install nazar -i ~/.gem/ruby/global`\n- **Load Nazar in your REPL rc file**\n  Add following snippet to your `.irbrc` or `.pryrc`:\n\n```ruby\nglobal_gemset_path = File.expand_path('~/.gem/ruby/global/gems')\n\nif Dir.exist?(global_gemset_path)\n  global_gems_path = Dir.glob(\"#{global_gemset_path}/*/lib\")\n\n  $LOAD_PATH.unshift(*global_gems_path)\nend\n\n%w[nazar].each do |gem| # add more gems you want to load globally\n  begin\n    require gem\n  rescue LoadError\n  end\nend\n\nNazar.enable! if defined?(Nazar)\n```\n\n## Layouts\n`Nazar.config.formatter.layout` can be set to either `:horizontal`, `:vertical` or `:auto`.\n\n`:auto` uses horizontal layout if it fits in your console size, otherwise it falls back to `:vertical` layout.\n\nHere's a preview of both layouts:\n\n#### Horizontal\n```ruby\n┏━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ id    │ email                                │ name                 │ description                                                           │ created_at              │ updated_at              │ active │ last_login_at           ┃\n┣═══════╪══════════════════════════════════════╪══════════════════════╪═══════════════════════════════════════════════════════════════════════╪═════════════════════════╪═════════════════════════╪════════╪═════════════════════════┫\n┃ 1     │ delma@goldner.co                     │ Mrs. Charis Brown    │ Quasi atque ea. Beatae corporis quia. Eveniet velit ad.               │ 2021-09-01 05:42:24 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 2     │ markpfeffer@wunschbraun.info         │ Ms. Sherice Champlin │ Omnis ut illum. Non velit mollitia. Expedita facilis dignissimos.     │ 2021-09-10 07:27:00 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-19 16:25:32 UTC ┃\n┃ 3     │ nathansimonis@kunde.org              │ Florentino Gleason   │ Non recusandae eos. Et voluptates iusto. Commodi est in.              │ 2021-09-07 18:24:45 UTC │ 2021-09-20 09:36:29 UTC │ ✗      │ ∅                       ┃\n┃ 4     │ edwardowilkinson@walkerschiller.info │ Judie Boehm          │ Ut ea eum. Tempore voluptates praesentium. Animi sapiente distinctio. │ 2021-09-05 02:11:36 UTC │ 2021-09-20 09:36:29 UTC │ ✓      │ 2021-09-19 20:17:24 UTC ┃\n┃ 5     │ isaiahebert@brauncarroll.net         │ Mari Ullrich         │ Aperiam quas voluptas. Autem alias quia. Aut perspiciatis eos.        │ 2021-09-09 05:23:03 UTC │ 2021-09-20 09:36:29 UTC │ ∅      │ ∅                       ┃\n┠───────┼──────────────────────────────────────┴──────────────────────┴───────────────────────────────────────────────────────────────────────┴─────────────────────────┴─────────────────────────┴────────┴─────────────────────────┨\n┃ Total │ 5                                                                                                                                                                                                                          ┃\n┗━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n```\n\n### Vertical\n```ruby\nUser.first(5)\n\n┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ id            │ 1                                                                     ┃\n┃ email         │ delma@goldner.co                                                      ┃\n┃ name          │ Mrs. Charis Brown                                                     ┃\n┃ description   │ Quasi atque ea. Beatae corporis quia. Eveniet velit ad.               ┃\n┃ created_at    │ 2021-09-01 05:42:24 UTC                                               ┃\n┃ updated_at    │ 2021-09-20 09:36:29 UTC                                               ┃\n┃ active        │ ✗                                                                     ┃\n┃ last_login_at │ ∅                                                                     ┃\n┠───────────────┼───────────────────────────────────────────────────────────────────────┨\n┃ id            │ 2                                                                     ┃\n┃ email         │ markpfeffer@wunschbraun.info                                          ┃\n┃ name          │ Ms. Sherice Champlin                                                  ┃\n┃ description   │ Omnis ut illum. Non velit mollitia. Expedita facilis dignissimos.     ┃\n┃ created_at    │ 2021-09-10 07:27:00 UTC                                               ┃\n┃ updated_at    │ 2021-09-20 09:36:29 UTC                                               ┃\n┃ active        │ ✓                                                                     ┃\n┃ last_login_at │ 2021-09-19 16:25:32 UTC                                               ┃\n┠───────────────┼───────────────────────────────────────────────────────────────────────┨\n┃ id            │ 3                                                                     ┃\n┃ email         │ nathansimonis@kunde.org                                               ┃\n┃ name          │ Florentino Gleason                                                    ┃\n┃ description   │ Non recusandae eos. Et voluptates iusto. Commodi est in.              ┃\n┃ created_at    │ 2021-09-07 18:24:45 UTC                                               ┃\n┃ updated_at    │ 2021-09-20 09:36:29 UTC                                               ┃\n┃ active        │ ✗                                                                     ┃\n┃ last_login_at │ ∅                                                                     ┃\n┠───────────────┼───────────────────────────────────────────────────────────────────────┨\n┃ id            │ 4                                                                     ┃\n┃ email         │ edwardowilkinson@walkerschiller.info                                  ┃\n┃ name          │ Judie Boehm                                                           ┃\n┃ description   │ Ut ea eum. Tempore voluptates praesentium. Animi sapiente distinctio. ┃\n┃ created_at    │ 2021-09-05 02:11:36 UTC                                               ┃\n┃ updated_at    │ 2021-09-20 09:36:29 UTC                                               ┃\n┃ active        │ ✓                                                                     ┃\n┃ last_login_at │ 2021-09-19 20:17:24 UTC                                               ┃\n┠───────────────┼───────────────────────────────────────────────────────────────────────┨\n┃ id            │ 5                                                                     ┃\n┃ email         │ isaiahebert@brauncarroll.net                                          ┃\n┃ name          │ Mari Ullrich                                                          ┃\n┃ description   │ Aperiam quas voluptas. Autem alias quia. Aut perspiciatis eos.        ┃\n┃ created_at    │ 2021-09-09 05:23:03 UTC                                               ┃\n┃ updated_at    │ 2021-09-20 09:36:29 UTC                                               ┃\n┃ active        │ ∅                                                                     ┃\n┃ last_login_at │ ∅                                                                     ┃\n┠───────────────┼───────────────────────────────────────────────────────────────────────┨\n┃ Total         │ 5                                                                     ┃\n┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n```\n\n## Shorthand method\n\nNazar defines top level `__(data, **options)` method, that can be useful for two things:\n\n### Inspecting (array of) Hashes/Structs\n\nNazar by design won't enhance output for any collection that does not consist of supported (eg. ActiveRecord/Sequel) items. If you have a data that is structurally compatible (ie: all items consists of the same keys), and want to enahance the output, you can simply use `#__` method:\n\n```ruby\n__([{foo: :bar, test: 123},{foo: :baz, test: 456}])\n┏━━━━━━━┯━━━━━━┓\n┃ foo   │ test ┃\n┣═══════╪══════┫\n┃ :bar  │ 123  ┃\n┃ :baz  │ 456  ┃\n┠───────┼──────┨\n┃ Total │ 2    ┃\n┗━━━━━━━┷━━━━━━┛\n```\n\nIt works with Structs and Hashes (or, more specifically - with any object that reponds to `#keys` and `#values`)\n\nYou can also enforce layout and/or pagination:\n\n```ruby\n__([{foo: :bar, test: 123},{foo: :baz, test: 456}], layout: :vertical)\n┏━━━━━━━┯━━━━━━┓\n┃ foo   │ :bar ┃\n┃ test  │ 123  ┃\n┠───────┼──────┨\n┃ foo   │ :baz ┃\n┃ test  │ 456  ┃\n┠───────┼──────┨\n┃ Total │ 2    ┃\n┗━━━━━━━┷━━━━━━┛\n```\n\n### Opt-in setup\n\nIf you use `Nazar.load!` instead of `Nazar.enable!`, it would not enhance output for every element in the console. Instead, you have to call `#__` for each item that you want to enhance output\n\n```ruby\n\nNazar.load!\nUser.all # Returns default output\n__ User.all # Returns output enhanced by Nazar\n```\n\n## Configuration\n\nBy default, Nazar improves output for ActiveRecord (both collections and a single item) and for CSV Tables. You can configure that by calling `#enable!` with optional argument:\n\n`Nazar.enable!(extensions: [:active_record, :csv, :sequel])` will enhance output for \u003ca href=\"https://github.com/jeremyevans/sequel/\"\u003eSequel\u003c/a\u003e as well.\n\nYou can also configure behaviour of Nazar:\n\n| Config | Default | Description |\n| ------ | ------- | ----------- |\n| `Nazar.config.colors.enabled` | true | Determines whether the output should be colorised or not |\n| `Nazar.config.formatter.nil` | `∅` | Sets character printed if the value was nil |\n| `Nazar.config.formatter.layout` | `:auto` | Determines which layout should be used. See \u003ca href=\"#layouts\"\u003eLayouts\u003c/a\u003e for more details |\n| `Nazar.config.formatter.paginate` | `true` | Determines if results too long/wide should be printed directly, or paginated with `less`. Horizontal layout is always paginated.\n| `Nazar.config.formatter.boolean` | ['✓', '✗'] | First item in array is a character for `true`, second for `false` |\n| `Nazar.config.enable_shorthand_method` | true | Determines if shorthand method should be defined. See \u003ca href=\"#opt-in-setup\"\u003eOpt-in setup\u003c/a\u003e for more details |\n| `Nazar.config.table.resize`  | `true` | Determines if the table should always be resized to take full width |\n| `Nazar.config.table.min_width`  | `nil` | Sets minimum width. By default uses the longest header length |\n| `Nazar.config.table.max_width`  | `nil` | Determines maximum table width. If `resize` is set to true, uses terminal width by default, otherwise uses content length |\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/krzyzak/nazar.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzyzak%2Fnazar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrzyzak%2Fnazar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzyzak%2Fnazar/lists"}