A mini view framework for console/irb that's easy to use, even while under its influence. Console goodies include a no-wrap table, auto-pager, tree and menu.
Questions tagged [hirb]
15 questions
5
votes
1 answer
Hirb - "Too many fields.." only when loading from irbrc (not directly in console)
I'm trying to get Hirb setup in my console.
When i type:
require 'hirb'
Hirb.enable
My (rather large) table prints fine (with column names shortened). However, I want to automatically load this (and other gems) whenever i load up rails c, so i…

rwb
- 4,309
- 8
- 36
- 59
3
votes
1 answer
why irb plugins not loaded in rails console session?
I have installed both awsome print & hirb irb plugins to Ruby 1.9.2 through rvm. I can able to access it from irb session. But when i tried from rails console, i got the error
ruby-1.9.2-p180 :001 > require "hirb"
LoadError: no such file to load --…

RameshVel
- 64,778
- 30
- 169
- 213
2
votes
1 answer
Using hirb in rake task
I would like to get nice printing by hirb in rake task. But I can't figure out how to setup hirb to print the ActiveRecord results.
task :t2 => :environment do
require 'hirb'
Hirb.enable
result = Task.select('project_id, COUNT(*) AS…

megas
- 21,401
- 12
- 79
- 130
1
vote
1 answer
Can I ignore certain fields that are too long in Hirb?
I am using Hirb in my Rails console to try to display mongoid records in a nicer looking table, but the _id, created_at, and updated_at fields take too much space and, even though I really have one meaning field, name, when I do a Project.first it…

Nik So
- 16,683
- 21
- 74
- 108
1
vote
0 answers
How can I specify fields to ignore in Hirb output
This question is helpful but not quite what I need.
I would like to provide a list of fields to ignore in a Hirb yaml configuration file. A blacklist, as opposed to a whitelist. This way, as my model changes from migrations, I wont have to keep…

AndrewH
- 3,418
- 2
- 15
- 27
1
vote
0 answers
Hirb not displaying correctly In Rails 4
I installed Hirb, and wanted the nice table view that comes with it.
I have checked the version of pry, and Rails, and Hirb, and they should be working. I've tried to reinstall the gems as well. I get no pretty view after running Hirb.enable:
➜ …

R.J. Robinson
- 2,180
- 3
- 21
- 33
1
vote
1 answer
Rails Hirb in console for outputting long data breaks console
I'm using Rails 4.2 with Hirb in console.
and when I try to output long/big data in console. the console breaks.
it shows (END) and I can't type or run other commands anymore, and what I must do in order to fix is to close the console.
Is there any…

Yoshi
- 449
- 4
- 9
1
vote
1 answer
Extend IRB main methods
I have a directory structure in my app. For development purposes (and possibly beyond), I currently have a class X which has class methods pwd, cd, and ls. Is there a way to make these methods available when I enter irb whithin my app, for…

nufftenthousand
- 85
- 6
1
vote
0 answers
Configure Hirb to show relations?
I have two models:
class EventType < ActiveRecord::Base
belongs_to :event_class
end
class EventClass < ActiveRecord::Base
has_many :event_types
end
The schemas look like this:
create_table "event_classes", force: true do |t|
t.string …

tobinjim
- 1,862
- 2
- 19
- 31
1
vote
3 answers
Hirb doesn't work at all in rails console
I followed the tutorial on hirb rdoc but unfortunately, my rails console is not working at all.
I've already done sudo gem install hirb
and added hirb to my Gemfile:
gem 'hirb', '~>0.7.0'
Then I launched bundle install
And I get this result :
rails…

jramby
- 426
- 5
- 14
0
votes
1 answer
Can't name fields using hirb in Ruby
I know my question is pretty simple, but I can't manage to find an answer on the internet.
I have a hash called sorted_frequency. I want to output it as a table using the gem hirb. At the time I just have been able to print the hash under the…

H4ml3tt3d
- 21
- 3
0
votes
0 answers
Hirb doesn't work in console
I have hirb in my Gemfile, bundle installed it, edited irbrc file according to the document I found online, even tried installing it from the console, but it still doesn't work. I also did gem list and know for a fact that gem 'hirb' is in there.…

kimmo
- 19
- 6
0
votes
1 answer
Output Hirb to CSV
Hirb gives you some nice outputs in the console, like:
+------------+--------+-----------+-------+--------------------------+
| to_s | ld | ajd | amjd | asctime …

Abram
- 39,950
- 26
- 134
- 184
0
votes
1 answer
Why does hirb.yml ignore User?
I have a config/hirb.yml which looks a bit like this
:output:
BlogEntry:
:options:
:fields:
- id
- title
- url
User:
:options:
:fields:
- id
- first_name
- last_name
In the…

Magne
- 16,401
- 10
- 68
- 88
0
votes
2 answers
Enable hirb print for array
In hirb tutorial there's an example for array:
[[1,2], [2,3]]
prints as
+---+---+
| 0 | 1 |
+---+---+
| 1 | 2 |
| 2 | 3 |
+---+---+
But I can't make it work after usual setting up:
require 'hirb'
=>true
>> Hirb.enable
=>nil
The arrays are still…

megas
- 21,401
- 12
- 79
- 130