From 3dcb9cd05dfeba462d66ccf1986e08b0f36f9456 Mon Sep 17 00:00:00 2001 From: Jonathan Rudenberg Date: Wed, 22 Aug 2012 14:40:02 -0400 Subject: [PATCH] Switch to albino for now, pygments.rb is segfaulting on heroku --- Gemfile | 2 +- Gemfile.lock | 18 ++++-------------- lib/markdown_html.rb | 6 ++---- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Gemfile b/Gemfile index 97f9741..9389c0c 100644 --- a/Gemfile +++ b/Gemfile @@ -12,5 +12,5 @@ gem 'mime-types' gem 'rack' gem 'puma' gem 'rack-rewrite' -gem 'pygments.rb', :git => 'git://github.com/akzhan/pygments.rb.git', :branch => 'rubypython-0.6' +gem 'albino' gem 'clogger' diff --git a/Gemfile.lock b/Gemfile.lock index 2a9b9ca..ff159e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,39 +1,29 @@ -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) - blankslate (2.1.2.4) + albino (1.3.3) + posix-spawn (>= 0.3.6) 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) @@ -45,6 +35,7 @@ PLATFORMS DEPENDENCIES adsf + albino builder clogger mime-types @@ -52,7 +43,6 @@ DEPENDENCIES nanoc-cachebuster nokogiri puma - pygments.rb! rack rack-rewrite rainpress diff --git a/lib/markdown_html.rb b/lib/markdown_html.rb index adc6177..9024d27 100644 --- a/lib/markdown_html.rb +++ b/lib/markdown_html.rb @@ -1,12 +1,10 @@ -require 'pygments.rb' - -RubyPython.start python_exe: 'python2.6' if ENV['RACK_ENV'] == 'production' +require 'albino' class MarkdownHTML < Redcarpet::Render::HTML include Redcarpet::Render::SmartyPants def block_code(code, language) - Pygments.highlight(code, lexer: language) + language ? Albino.colorize(code, language) : code end def table(header, body)