Forum: Ruby on Rails ANNOUNCE: Hirb - A gem enhancing your script/console

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
cldwalker (Guest)
on 2009-03-27 23:03
(Received via mailing list)
Hi,
  I'm announcing Hirb, a mini view framework which enables script/
console to provide custom views.
Out of the box your activerecord objects come back as ascii tables.
You can also configure your tree-based models to return as ascii
trees:
  Numeric
  |-- Float
  |-- Integer
  |   |-- Bignum
  |   `-- Fixnum
  |-- Date::Infinity
  `-- Rational

I've written two tutorials on it:
http://tagaholic.me/2009/03/13/hirb-irb-on-the-goo...
and
http://tagaholic.me/2009/03/18/ruby-class-trees-ra...
It's also got some decent documentation: http://tagaholic.me/hirb/doc/

To try it out: gem install cldwalker-hirb --source
http://gems.github.com

Enjoy!
Gabriel
Danimal (Guest)
on 2009-03-31 20:09
(Received via mailing list)
Gabriel,

This looks pretty cool! Quick question: is there a way to set this up
to be used automatically from script/console and/or irb?

Thanks,

-Danimal
Philip H. (Guest)
on 2009-03-31 20:47
(Received via mailing list)
> This looks pretty cool! Quick question: is there a way to set this up
> to be used automatically from script/console and/or irb?

Should be able to just put the following into your ~/.irbrc

require 'hirb'
Hirb::View.enable
cldwalker (Guest)
on 2009-04-04 00:27
(Received via mailing list)
Thanks Phillip. Danimal, if you're using Hirb just for Rails, you can
add it in config/environment.rb and only have
it load when using script/console:
if $0 == 'irb'
  require 'hirb'
  Hirb::View.enable
end

Also, if you're using Wirble make sure to put Hirb::View.enable after
loading Wirble.

Gabriel
This topic is locked and can not be replied to.