conversocial 0.1.3 → 0.1.4
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,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8764b923129b5d400e5aa0fda70f321660c46100
|
4
|
+
data.tar.gz: fab16fd618f3267f956a35752092083afb3e86e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e97309bf37932c6d4b7b73ee71b68c382338aae5b3935c988eaab5b582f6a81691c59c666c519c70a65e1a71bf31e1c13c0ac98eb997f8358b8b4b3afe39a93
|
7
|
+
data.tar.gz: a62e2194d8fcf1a4c9b75e4c3a781f80132b9ad5faf4f95ed4209ff1ecb86f66f35e5023cd99ba6569b87d303365e8aa0b54494ca586f20a332d46bb9f53e61c
|
@@ -64,7 +64,6 @@ module Conversocial
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def find find_id
|
67
|
-
|
68
67
|
@query_params[:fields] ||= model_klass.fields.join(',')
|
69
68
|
|
70
69
|
json = get_json add_query_params("/#{find_id}", default_find_query_params.merge(@query_params))
|
@@ -73,7 +72,6 @@ module Conversocial
|
|
73
72
|
item = new json[resource_name]
|
74
73
|
attach_content_to_items([item], json['content']).first
|
75
74
|
end
|
76
|
-
|
77
75
|
end
|
78
76
|
|
79
77
|
def size
|
@@ -208,11 +206,19 @@ module Conversocial
|
|
208
206
|
|
209
207
|
json = JSON.parse response.body
|
210
208
|
if response.kind_of? Net::HTTPSuccess
|
209
|
+
if json.keys.include?('success') && !json['success']
|
210
|
+
if json.keys.include?('permsError') && !!json['permsError']
|
211
|
+
raise Conversocial::Resources::Exceptions::PermissionsError.new response.code, response.message, (json['error'] || json['message'])
|
212
|
+
else
|
213
|
+
raise Conversocial::Resources::Exceptions::Base.new response.code, response.message, json['message']
|
214
|
+
end
|
215
|
+
else
|
216
|
+
json
|
217
|
+
end
|
211
218
|
json
|
212
219
|
else
|
213
220
|
if 404 == response.code.to_i
|
214
221
|
if json['message'] == "No such #{resource_name}"
|
215
|
-
#puts "returning nil here"
|
216
222
|
return nil
|
217
223
|
end
|
218
224
|
end
|
data/lib/conversocial/version.rb
CHANGED
data/lib/conversocial.rb
CHANGED
@@ -35,6 +35,7 @@ require 'conversocial/resources/query_engines/user'
|
|
35
35
|
#require exceptions
|
36
36
|
require 'conversocial/resources/exceptions/base'
|
37
37
|
require 'conversocial/resources/exceptions/rate_limit_exceeded'
|
38
|
+
require 'conversocial/resources/exceptions/permissions_error'
|
38
39
|
|
39
40
|
module Conversocial
|
40
41
|
# Your code goes here...
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conversocial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Misha Conway
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- lib/conversocial/client.rb
|
56
56
|
- lib/conversocial/resources.rb
|
57
57
|
- lib/conversocial/resources/exceptions/base.rb
|
58
|
+
- lib/conversocial/resources/exceptions/permissions_error.rb
|
58
59
|
- lib/conversocial/resources/exceptions/rate_limit_exceeded.rb
|
59
60
|
- lib/conversocial/resources/models.rb
|
60
61
|
- lib/conversocial/resources/models/account.rb
|