cldwalker / hirb

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.
http://tagaholic.me/hirb/
MIT License
1.65k stars 72 forks source link

choose style of table with one option instead of one for each table format #61

Closed maxmeyer closed 11 years ago

maxmeyer commented 12 years ago

There are a lot of great different table formats available for hirb now: "normal", "markdown", "vertical", "tab" and "unicode"

For each format a separate symbol in the option hash exists, but you can display data only in one format at any time. Why not replace all separate options with one :style option, which can be extended if a new table format becomes available; with no need to clutter the option hash with new symbols for the :next_fancy_table_format.

Please be aware that the patch for moca + test/unit was included by accident.

Cheers, MaxMeyer

maxmeyer commented 12 years ago

I deleted the line require 'test/unit'

maxmeyer commented 12 years ago

Interested?

cldwalker commented 12 years ago

Sorry for the delayed response. While adding a :style option is consistent with my other table project, I don't see the use case you're addressing here. Are you needing to dynamically determine style somewhere when using hirb? Also, since hirb is an old but heavily used project I don't see the reason to burden users with deprecation.

maxmeyer commented 12 years ago

Are you needing to dynamically determine style somewhere when using hirb?

No, but I would like to use hirb in one of my projects which needs a new table format which doesn't exists today (and I'm willing to build myself and send as a pull request).

I thought it would be not a good idea to ask you to add a new option for that table format. Instead I thought it might be a good idea to clean up the api. The next thing one could think of would be to extract those templates into a separate gem holding only templates.

cldwalker commented 12 years ago

I'm not wanting to deprecate the other options. I can pull this in if you remove the deprecation warnings.

maxmeyer commented 12 years ago

done. ok?

maxmeyer commented 12 years ago

Did I forget anything to remove?

cldwalker commented 11 years ago

Finally got around to this. Thanks!