Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix code formatting by restricting coderay and lesstile versions

The Gemfile allowed me to install incompatible verisons of lesstile and
coderay (1.0.1 and 1.0.5, respectively).  The result was this exception
when formatting a post:

     NoMethodError:
       undefined method `div' for #<String:0x00000103b7daf0>

The incompatibility is fixed in lesstile 1.1.0.

Request the fixed version in the Gemfile, and pair it with a
version of coderay that is known to be compatible.  Add an integration
spec to ensure future compatability.
  • Loading branch information...
commit 2ad5b79c2e080ce12fc224d8291008a23f2ca3d4 1 parent 2d0d06c
@mcary mcary authored
Showing with 16 additions and 5 deletions.
  1. +2 −2 Gemfile
  2. +3 −3 Gemfile.lock
  3. +11 −0 spec/lib/enki_formatter_spec.rb
View
4 Gemfile
@@ -37,8 +37,8 @@ gem 'RedCloth', '~> 4.2.9', :require => 'redcloth'
gem 'ruby-openid', :require => 'openid'
gem 'rack-openid', :require => 'rack/openid'
gem 'aaronh-chronic', :require => 'chronic' # Fixes for 1.9.2
-gem 'coderay'
-gem 'lesstile'
+gem 'coderay', '~> 1.0.5'
+gem 'lesstile', '~> 1.1.0'
gem 'formtastic'
gem 'will_paginate', '~> 3.0.2'
gem 'exception_notification', '~> 2.5.2'
View
6 Gemfile.lock
@@ -96,7 +96,7 @@ GEM
addressable (~> 2.2.6)
ffi (~> 1.0.9)
spoon (~> 0.0.1)
- lesstile (1.0.1)
+ lesstile (1.1.0)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -195,7 +195,7 @@ DEPENDENCIES
RedCloth (~> 4.2.9)
aaronh-chronic
activerecord-jdbcsqlite3-adapter
- coderay
+ coderay (~> 1.0.5)
cucumber-rails
cucumber-websteps
database_cleaner
@@ -204,7 +204,7 @@ DEPENDENCIES
formtastic
jquery-rails
jruby-openssl
- lesstile
+ lesstile (~> 1.1.0)
nokogiri (~> 1.5.0)
open_id_authentication
rack-openid
View
11 spec/lib/enki_formatter_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe EnkiFormatter, '#format_as_xhtml' do
+ it "should format code blocks" do
+ EnkiFormatter.format_as_xhtml("--- ruby\n"+
+ "puts 'hi'\n"+
+ "---\n").
+ should match(/puts.*hi/)
+ end
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.