nationbuilder-rb 1.3.9 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +6 -6
- data/VERSION +1 -1
- data/lib/nationbuilder/client.rb +11 -3
- data/nationbuilder-rb.gemspec +4 -4
- data/spec/lib/nationbuilder/client_spec.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52b1ca460f4961a2d573337f6a7d390aa8f684a1
|
4
|
+
data.tar.gz: 8202b954b601ee8e3a7752785879e744e898b021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c9963163cb0d0588271b0545a1ed24ea4888a8cd9af1e949f6d527ceae152b3a52a9bed7542ce064764eb72dc14ce506f27efc8b5af50529abdb2bd1678ca54
|
7
|
+
data.tar.gz: c9a80de774c4c07c4a4ab2e1f5cb3b5e57a5dc95ba1ce884bf7ef6817928b2d1c62bdfbd4fdfd1bc839e78ceb6b8a97ceedae325b209f2608fa2293c6770f755
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
GEM
|
2
|
-
remote:
|
2
|
+
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
4
|
addressable (2.3.7)
|
5
5
|
builder (3.2.2)
|
@@ -34,19 +34,19 @@ GEM
|
|
34
34
|
rdoc
|
35
35
|
json (1.8.2)
|
36
36
|
jwt (1.2.1)
|
37
|
-
|
37
|
+
mini_portile2 (2.0.0)
|
38
38
|
multi_json (1.10.1)
|
39
39
|
multi_xml (0.5.5)
|
40
40
|
multipart-post (2.0.0)
|
41
|
-
nokogiri (1.6.
|
42
|
-
|
41
|
+
nokogiri (1.6.7.2)
|
42
|
+
mini_portile2 (~> 2.0.0.rc2)
|
43
43
|
oauth2 (1.0.0)
|
44
44
|
faraday (>= 0.8, < 0.10)
|
45
45
|
jwt (~> 1.0)
|
46
46
|
multi_json (~> 1.3)
|
47
47
|
multi_xml (~> 0.5)
|
48
48
|
rack (~> 1.2)
|
49
|
-
rack (1.6.
|
49
|
+
rack (1.6.4)
|
50
50
|
rake (10.4.2)
|
51
51
|
rdoc (4.2.0)
|
52
52
|
json (~> 1.4)
|
@@ -87,4 +87,4 @@ DEPENDENCIES
|
|
87
87
|
webmock (~> 1.18)
|
88
88
|
|
89
89
|
BUNDLED WITH
|
90
|
-
1.
|
90
|
+
1.11.2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.1
|
data/lib/nationbuilder/client.rb
CHANGED
@@ -131,9 +131,7 @@ class NationBuilder::Client
|
|
131
131
|
return true
|
132
132
|
end
|
133
133
|
|
134
|
-
body
|
135
|
-
return {} if body.length == 0
|
136
|
-
return JSON.parse(body)
|
134
|
+
parsed_body(response.body).merge('status_code' => response.code)
|
137
135
|
end
|
138
136
|
|
139
137
|
def print_all_descriptions
|
@@ -173,4 +171,14 @@ class NationBuilder::Client
|
|
173
171
|
end
|
174
172
|
end
|
175
173
|
|
174
|
+
private
|
175
|
+
|
176
|
+
def parsed_body(body)
|
177
|
+
if body.length == 0
|
178
|
+
{}
|
179
|
+
else
|
180
|
+
JSON.parse(body)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
176
184
|
end
|
data/nationbuilder-rb.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: nationbuilder-rb 1.
|
5
|
+
# stub: nationbuilder-rb 1.4.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "nationbuilder-rb"
|
9
|
-
s.version = "1.
|
9
|
+
s.version = "1.4.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["David Huie", "Alexandre Schmitt"]
|
14
|
-
s.date = "2016-
|
14
|
+
s.date = "2016-03-30"
|
15
15
|
s.description = "A Ruby client to the NationBuilder API"
|
16
16
|
s.email = "schmitt@nationbuilder.com"
|
17
17
|
s.executables = ["nbdoc"]
|
@@ -86,7 +86,7 @@ Gem::Specification.new do |s|
|
|
86
86
|
]
|
87
87
|
s.homepage = "http://github.com/nationbuilder/nationbuilder-rb"
|
88
88
|
s.licenses = ["MIT"]
|
89
|
-
s.rubygems_version = "2.4.
|
89
|
+
s.rubygems_version = "2.4.8"
|
90
90
|
s.summary = "A Ruby client to the NationBuilder API"
|
91
91
|
|
92
92
|
if s.respond_to? :specification_version then
|
@@ -50,6 +50,7 @@ describe NationBuilder::Client do
|
|
50
50
|
it 'should handle a parametered GET' do
|
51
51
|
VCR.use_cassette('parametered_get') do
|
52
52
|
response = client.call(:basic_pages, :index, site_slug: 'organizeralexandreschmitt', limit: 11)
|
53
|
+
expect(response['status_code']).to eq(200)
|
53
54
|
response['results'].each do |result|
|
54
55
|
expect(result['site_slug']).to eq('organizeralexandreschmitt')
|
55
56
|
end
|
@@ -69,6 +70,7 @@ describe NationBuilder::Client do
|
|
69
70
|
client.call(:people, :create, params)
|
70
71
|
end
|
71
72
|
|
73
|
+
expect(response['status_code']).to eq(201)
|
72
74
|
expect(response['person']['first_name']).to eq('Bob')
|
73
75
|
end
|
74
76
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nationbuilder-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Huie
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httpclient
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
version: '0'
|
188
188
|
requirements: []
|
189
189
|
rubyforge_project:
|
190
|
-
rubygems_version: 2.4.
|
190
|
+
rubygems_version: 2.4.8
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: A Ruby client to the NationBuilder API
|