Class: XCPretty::Pygments
- Inherits:
-
Object
- Object
- XCPretty::Pygments
- Defined in:
- lib/xcpretty/syntax.rb
Class Method Summary collapse
Class Method Details
.available? ⇒ Boolean
39 40 41 42 |
# File 'lib/xcpretty/syntax.rb', line 39 def self.available? @available = system('which pygmentize > /dev/null') if @available.nil? @available end |
.pygmentize(code, language, options) ⇒ Object
35 36 37 |
# File 'lib/xcpretty/syntax.rb', line 35 def self.pygmentize(code, language, ) `echo '#{code}' | pygmentize -f 256 -l #{language} #{ if }` end |