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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6545e8ea432e0c10b0a3cd0e1257e96b57bf18f44c6d3ecfd3fa5805212290db
4
- data.tar.gz: c93910a023d455bcc2731f8f74a1ebe3631851c0b711cf4effff9f1fe84b4503
3
+ metadata.gz: 0e9072c893654842077d13100acc0afa9f78a4af28e902748494c58f467c8350
4
+ data.tar.gz: b78ba6679d1dfbc2d96d0b395a9778278eac1979efa1fccb5bb3063d81b7430d
5
5
  SHA512:
6
- metadata.gz: 6376d8a7cc0a0a494594ce185e77630b885da38bbd14614219f069e3eaccd7f0f7cc202f007ef58129db49910bd518523e285830fbd3d6c379d920fdeceef6f9
7
- data.tar.gz: e258551108c844d80137919ce861233db506ba97d72598f93da3c2e7818425188857a42be0ef2b3d28dde99e95eb304f5d11b179b2f470c45dfde37574e7b742
6
+ metadata.gz: e36b749b1c34f1f87316c1530a4668bc4e52914fd5b60e29d4a5055755957dbcf46d87028b62baaedec45de57815ba93d4dd305f04dd19fb7972114fe350a8a7
7
+ data.tar.gz: c49008dd2ccf0cc0d37fc1457462328a0916161a9bb54c1bd1c35c9d537ccd284b90d319e4c67cadce4b6afc530a37f80347af163877fc52978f69f39c07e4ae
@@ -3,6 +3,7 @@ rvm:
3
3
  - 2.3
4
4
  - 2.4
5
5
  - 2.5
6
+ - 2.6
6
7
 
7
8
  services:
8
9
  - redis-server
@@ -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",
@@ -41,7 +41,11 @@ module Procore
41
41
  private
42
42
 
43
43
  def base_api_path
44
- "#{options[:host]}/vapid"
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
@@ -204,6 +204,7 @@ module Procore
204
204
  code: result.code,
205
205
  request: result.request,
206
206
  request_body: request_body,
207
+ api_version: api_version
207
208
  )
208
209
 
209
210
  case result.code
@@ -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(/vapid\/(.*?)>; rel="(\w+)"/).captures
76
+ url, name = link.match(/#{api_version}\/(.*?)>; rel="(\w+)"/).captures
76
77
  links.merge!(name.to_sym => url)
77
78
  end
78
79
  end
@@ -1,3 +1,3 @@
1
1
  module Procore
2
- VERSION = "0.8.6".freeze
2
+ VERSION = "0.8.7".freeze
3
3
  end
@@ -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.6
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: 2018-05-10 00:00:00.000000000 Z
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: '0'
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: '0'
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
- rubyforge_project:
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