From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Tue, 28 Feb 2012 19:30:32 +0900
Subject: Remove rubygems depends

Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
 lib/coderay/encoders/json.rb |   11 ++---------
 lib/coderay/for_redcloth.rb  |   13 +------------
 2 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/lib/coderay/encoders/json.rb b/lib/coderay/encoders/json.rb
index a9e40dc..51a8539 100644
--- a/lib/coderay/encoders/json.rb
+++ b/lib/coderay/encoders/json.rb
@@ -20,15 +20,8 @@ module Encoders
     begin
       require 'json'
     rescue LoadError
-      begin
-        require 'rubygems' unless defined? Gem
-        gem 'json'
-        require 'json'
-      rescue LoadError
-        $stderr.puts "The JSON encoder needs the JSON library.\n" \
-          "Please gem install json."
-        raise
-      end
+      $stderr.puts "The JSON encoder needs the JSON library.\n" \
+      raise
     end
     
     register_for :json
diff --git a/lib/coderay/for_redcloth.rb b/lib/coderay/for_redcloth.rb
index f9df32b..88ef585 100644
--- a/lib/coderay/for_redcloth.rb
+++ b/lib/coderay/for_redcloth.rb
@@ -13,18 +13,7 @@ module CodeRay
   module ForRedCloth
     
     def self.install
-      gem 'RedCloth', '>= 4.0.3' if defined? gem
       require 'redcloth'
-      unless RedCloth::VERSION.to_s >= '4.0.3'
-        if defined? gem
-          raise 'CodeRay.for_redcloth needs RedCloth version 4.0.3 or later. ' +
-            "You have #{RedCloth::VERSION}. Please gem install RedCloth."
-        else
-          $".delete 'redcloth.rb'  # sorry, but it works
-          require 'rubygems'
-          return install  # retry
-        end
-      end
       unless RedCloth::VERSION.to_s >= '4.2.2'
         warn 'CodeRay.for_redcloth works best with RedCloth version 4.2.2 or later.'
       end
@@ -92,4 +81,4 @@ module CodeRay
   
 end
 
-CodeRay::ForRedCloth.install
\ No newline at end of file
+CodeRay::ForRedCloth.install
