summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/json.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2011-09-19 01:51:30 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2011-09-19 01:51:30 +0200
commitc144bfd8918d00e1e1588829f248a88c0561e673 (patch)
treed0f8c357da45dede03a905142d03f0f5ed14d3a4 /lib/coderay/encoders/json.rb
parent2c63d09621ba9251bebbd41484c076194fae03c4 (diff)
downloadcoderay-c144bfd8918d00e1e1588829f248a88c0561e673.tar.gz
cleanup JSON encoder gem loading
Diffstat (limited to 'lib/coderay/encoders/json.rb')
-rw-r--r--lib/coderay/encoders/json.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/coderay/encoders/json.rb b/lib/coderay/encoders/json.rb
index 0a95397..a9e40dc 100644
--- a/lib/coderay/encoders/json.rb
+++ b/lib/coderay/encoders/json.rb
@@ -21,8 +21,8 @@ module Encoders
require 'json'
rescue LoadError
begin
- require 'rubygems'
- gem "json"
+ require 'rubygems' unless defined? Gem
+ gem 'json'
require 'json'
rescue LoadError
$stderr.puts "The JSON encoder needs the JSON library.\n" \