From c1ebf108afc39cc9858c2ddf818bd95ca327bb69 Mon Sep 17 00:00:00 2001 From: Jonathan Rudenberg Date: Wed, 22 Aug 2012 18:49:29 -0400 Subject: [PATCH] Revert "Switch to albino for now, pygments.rb is segfaulting on heroku" This reverts commit 3dcb9cd05dfeba462d66ccf1986e08b0f36f9456. --- Gemfile | 2 +- Gemfile.lock | 18 ++++++++++++++---- lib/markdown_html.rb | 6 ++++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 0c2ba3d..bfd587c 100644 --- a/Gemfile +++ b/Gemfile @@ -13,5 +13,5 @@ gem 'mime-types' gem 'rack' gem 'puma' gem 'rack-rewrite' -gem 'albino' +gem 'pygments.rb', :git => 'git://github.com/akzhan/pygments.rb.git', :branch => 'rubypython-0.6' gem 'clogger' diff --git a/Gemfile.lock b/Gemfile.lock index ff159e3..2a9b9ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,29 +1,39 @@ +GIT + remote: git://github.com/akzhan/pygments.rb.git + revision: dfa0d936da40f25e249a7d20f895e6d4cab72b50 + branch: rubypython-0.6 + specs: + pygments.rb (0.2.12) + rubypython (~> 0.6.1) + GEM remote: http://rubygems.org/ specs: adsf (1.1.1) rack (>= 1.0.0) - albino (1.3.3) - posix-spawn (>= 0.3.6) + blankslate (2.1.2.4) builder (3.0.0) clogger (1.1.0) rack (> 0.9) colored (1.2) cri (2.3.0) colored (>= 1.2) + ffi (1.0.11) mime-types (1.19) nanoc (3.4.0) cri (~> 2.2) nanoc-cachebuster (0.3.1) nanoc (>= 3.3.0) nokogiri (1.5.5) - posix-spawn (0.3.6) puma (1.6.1) rack (~> 1.2) rack (1.4.1) rack-rewrite (1.2.1) rainpress (1.0) redcarpet (2.1.1) + rubypython (0.6.2) + blankslate (>= 2.1.2.3) + ffi (~> 1.0.7) slim (1.2.2) temple (~> 0.4.0) tilt (~> 1.3.3) @@ -35,7 +45,6 @@ PLATFORMS DEPENDENCIES adsf - albino builder clogger mime-types @@ -43,6 +52,7 @@ DEPENDENCIES nanoc-cachebuster nokogiri puma + pygments.rb! rack rack-rewrite rainpress diff --git a/lib/markdown_html.rb b/lib/markdown_html.rb index 9024d27..adc6177 100644 --- a/lib/markdown_html.rb +++ b/lib/markdown_html.rb @@ -1,10 +1,12 @@ -require 'albino' +require 'pygments.rb' + +RubyPython.start python_exe: 'python2.6' if ENV['RACK_ENV'] == 'production' class MarkdownHTML < Redcarpet::Render::HTML include Redcarpet::Render::SmartyPants def block_code(code, language) - language ? Albino.colorize(code, language) : code + Pygments.highlight(code, lexer: language) end def table(header, body)