procore 0.8.1 → 0.8.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: de9db8ec73ee357db98a0f91e185181dd0974b17984876a9fb6fbda80f7d43ea
4
- data.tar.gz: 1dfba18ed4f52b11111cd46ce565d247bdf0dfd893f6adac805d15f8ba7ea26a
3
+ metadata.gz: 077a873c81ee1fd3e8a28c07f47705c80a7b32a1b8feeaa47d287ea3fb577e39
4
+ data.tar.gz: 922b0b81c2f3231909a5001668c8b90cf5a18761ad56b05744243713726110ac
5
5
  SHA512:
6
- metadata.gz: 72d12d650d80082e301964204f37d78a95d947a71b7a938d456013f081b0f5d8079226aca82df8d38790483f9f9ce0d2f0ecfbcfbff560207084aa10ca02e59b
7
- data.tar.gz: cfeda2877fd80e28af9e48f2dfd26d7f8975b9c5d52e3c7b89af84acafe72e20e31c8cedc61fe8a19735c2e9cc70f703a6d5de54aaf487fca0ea40979b924035
6
+ metadata.gz: dedca26f4c6abaccd4ec1155a2b582909d48f3214f67944d2e06f577d66987d1c4bc5e49567885c74955626b2fd5899c414bd2c2056fc2880bed12a81915e775
7
+ data.tar.gz: 53bc7810d4dd0b77067418e213ec3487688c967bb46edfdcde750783c205b864f3df58275fdb662e504eb316cbf0e35e4ad543aa42e6e8ba42a0b5ea96659bff
data/.travis.yml CHANGED
@@ -9,6 +9,7 @@ services:
9
9
 
10
10
  before_install:
11
11
  - gem update --system
12
+ - gem install bundler
12
13
 
13
14
  cache: bundler
14
15
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.8.2 (May 7, 2018)
4
+
5
+ * Rescue Procore::OAuthError
6
+ * Add Procore::MissingTokenError
7
+
8
+ *Casey Ochs*
9
+
3
10
  ## 0.8.1 (April 13, 2018)
4
11
 
5
12
  * Fix rubocop
data/README.md CHANGED
@@ -2,7 +2,24 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/procore/ruby-sdk.svg?branch=move-to-travis)](https://travis-ci.org/procore/ruby-sdk)
4
4
 
5
- ## Installation & Usage
5
+ #### Table of Contents
6
+ - [Installation](#installation)
7
+ - [Making Requests](#making-requests)
8
+ - [Usage](#usage)
9
+ - [Error Handling](#error-handling)
10
+ - [Pagination](#pagination)
11
+ - [Navigating Through Paginated Results](#navigating-through-paginated-results)
12
+ - [Change Number of Results](#change-number-of-results)
13
+ - [Configuration](#configuration)
14
+ - [Stores](#stores)
15
+ - [Session Store](#session-store)
16
+ - [Redis Store](#redis-store)
17
+ - [ActiveRecord Store](#activerecord-store)
18
+ - [File Store](#file-store)
19
+ - [Memory Store](#memory-store)
20
+ - [Full Example](#full-example)
21
+
22
+ ## Installation
6
23
 
7
24
  Add this line to your application's Gemfile:
8
25
 
@@ -121,6 +138,9 @@ rescue Procore::OAuthError => e
121
138
  # Raised whenever there is a problem with OAuth. Possible causes: required
122
139
  # credentials are missing or an access token failed to refresh.
123
140
 
141
+ rescue Procore::MissingTokenError => e
142
+ # Raised whenever an access token is nil or invalid.
143
+
124
144
  rescue Procore::AuthorizationError => e
125
145
  # Raised when the request is attempting to access a resource the token's
126
146
  # owner does not have access to.
@@ -52,7 +52,7 @@ module Procore
52
52
  token = store.fetch
53
53
 
54
54
  if token.nil? || token.invalid?
55
- raise Procore::OAuthError.new(
55
+ raise Procore::MissingTokenError.new(
56
56
  "Unable to retreive an access token from the store. Double check " \
57
57
  "your store configuration and make sure to correctly store a token " \
58
58
  "before attempting to make API requests",
@@ -63,4 +63,7 @@ module Procore
63
63
 
64
64
  # Raised when a Procore endpoint returns a 500x resonse code.
65
65
  ServerError = Class.new(Error)
66
+
67
+ # Raised when a token is missing with refresh failure.
68
+ MissingTokenError = Class.new(Error)
66
69
  end
@@ -163,7 +163,7 @@ module Procore
163
163
 
164
164
  begin
165
165
  result = yield
166
- rescue RestClient::Exceptions::Timeout, Errno::ECONNREFUSED => e
166
+ rescue RestClient::Exceptions::Timeout, Errno::ECONNREFUSED, Procore::OAuthError => e
167
167
  if retries <= Procore.configuration.max_retries
168
168
  retries += 1
169
169
  sleep 1.5**retries
@@ -1,3 +1,3 @@
1
1
  module Procore
2
- VERSION = "0.8.1".freeze
2
+ VERSION = "0.8.2".freeze
3
3
  end
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.1
4
+ version: 0.8.2
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-04-13 00:00:00.000000000 Z
11
+ date: 2018-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack