lemur 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGNhNWViNDk1OTc5NGY4ZDM1NTI5OTU1ODczOThlOTAzYjIxMGE4Nw==
4
+ M2E3NjBjZTkwMjVhZjcxZjI1N2RkMWQ2OWU0ZGQ4ZDJiMWFhYTJjOA==
5
5
  data.tar.gz: !binary |-
6
- YTExZTg5NjdlODgzOGVjNGUyN2I0MTZjOWNjODk2M2FkY2QzODBiMw==
6
+ MjAwY2ZhMWU2MmYxNjE1ZDUzNjgzOTRlZDJmMzcyYTExNDViZTE1MA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MGQ0ZjA5YzA3ZGU4ZGRhZTdmYzEwZjM1NmRhYzJmYTFkNjJiZTcyYjMyMzNj
10
- OTQ3MGQ4ZGQzN2M4ZjBlN2Q3ZjRmM2JmMzI1ZWIxZDQzMWU2OTYwOWI0ZjM1
11
- ZThkODZkNTJiZDZmOGNiYjlkODhkNjU4YzkxYTMzZTg1MDliZmU=
9
+ MTc1YjhmMTUwZmJkZjRlYzE4YzMwMDQzZDMwN2M0ZjRmNjY2MTA4YjQ0NGZj
10
+ Y2M2YTRmOWNiODYxM2ViZmE0NWQ4OTlhNjFkMjcyMTQ5M2EyYzFmNDBjYjI1
11
+ MWNiYjE5ZTVjZjBlNjYxY2IzYTkzNmY1OWIzYjZlY2NkYzBiMDg=
12
12
  data.tar.gz: !binary |-
13
- ODc3MzdlNzE4YzdjN2ZjMTc3NzJmNmJmZDE4NzU2M2JhMmM2MWI4NDU4Y2Fi
14
- ZWMyZTczYzA1OWZmM2IwODRlZWMwN2Y0ZmIwOTkzZGE2MmU0MWNlZjhlOWZj
15
- NWYzZDE2NzQxMjhmZWUxYzNmN2Y1ZmUzODM3NjliZGRjMDAwZWE=
13
+ MDk2MjA4YjQ3ZTJlMmVmMmE5MzM0MjkyNGIwMTBhNDczNDVhOTA4YmM0Zjk5
14
+ MTYwNTZiNWE1YzIxNmYzMGQ2MWY4MGIyM2YxN2VkNTZkMmJjYTQyMmYxNzkw
15
+ MTNiZTUzYWJiZTc3YTgyMzI5MWMzN2ZjZDJlYzQwNDE3NjM0MGY=
data/README.md CHANGED
@@ -8,8 +8,10 @@ Lemur is a lightweight, flexible Ruby SDK for Odnoklassniki. It allows read/writ
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- gem 'lemur'
11
+ gem "lemur", "~> 0.0.5"
12
+
12
13
  or instal gem with latest changes
14
+
13
15
  gem 'lemur', :git => "git@github.com:edikgat/lemur.git"
14
16
 
15
17
  And then execute:
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
 
24
24
  spec.add_runtime_dependency "faraday", "~> 0.8"
25
+ spec.add_runtime_dependency "multi_json", "~> 1.3"
25
26
  end
@@ -1,7 +1,7 @@
1
1
  require "lemur/version"
2
2
 
3
- require 'json'
4
3
  require 'digest/md5'
4
+ require 'multi_json'
5
5
 
6
6
  module Lemur
7
7
 
@@ -40,7 +40,7 @@ module Lemur
40
40
  client_secret: @security_options[:application_secret_key]
41
41
  }
42
42
  end
43
- new_token_response = JSON.parse(new_token_response.body)
43
+ new_token_response = MultiJson.load(new_token_response.body)
44
44
  @security_options[:access_token] = new_token_response['access_token']
45
45
  new_token_response['access_token']
46
46
  end
@@ -55,13 +55,15 @@ module Lemur
55
55
 
56
56
  def get(request_params)
57
57
  @response = get_request(request_params)
58
- json_data = JSON.parse(response.body)
58
+ json_data = MultiJson.load(response.body)
59
59
  if json_data.is_a? Hash
60
60
  if json_data['error_code']
61
61
  raise ApiError, json_data
62
62
  end
63
63
  end
64
64
  json_data
65
+ rescue MultiJson::DecodeError
66
+ raise ApiError, @response.body
65
67
  end
66
68
 
67
69
  private
@@ -1,3 +1,3 @@
1
1
  module Lemur
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lemur
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduard Gataullin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-28 00:00:00.000000000 Z
11
+ date: 2013-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: multi_json
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
55
69
  description: Lemur is a lightweight, flexible Ruby SDK for Odnoklassniki. It allows
56
70
  read/write access to Odnoklassniki API. To work with Lemur you need VALUABLE ACCESS
57
71
  to odnoklassniki api. This api work only with access_token that gives you odnoklassniki,