Skip to content
Browse files

use activesupport for json parsing

  • Loading branch information...
1 parent b5fb517 commit 6079263a661bfa933c6ccff01362c8d5a7d31bdd @ddollar ddollar committed
Showing with 23 additions and 15 deletions.
  1. +6 −6 Gemfile
  2. +1 −2 Gemfile.lock
  3. +10 −2 lib/taps/json.rb
  4. +6 −5 taps.gemspec
View
12 Gemfile
@@ -5,12 +5,12 @@ source "http://rubygems.org"
# manually load the gem's dependencies for now until
# bundler version on Heroku is upgraded
-gem "json", "~> 1.5.1"
-gem "rack", ">= 1.0.1"
-gem "rest-client", ">= 1.4.0", "< 1.7.0"
-gem "sequel", "~> 3.20.0"
-gem "sinatra", "~> 1.0.0"
-gem "sqlite3-ruby", "~> 1.2"
+gem "activesupport", ">= 2.1.0"
+gem "rack", ">= 1.0.1"
+gem "rest-client", ">= 1.4.0", "< 1.7.0"
+gem "sequel", "~> 3.20.0"
+gem "sinatra", "~> 1.0.0"
+gem "sqlite3-ruby" , "~> 1.2"
group :development do
gem "bacon"
View
3 Gemfile.lock
@@ -10,7 +10,6 @@ GEM
hoptoad_notifier (2.4.7)
activesupport
builder
- json (1.5.1)
mime-types (1.16)
mocha (0.9.8)
rake
@@ -37,10 +36,10 @@ PLATFORMS
ruby
DEPENDENCIES
+ activesupport (>= 2.1.0)
bacon
extlib (= 0.9.15)
hoptoad_notifier
- json (~> 1.5.1)
mocha
mysql (= 2.8.1)
mysql2 (= 0.2.6)
View
12 lib/taps/json.rb
@@ -1,5 +1,13 @@
+require "active_support"
+require "active_support/json"
+require "active_support/ordered_hash"
+
+# for compatibility with activesupport 2.2 and below
unless Kernel.const_defined?(:JSON)
- $:.unshift File.expand_path("../vendor/json_pure-1.5.1/lib", __FILE__)
- require "json/pure"
+ module JSON
+ def self.parse(json)
+ ActiveSupport::JSON.decode(json)
+ end
+ end
end
View
11 taps.gemspec
@@ -13,11 +13,12 @@ Gem::Specification.new do |gem|
gem.files = Dir["**/*"].select { |d| d =~ %r{^(README|VERSION|bin/|data/|ext/|lib/|spec/|test/)} }
- gem.add_dependency "rack", ">= 1.0.1"
- gem.add_dependency "rest-client", ">= 1.4.0", "< 1.7.0"
- gem.add_dependency "sequel", "~> 3.20.0"
- gem.add_dependency "sinatra", "~> 1.0.0"
- gem.add_dependency "sqlite3-ruby", "~> 1.2"
+ gem.add_dependency "activesupport", ">= 2.1.0"
+ gem.add_dependency "rack", ">= 1.0.1"
+ gem.add_dependency "rest-client", ">= 1.4.0", "< 1.7.0"
+ gem.add_dependency "sequel", "~> 3.20.0"
+ gem.add_dependency "sinatra", "~> 1.0.0"
+ gem.add_dependency "sqlite3-ruby", "~> 1.2"
gem.add_development_dependency "bacon"
gem.add_development_dependency "mocha"

0 comments on commit 6079263

Please sign in to comment.
Something went wrong with that request. Please try again.