Useful when you want to highlight the syntax. It seems that it is connected to Python's pygments with FFI. You can be crazy.
Put your own handy tools. Detailed in this article. When you put it in homebrew, various executable files such as ʻeasy_install are placed in the mysterious directory (
/ usr / local / share / python), so put a symbolic link etc. or mess with
$ PATH` ..
setup
pip install pygments
ln -s /usr/local/share/python/pygmentize /usr/local/bin/pygmentize
kaiseki.rb
require 'pygments'
Pygments.start '/usr/local/bin/pygmentize'
code = File.read '/Users/udzura/.rvm/gems/ruby-1.9.3-p194@samples/gems/sinatra-1.3.3/lib/sinatra/base.rb'
puts Pygments.highlight code, lexer: 'ruby', formatter: 'terminal'
The ruby gem called pry-coolline seems to implement a parser by myself [Yabaso](https://github.com/pry/pry-coolline/blob/master/lib/pry-coolline/paren_match .rb).
In When coloring code blocks with Ruby, I said "sometimes it becomes a segmentation fault", but I get the impression that it falls so much. I didn't receive it. The version may be up and stable. I don't know how much "if you prepare the python environment properly" is like ...