Skip to content
This repository
Browse code

Oj -> MultiJson

  • Loading branch information...
commit 3418c2d90db3691c72dfdd217a28c195b89a85e3 1 parent d823564
Andrew Zinenko authored
4  Gemfile.lock
@@ -2,7 +2,7 @@ PATH
2 2
   remote: .
3 3
   specs:
4 4
     vk-ruby (0.7.8)
5  
-      oj (~> 1.0.6)
  5
+      multi_json (~> 1.2.0)
6 6
       transformer (~> 0.2.2)
7 7
 
8 8
 GEM
@@ -11,6 +11,7 @@ GEM
11 11
     addressable (2.2.6)
12 12
     crack (0.3.1)
13 13
     minitest (2.10.0)
  14
+    multi_json (1.2.0)
14 15
     oj (1.0.6)
15 16
     rake (0.9.2.2)
16 17
     transformer (0.2.2)
@@ -23,6 +24,7 @@ PLATFORMS
23 24
 
24 25
 DEPENDENCIES
25 26
   minitest (~> 2.8)
  27
+  oj (~> 1.0.6)
26 28
   rake (~> 0.9)
27 29
   vk-ruby!
28 30
   webmock (~> 1.0)
2  lib/vk-ruby.rb
@@ -4,7 +4,7 @@
4 4
 require 'cgi'
5 5
 require 'transformer'
6 6
 require 'yaml'
7  
-require 'oj'
  7
+require 'multi_json'
8 8
 
9 9
 module VK
10 10
 end
2  lib/vk-ruby/core.rb
@@ -75,7 +75,7 @@ def connection_params options
75 75
   end
76 76
 
77 77
   def parse string
78  
-    Oj.load string
  78
+    MultiJson.decode string
79 79
   end
80 80
   
81 81
 end
10  tests/helpers.rb
@@ -4,9 +4,11 @@
4 4
 
5 5
 class String 
6 6
   def to_params
7  
-    result = {}
8  
-    self.split('&').map{|str| result[str.split('=')[0]]=str.split('=')[1] }
9  
-    result
  7
+    self.split('&').inject({}) do |hash, element|  
  8
+      k, v = element.split('=')
  9
+      hash[k] = v
  10
+      hash
  11
+    end
10 12
   end
11 13
 end
12 14
 
@@ -19,7 +21,7 @@ def stringify
19 21
   end
20 22
 
21 23
   def to_json
22  
-    Oj.dump self
  24
+    MultiJson.encode self
23 25
   end
24 26
 
25 27
   def stringify!
3  vk-ruby.gemspec
@@ -17,11 +17,12 @@ Gem::Specification.new do |gem|
17 17
   gem.extra_rdoc_files = ["LICENSE.txt", "README.md" ]
18 18
       
19 19
   gem.add_runtime_dependency 'transformer', '~> 0.2.2'
20  
-  gem.add_runtime_dependency 'oj', '~> 1.0.6'
  20
+  gem.add_runtime_dependency 'multi_json', '~> 1.2.0'
21 21
 
22 22
   gem.add_development_dependency 'rake', '~> 0.9'
23 23
   gem.add_development_dependency 'minitest', '~> 2.8'
24 24
   gem.add_development_dependency 'webmock', '~> 1.0'
  25
+  gem.add_development_dependency 'oj', '~> 1.0.6'
25 26
 
26 27
   gem.require_paths = ['lib']
27 28
   gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6')

0 notes on commit 3418c2d

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