Browse files

Remove JSON dependency [Fixes #152]

  • Loading branch information...
1 parent 7faa4a3 commit cf2b2618c718a2ce15e5c4e5d4af3b935267d2af @ConradIrwin ConradIrwin committed Nov 10, 2013
Showing with 15 additions and 6 deletions.
  1. +8 −3 build/gist
  2. +0 −1 gist.gemspec
  3. +7 −2 lib/gist.rb
View
11 build/gist
@@ -3,7 +3,10 @@
# any changes will be overwritten.
require 'net/https'
require 'cgi'
-require 'strscan'
+require 'uri'
+
+begin
+ require 'strscan'
module JSON
module Pure
@@ -1307,13 +1310,15 @@ end
JSON.generator = JSON::Pure::Generator
JSON.parser = JSON::Pure::Parser
-require 'uri'
+rescue LoadError
+ require File.join File.dirname(File.dirname(__FILE__)), 'vendor', 'json.rb'
+end
# It just gists.
module Gist
extend self
- VERSION = '4.1.1'
+ VERSION = '4.1.2'
# A list of clipboard commands with copy and paste support.
CLIPBOARD_COMMANDS = {
View
1 gist.gemspec
@@ -14,7 +14,6 @@ Gem::Specification.new do |s|
s.executables << 'gist'
- s.add_dependency 'json'
%w(rake rspec webmock ronn).each do |gem|
s.add_development_dependency gem
end
View
9 lib/gist.rb
@@ -1,13 +1,18 @@
require 'net/https'
require 'cgi'
-require 'json'
require 'uri'
+begin
+ require 'json'
+rescue LoadError
+ require File.join File.dirname(File.dirname(__FILE__)), 'vendor', 'json.rb'
+end
+
# It just gists.
module Gist
extend self
- VERSION = '4.1.2'
+ VERSION = '4.1.3'
# A list of clipboard commands with copy and paste support.
CLIPBOARD_COMMANDS = {

0 comments on commit cf2b261

Please sign in to comment.