Permalink
Browse files

replacing the crack dependency with json, plus version bump

  • Loading branch information...
andrewmbenton committed Jul 17, 2011
1 parent 1edd001 commit 3b7798d864d7e260202be8fc2eacee9faeeb4768
Showing with 5 additions and 5 deletions.
  1. +1 −1 lib/twilio-ruby.rb
  2. +2 −2 lib/twilio-ruby/rest/client.rb
  3. +2 −2 twilio-ruby.gemspec
View
@@ -3,7 +3,7 @@
require 'net/http'
require 'net/https'
require 'builder'
-require 'crack'
+require 'json'
require 'cgi'
require 'openssl'
require 'base64'
@@ -23,13 +23,13 @@ def initialize(account_sid, auth_token, domain = 'api.twilio.com',
uri += "?#{url_encode(params)}" if !params.empty? && method == :get
headers = {
'Accept' => 'application/json',
- 'User-Agent' => 'twilio-ruby/3.0.0'
+ 'User-Agent' => 'twilio-ruby/3.1.0'
}
request = method_class.new uri, headers
request.basic_auth @account_sid, @auth_token
request.form_data = params if [:post, :put].include? method
http_response = @connection.request request
- object = Crack::JSON.parse http_response.body if http_response.body
+ object = JSON.parse http_response.body if http_response.body
if http_response.kind_of? Net::HTTPClientError
raise Twilio::REST::RequestError, object['message']
elsif http_response.kind_of? Net::HTTPServerError
View
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "twilio-ruby"
- s.version = "3.0.0"
+ s.version = "3.1.0"
s.author = "Andrew Benton"
s.email = "andrew@twilio.com"
s.description = "A simple library for communicating with the Twilio REST API"
@@ -9,6 +9,6 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.files = Dir['lib/**/*.rb'] + Dir['test/**/*.rb'] + ['examples.rb', 'Rakefile', 'LICENSE', 'README.md', 'twilio-ruby.gemspec']
s.test_files = Dir['test/**/*.rb']
+ s.add_dependency("json", ">= 1.2.0")
s.add_dependency("builder", ">= 2.1.2")
- s.add_dependency("crack", ">= 0.1.8")
end

0 comments on commit 3b7798d

Please sign in to comment.