pco_api 2.1.0 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/pco/api/endpoint.rb +3 -14
- data/lib/pco/api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a98c5730a8af7dab274655facb2621c9db150ac65bc717ba3d67ba757a575e65
|
4
|
+
data.tar.gz: 9a342bcbb0cce575fc52aed282f47bd4575e0235233f20b9a361d6282d706081
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa0fcc5235a06ba8c94ec643a6c2f004c24b0f97f06326982e7bd82c21bbfb1d4867ad16af42aa16eede8d8088605ff5900a6a9ca5f6eb832e85068d7e3699f4
|
7
|
+
data.tar.gz: 3a7020a5b4513d0e055330fd025d8017bd513ca1af457c8c1c729d013f16f523f020642638b0c9fa95479e6d62b572bdc1ba6f87a43db77d9f61fcc2be7b0f2b
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# pco_api
|
2
2
|
|
3
|
-
[![Circle CI](https://circleci.com/gh/planningcenter/pco_api_ruby/tree/
|
3
|
+
[![Circle CI](https://circleci.com/gh/planningcenter/pco_api_ruby/tree/main.svg?style=svg)](https://circleci.com/gh/planningcenter/pco_api_ruby/tree/main)
|
4
4
|
|
5
5
|
`pco_api` is a Rubygem that provides a simple wrapper around our RESTful JSON API at https://api.planningcenteronline.com.
|
6
6
|
|
data/lib/pco/api/endpoint.rb
CHANGED
@@ -52,7 +52,7 @@ module PCO
|
|
52
52
|
|
53
53
|
def post(body = {})
|
54
54
|
@last_result = @connection.post(@url) do |req|
|
55
|
-
req.body =
|
55
|
+
req.body = body.to_json
|
56
56
|
end
|
57
57
|
_build_response(@last_result)
|
58
58
|
rescue Errors::TooManyRequests => e
|
@@ -61,7 +61,7 @@ module PCO
|
|
61
61
|
|
62
62
|
def patch(body = {})
|
63
63
|
@last_result = @connection.patch(@url) do |req|
|
64
|
-
req.body =
|
64
|
+
req.body = body.to_json
|
65
65
|
end
|
66
66
|
_build_response(@last_result)
|
67
67
|
rescue Errors::TooManyRequests => e
|
@@ -116,18 +116,6 @@ module PCO
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
def _build_body(body)
|
120
|
-
if _needs_url_encoded?
|
121
|
-
Faraday::Utils.build_nested_query(body)
|
122
|
-
else
|
123
|
-
body.to_json
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
def _needs_url_encoded?
|
128
|
-
@url =~ /oauth\/[a-z]+\z/
|
129
|
-
end
|
130
|
-
|
131
119
|
def _build_endpoint(path)
|
132
120
|
@cache[path] ||= begin
|
133
121
|
self.class.new(
|
@@ -139,6 +127,7 @@ module PCO
|
|
139
127
|
|
140
128
|
def _build_connection
|
141
129
|
Faraday.new(url: url) do |faraday|
|
130
|
+
faraday.request :json
|
142
131
|
faraday.response :json, content_type: /\bjson$/
|
143
132
|
if @basic_auth_token && @basic_auth_secret
|
144
133
|
faraday.request :authorization, :basic, @basic_auth_token, @basic_auth_secret
|
data/lib/pco/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pco_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Planning Center Online
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
|
-
rubygems_version: 3.
|
119
|
+
rubygems_version: 3.5.11
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: API wrapper for api.planningcenteronline.com
|