procore 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +7 -1
- data/README.md +8 -0
- data/lib/procore/auth/client_credentials.rb +1 -1
- data/lib/procore/client.rb +5 -1
- data/lib/procore/requestable.rb +1 -0
- data/lib/procore/response.rb +4 -3
- data/lib/procore/version.rb +1 -1
- data/procore.gemspec +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e9072c893654842077d13100acc0afa9f78a4af28e902748494c58f467c8350
|
4
|
+
data.tar.gz: b78ba6679d1dfbc2d96d0b395a9778278eac1979efa1fccb5bb3063d81b7430d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e36b749b1c34f1f87316c1530a4668bc4e52914fd5b60e29d4a5055755957dbcf46d87028b62baaedec45de57815ba93d4dd305f04dd19fb7972114fe350a8a7
|
7
|
+
data.tar.gz: c49008dd2ccf0cc0d37fc1457462328a0916161a9bb54c1bd1c35c9d537ccd284b90d319e4c67cadce4b6afc530a37f80347af163877fc52978f69f39c07e4ae
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 0.8.7 (April 18, 2019)
|
4
|
+
|
5
|
+
* Add api_version to allow calls to procore rest endpoints
|
6
|
+
|
7
|
+
*Shane Means*
|
8
|
+
|
3
9
|
## 0.8.6 (May 10, 2018)
|
4
10
|
|
5
11
|
* Dalli Store
|
@@ -7,7 +13,7 @@
|
|
7
13
|
*Patrick Koperwas*
|
8
14
|
|
9
15
|
* Fix Requestable paths to prevent double slash in URI
|
10
|
-
|
16
|
+
|
11
17
|
*Megan O'Neill*
|
12
18
|
|
13
19
|
## 0.8.5 (May 9, 2018)
|
data/README.md
CHANGED
@@ -314,6 +314,14 @@ Options: `session`: Instance of a Rails session
|
|
314
314
|
|
315
315
|
For applications that want to keep access tokens in the user's session.
|
316
316
|
|
317
|
+
:warning:
|
318
|
+
We strongly discourage using the session as a token store since the rails
|
319
|
+
session is often logged by default to external apps such as bugsnag etc. Be sure
|
320
|
+
you are not logging tokens. There is also the possibility that the rails session
|
321
|
+
is using a cookie store which, depending on application settings, could be
|
322
|
+
unencrypted. Tokens should not be stored client-side if it can be avoided.
|
323
|
+
:warning:
|
324
|
+
|
317
325
|
```ruby
|
318
326
|
store = Procore::Auth::Stores::Session.new(session: session)
|
319
327
|
```
|
@@ -29,7 +29,7 @@ module Procore
|
|
29
29
|
raise OAuthError.new(e.description, response: e.response)
|
30
30
|
rescue Faraday::ConnectionFailed => e
|
31
31
|
raise APIConnectionError.new("Connection Error: #{e.message}")
|
32
|
-
rescue URI::BadURIError
|
32
|
+
rescue URI::BadURIError, URI::InvalidURIError
|
33
33
|
raise OAuthError.new(
|
34
34
|
"Host is not a valid URI. Check your host option to make sure it " \
|
35
35
|
"is a properly formed url",
|
data/lib/procore/client.rb
CHANGED
@@ -41,7 +41,11 @@ module Procore
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def base_api_path
|
44
|
-
"#{options[:host]}
|
44
|
+
"#{options[:host]}/#{api_version}"
|
45
|
+
end
|
46
|
+
|
47
|
+
def api_version
|
48
|
+
options[:api_version] || 'vapid'
|
45
49
|
end
|
46
50
|
|
47
51
|
# @raise [OAuthError] if the store does not have a token stored in it prior
|
data/lib/procore/requestable.rb
CHANGED
data/lib/procore/response.rb
CHANGED
@@ -45,11 +45,12 @@ module Procore
|
|
45
45
|
# @return [Integer] Status Code returned from Procore API.
|
46
46
|
# @!attribute [r] pagination
|
47
47
|
# @return [Hash<Symbol, String>] Pagination URLs
|
48
|
-
attr_reader :headers, :code, :pagination, :request, :request_body
|
48
|
+
attr_reader :headers, :code, :pagination, :request, :request_body, :api_version
|
49
49
|
|
50
|
-
def initialize(body:, headers:, code:, request:, request_body:)
|
50
|
+
def initialize(body:, headers:, code:, request:, request_body:, api_version: 'vapid')
|
51
51
|
@code = code
|
52
52
|
@headers = headers
|
53
|
+
@api_version = api_version
|
53
54
|
@pagination = parse_pagination
|
54
55
|
@request = request
|
55
56
|
@request_body = request_body
|
@@ -72,7 +73,7 @@ module Procore
|
|
72
73
|
|
73
74
|
def parse_pagination
|
74
75
|
headers[:link].to_s.split(", ").map(&:strip).reduce({}) do |links, link|
|
75
|
-
url, name = link.match(
|
76
|
+
url, name = link.match(/#{api_version}\/(.*?)>; rel="(\w+)"/).captures
|
76
77
|
links.merge!(name.to_sym => url)
|
77
78
|
end
|
78
79
|
end
|
data/lib/procore/version.rb
CHANGED
data/procore.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "rake"
|
33
33
|
spec.add_development_dependency "redis"
|
34
34
|
spec.add_development_dependency "rubocop"
|
35
|
-
spec.add_development_dependency "sqlite3"
|
35
|
+
spec.add_development_dependency "sqlite3", "~> 1.3.6"
|
36
36
|
spec.add_development_dependency "webmock"
|
37
37
|
|
38
38
|
spec.add_dependency "activesupport", "> 2.4"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Procore Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -154,16 +154,16 @@ dependencies:
|
|
154
154
|
name: sqlite3
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: 1.3.6
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: 1.3.6
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: webmock
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -275,8 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
275
275
|
- !ruby/object:Gem::Version
|
276
276
|
version: '0'
|
277
277
|
requirements: []
|
278
|
-
|
279
|
-
rubygems_version: 2.7.6
|
278
|
+
rubygems_version: 3.0.3
|
280
279
|
signing_key:
|
281
280
|
specification_version: 4
|
282
281
|
summary: Procore Ruby Gem
|