dropbox-api 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -6,4 +6,5 @@ gemspec
6
6
  gem "rspec"
7
7
  gem "rake"
8
8
  gem 'simplecov'
9
- gem "ruby-debug19"
9
+ gem "ruby-debug19"
10
+ gem "yajl-ruby"
data/dropbox-api.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.rubyforge_project = "dropbox-api"
15
15
 
16
- s.add_dependency 'yajl-ruby'
16
+ s.add_dependency 'multi_json'
17
17
  s.add_dependency 'oauth'
18
18
  s.add_dependency 'hashie'
19
19
 
@@ -13,19 +13,19 @@ module Dropbox
13
13
  when 401
14
14
  raise Dropbox::API::Error::Unauthorized
15
15
  when 403
16
- parsed = Yajl::Parser.parse(response.body)
16
+ parsed = MultiJson.decode(response.body)
17
17
  raise Dropbox::API::Error::Forbidden.new(parsed["error"])
18
18
  when 404
19
19
  raise Dropbox::API::Error::NotFound
20
20
  when 400, 406
21
- parsed = Yajl::Parser.parse(response.body)
21
+ parsed = MultiJson.decode(response.body)
22
22
  raise Dropbox::API::Error.new(parsed["error"])
23
23
  when 300..399
24
24
  raise Dropbox::API::Error::Redirect
25
25
  when 500..599
26
26
  raise Dropbox::API::Error
27
27
  else
28
- options[:raw] ? response.body : Yajl::Parser.parse(response.body)
28
+ options[:raw] ? response.body : MultiJson.decode(response.body)
29
29
  end
30
30
  end
31
31
 
@@ -1,5 +1,5 @@
1
1
  module Dropbox
2
2
  module API
3
- VERSION = "0.2.2"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
data/lib/dropbox-api.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require "oauth"
2
- require "yajl"
2
+ require "multi_json"
3
3
  require "hashie"
4
4
 
5
5
  module Dropbox
data/spec/spec_helper.rb CHANGED
@@ -7,6 +7,10 @@ end
7
7
  require 'dropbox-api'
8
8
  require 'rspec'
9
9
 
10
+ # If you wand to change the json, you can do it here
11
+ # I still believe yajl is the best :) - marcinbunsch
12
+ MultiJson.engine= :yajl
13
+
10
14
  module Dropbox
11
15
  Spec = Hashie::Mash.new
12
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dropbox-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ cert_chain: []
12
12
  date: 2012-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: yajl-ruby
15
+ name: multi_json
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements: