ruby on rails - colorful format for titles in documentation RI -
i reading book de ruby of pickaxe (ruby version 2.0) , can not execute statement
$ export ri="--format ansi --width 70"
i using native console of ubuntu 12.04 , have ruby within of rvm
part of book topic explained
for general help on using ri, type ri --help. in particular, might want experiment --format option, tells ri how render decorated text (such section headings). if terminal programme supports ansi escape sequences, using --format=ansi generate nice, colorful display. 1 time find set of options like, can set them ri environment variable. using our shell (zsh), done using following: $ export ri="--format ansi --width 70" my console. looks bad esc= ???
trabajo@fernando:~$ export ri="--format ansi --width 70" trabajo@fernando:~$ ri assoc esc[0mesc[1;32m.assocesc[m (from ruby core) esc[32mimplementation arrayesc[m ------------------------------------------------------------------------------ ary.assoc(obj) -> new_ary or nil
assuming term environment variable set correctly (either xterm-color or xterm-256color should suffice) problem pager used ri
from ri user manual:
to utilize ansi, either disable pager or tell pager allow command characters.
so have 2 options, really:
disable pager:
ri -t -f ansi assoc
use ansi-enabled pager, instance less -r:
pager="less -r" ri -f ansi assoc
you can either build -t alternative ri environment variable, or else export pager environment variable in add-on ri one.
ruby-on-rails ruby linux rvm
No comments:
Post a Comment