File: 0001-Remove-rubygems-depends.patch

package info (click to toggle)
coderay 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 700 kB
  • sloc: ruby: 7,582; makefile: 8
file content (62 lines) | stat: -rw-r--r-- 1,968 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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