pco_api 2.1.0 → 2.1.2

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
  SHA256:
3
- metadata.gz: 24edea66c936c4da9459fdaa5a575c53f5ce412382536626524d5ad6891bbc70
4
- data.tar.gz: 85d8c1dc776d5f1b00aa69e5505f2d5227062ad69ae7c24c4a4d1834a2760098
3
+ metadata.gz: a98c5730a8af7dab274655facb2621c9db150ac65bc717ba3d67ba757a575e65
4
+ data.tar.gz: 9a342bcbb0cce575fc52aed282f47bd4575e0235233f20b9a361d6282d706081
5
5
  SHA512:
6
- metadata.gz: 449d3b4f74b5aa220911116292ee0bfd70964a04d82f483db71dbbe9e796b87bf376a9c45925ce45debbec5d08fdc160b9179cfa7e47afc991cb4090c77f8a70
7
- data.tar.gz: 7f4ea90c3e61e1f28d58197ea3f2c09932a8f950df1f09705497d50972a331fb035b07bcbca2d89c09c89f0243b23a439bbafefed767c9d4624094839b728b6d
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/master.svg?style=svg)](https://circleci.com/gh/planningcenter/pco_api_ruby/tree/master)
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
 
@@ -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 = _build_body(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 = _build_body(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
@@ -1,5 +1,5 @@
1
1
  module PCO
2
2
  module API
3
- VERSION = '2.1.0'
3
+ VERSION = '2.1.2'
4
4
  end
5
5
  end
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.0
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: 2023-04-14 00:00:00.000000000 Z
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.4.2
119
+ rubygems_version: 3.5.11
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: API wrapper for api.planningcenteronline.com