procore 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +674 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/Rakefile +9 -3
- data/lib/procore/auth/access_token_credentials.rb +18 -7
- data/lib/procore/auth/client_credentials.rb +21 -22
- data/lib/procore/client.rb +2 -2
- data/lib/procore/errors.rb +1 -1
- data/lib/procore/requestable.rb +11 -11
- data/lib/procore/response.rb +1 -2
- data/lib/procore/version.rb +1 -1
- data/procore.gemspec +4 -2
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56cc4c858cf5be92d0b0d0a88b5baa75504e93dadca7a626349afdf403be3ff1
|
4
|
+
data.tar.gz: cc9610d7670952cb77d830a4481522d1c2d084627584dc22b79c2c2c0f98a171
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b158f1b94063622d7c013f4f021d757cdf08f09dd6474e8e5382b174591290161141a2dab515ab6ff6159e5cf92702885743e796d31ed00cb9d6278075999dc
|
7
|
+
data.tar.gz: a579c807d7c74371ef21f5477f622081d8987eefe15f9c2afa3282dd2141ced7af3d2ca99bb1dcfdbe7f22ec3486e8c79bef6bf25b8e3d8da48bbfd064471b14
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,674 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.3
|
3
|
+
Include:
|
4
|
+
- '**/Rakefile'
|
5
|
+
- '**/config.ru'
|
6
|
+
Exclude:
|
7
|
+
- 'db/**/*'
|
8
|
+
- 'config/**/*'
|
9
|
+
- 'script/**/*'
|
10
|
+
- 'vendor/bundle/**/*'
|
11
|
+
- 'node_modules/**/*'
|
12
|
+
|
13
|
+
Naming/AccessorMethodName:
|
14
|
+
Description: Check the naming of accessor methods for get_/set_.
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
# Waiting for https://github.com/bbatsov/rubocop/pull/5230
|
18
|
+
Style/FormatStringToken:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Style/Alias:
|
22
|
+
Description: 'Use alias_method instead of alias.'
|
23
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
Style/ArrayJoin:
|
27
|
+
Description: 'Use Array#join instead of Array#*.'
|
28
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Style/AsciiComments:
|
32
|
+
Description: 'Use only ascii symbols in comments.'
|
33
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
Naming/AsciiIdentifiers:
|
37
|
+
Description: 'Use only ascii symbols in identifiers.'
|
38
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
39
|
+
Enabled: false
|
40
|
+
|
41
|
+
Style/Attr:
|
42
|
+
Description: 'Checks for uses of Module#attr.'
|
43
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
Metrics/BlockNesting:
|
47
|
+
Description: 'Avoid excessive block nesting'
|
48
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
Style/CaseEquality:
|
52
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
53
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
Style/CharacterLiteral:
|
57
|
+
Description: 'Checks for uses of character literals.'
|
58
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
59
|
+
Enabled: false
|
60
|
+
|
61
|
+
Style/ClassAndModuleChildren:
|
62
|
+
Description: 'Checks style of children classes and modules.'
|
63
|
+
Enabled: true
|
64
|
+
EnforcedStyle: nested
|
65
|
+
Exclude:
|
66
|
+
- 'test/**/*'
|
67
|
+
|
68
|
+
Metrics/ClassLength:
|
69
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
Metrics/ModuleLength:
|
73
|
+
Description: 'Avoid modules longer than 100 lines of code.'
|
74
|
+
Enabled: false
|
75
|
+
|
76
|
+
Style/ClassVars:
|
77
|
+
Description: 'Avoid the use of class variables.'
|
78
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
79
|
+
Enabled: false
|
80
|
+
|
81
|
+
Style/CollectionMethods:
|
82
|
+
Enabled: true
|
83
|
+
PreferredMethods:
|
84
|
+
find: detect
|
85
|
+
inject: reduce
|
86
|
+
collect: map
|
87
|
+
find_all: select
|
88
|
+
|
89
|
+
Style/ColonMethodCall:
|
90
|
+
Description: 'Do not use :: for method call.'
|
91
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
Style/CommentAnnotation:
|
95
|
+
Description: >-
|
96
|
+
Checks formatting of special comments
|
97
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
98
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
Metrics/AbcSize:
|
102
|
+
Description: >-
|
103
|
+
A calculated magnitude based on number of assignments,
|
104
|
+
branches, and conditions.
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
Metrics/BlockLength:
|
108
|
+
Enabled: false
|
109
|
+
CountComments: true # count full line comments?
|
110
|
+
Max: 25
|
111
|
+
ExcludedMethods: []
|
112
|
+
Exclude:
|
113
|
+
- "**/*.rake"
|
114
|
+
- "spec/**/*"
|
115
|
+
|
116
|
+
Metrics/CyclomaticComplexity:
|
117
|
+
Description: >-
|
118
|
+
A complexity metric that is strongly correlated to the number
|
119
|
+
of test cases needed to validate a method.
|
120
|
+
Enabled: false
|
121
|
+
|
122
|
+
Rails/Delegate:
|
123
|
+
Description: 'Prefer delegate method for delegations.'
|
124
|
+
Enabled: false
|
125
|
+
|
126
|
+
Style/PreferredHashMethods:
|
127
|
+
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
|
128
|
+
StyleGuide: '#hash-key'
|
129
|
+
Enabled: false
|
130
|
+
|
131
|
+
Style/Documentation:
|
132
|
+
Description: 'Document classes and non-namespace modules.'
|
133
|
+
Enabled: false
|
134
|
+
|
135
|
+
Style/DoubleNegation:
|
136
|
+
Description: 'Checks for uses of double negation (!!).'
|
137
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
138
|
+
Enabled: false
|
139
|
+
|
140
|
+
Style/EachWithObject:
|
141
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
142
|
+
Enabled: false
|
143
|
+
|
144
|
+
Style/EmptyLiteral:
|
145
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
146
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
147
|
+
Enabled: false
|
148
|
+
|
149
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
150
|
+
# AutoCorrectEncodingComment must match the regex
|
151
|
+
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
152
|
+
Style/Encoding:
|
153
|
+
Enabled: false
|
154
|
+
|
155
|
+
Style/EvenOdd:
|
156
|
+
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
157
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
158
|
+
Enabled: false
|
159
|
+
|
160
|
+
Naming/FileName:
|
161
|
+
Description: 'Use snake_case for source file names.'
|
162
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
163
|
+
Enabled: false
|
164
|
+
|
165
|
+
Style/FrozenStringLiteralComment:
|
166
|
+
Description: >-
|
167
|
+
Add the frozen_string_literal comment to the top of files
|
168
|
+
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
169
|
+
Enabled: false
|
170
|
+
|
171
|
+
Style/FlipFlop:
|
172
|
+
Description: 'Checks for flip flops'
|
173
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
174
|
+
Enabled: false
|
175
|
+
|
176
|
+
Style/FormatString:
|
177
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
178
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
179
|
+
Enabled: false
|
180
|
+
|
181
|
+
Style/GlobalVars:
|
182
|
+
Description: 'Do not introduce global variables.'
|
183
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
184
|
+
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
|
185
|
+
Enabled: false
|
186
|
+
|
187
|
+
Style/GuardClause:
|
188
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
189
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
190
|
+
Enabled: false
|
191
|
+
|
192
|
+
Style/IfUnlessModifier:
|
193
|
+
Description: >-
|
194
|
+
Favor modifier if/unless usage when you have a
|
195
|
+
single-line body.
|
196
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
197
|
+
Enabled: false
|
198
|
+
|
199
|
+
Style/IfWithSemicolon:
|
200
|
+
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
201
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
202
|
+
Enabled: false
|
203
|
+
|
204
|
+
Style/InlineComment:
|
205
|
+
Description: 'Avoid inline comments.'
|
206
|
+
Enabled: false
|
207
|
+
|
208
|
+
Style/Lambda:
|
209
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
210
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
211
|
+
Enabled: false
|
212
|
+
|
213
|
+
Style/LambdaCall:
|
214
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
215
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
216
|
+
Enabled: false
|
217
|
+
|
218
|
+
Style/LineEndConcatenation:
|
219
|
+
Description: >-
|
220
|
+
Use \ instead of + or << to concatenate two string literals at
|
221
|
+
line end.
|
222
|
+
Enabled: false
|
223
|
+
|
224
|
+
Metrics/LineLength:
|
225
|
+
Description: 'Limit lines to 80 characters.'
|
226
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
227
|
+
Max: 150
|
228
|
+
|
229
|
+
Metrics/MethodLength:
|
230
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
231
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
232
|
+
Enabled: false
|
233
|
+
|
234
|
+
Style/ModuleFunction:
|
235
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
236
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
237
|
+
Enabled: false
|
238
|
+
|
239
|
+
Style/MultilineBlockChain:
|
240
|
+
Description: 'Avoid multi-line chains of blocks.'
|
241
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
242
|
+
Enabled: false
|
243
|
+
|
244
|
+
Style/NegatedIf:
|
245
|
+
Description: >-
|
246
|
+
Favor unless over if for negative conditions
|
247
|
+
(or control flow or).
|
248
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
249
|
+
Enabled: false
|
250
|
+
|
251
|
+
Style/NegatedWhile:
|
252
|
+
Description: 'Favor until over while for negative conditions.'
|
253
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
254
|
+
Enabled: false
|
255
|
+
|
256
|
+
Style/Next:
|
257
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
258
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
259
|
+
Enabled: false
|
260
|
+
|
261
|
+
Style/NilComparison:
|
262
|
+
Description: 'Prefer x.nil? to x == nil.'
|
263
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
264
|
+
Enabled: false
|
265
|
+
|
266
|
+
Style/Not:
|
267
|
+
Description: 'Use ! instead of not.'
|
268
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
269
|
+
Enabled: false
|
270
|
+
|
271
|
+
Style/NumericLiterals:
|
272
|
+
Description: >-
|
273
|
+
Add underscores to large numeric literals to improve their
|
274
|
+
readability.
|
275
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
276
|
+
Enabled: false
|
277
|
+
|
278
|
+
Style/OneLineConditional:
|
279
|
+
Description: >-
|
280
|
+
Favor the ternary operator(?:) over
|
281
|
+
if/then/else/end constructs.
|
282
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
283
|
+
Enabled: false
|
284
|
+
|
285
|
+
Naming/BinaryOperatorParameterName:
|
286
|
+
Description: 'When defining binary operators, name the argument other.'
|
287
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
288
|
+
Enabled: false
|
289
|
+
|
290
|
+
Metrics/ParameterLists:
|
291
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
292
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
293
|
+
Enabled: false
|
294
|
+
|
295
|
+
Style/PercentLiteralDelimiters:
|
296
|
+
Description: 'Use `%`-literal delimiters consistently'
|
297
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
298
|
+
Enabled: false
|
299
|
+
|
300
|
+
Style/PerlBackrefs:
|
301
|
+
Description: 'Avoid Perl-style regex back references.'
|
302
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
303
|
+
Enabled: false
|
304
|
+
|
305
|
+
Naming/PredicateName:
|
306
|
+
Description: 'Check the names of predicate methods.'
|
307
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
308
|
+
NamePrefixBlacklist:
|
309
|
+
- is_
|
310
|
+
Exclude:
|
311
|
+
- spec/**/*
|
312
|
+
|
313
|
+
Style/Proc:
|
314
|
+
Description: 'Use proc instead of Proc.new.'
|
315
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
316
|
+
Enabled: false
|
317
|
+
|
318
|
+
Style/RaiseArgs:
|
319
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
320
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
321
|
+
Enabled: false
|
322
|
+
|
323
|
+
Style/RegexpLiteral:
|
324
|
+
Description: 'Use / or %r around regular expressions.'
|
325
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
326
|
+
Enabled: false
|
327
|
+
|
328
|
+
Style/SelfAssignment:
|
329
|
+
Description: >-
|
330
|
+
Checks for places where self-assignment shorthand should have
|
331
|
+
been used.
|
332
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
333
|
+
Enabled: false
|
334
|
+
|
335
|
+
Style/SingleLineBlockParams:
|
336
|
+
Description: 'Enforces the names of some block params.'
|
337
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
338
|
+
Enabled: false
|
339
|
+
|
340
|
+
Style/SingleLineMethods:
|
341
|
+
Description: 'Avoid single-line methods.'
|
342
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
343
|
+
Enabled: false
|
344
|
+
|
345
|
+
Style/EmptyMethod:
|
346
|
+
Enabled: true
|
347
|
+
EnforcedStyle: expanded
|
348
|
+
|
349
|
+
Style/SignalException:
|
350
|
+
Description: 'Checks for proper usage of fail and raise.'
|
351
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
352
|
+
Enabled: false
|
353
|
+
|
354
|
+
Style/SpecialGlobalVars:
|
355
|
+
Description: 'Avoid Perl-style global variables.'
|
356
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
357
|
+
Enabled: false
|
358
|
+
|
359
|
+
Style/StringLiterals:
|
360
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
361
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
362
|
+
EnforcedStyle: double_quotes
|
363
|
+
Enabled: true
|
364
|
+
|
365
|
+
Style/TrailingCommaInArguments:
|
366
|
+
Description: 'Checks for trailing comma in argument lists.'
|
367
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
368
|
+
EnforcedStyleForMultiline: comma
|
369
|
+
SupportedStylesForMultiline:
|
370
|
+
- comma
|
371
|
+
- consistent_comma
|
372
|
+
- no_comma
|
373
|
+
Enabled: true
|
374
|
+
|
375
|
+
Style/TrailingCommaInLiteral:
|
376
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
377
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
378
|
+
EnforcedStyleForMultiline: comma
|
379
|
+
SupportedStylesForMultiline:
|
380
|
+
- comma
|
381
|
+
- consistent_comma
|
382
|
+
- no_comma
|
383
|
+
Enabled: true
|
384
|
+
|
385
|
+
Style/TrivialAccessors:
|
386
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
387
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
388
|
+
Enabled: false
|
389
|
+
|
390
|
+
Style/VariableInterpolation:
|
391
|
+
Description: >-
|
392
|
+
Don't interpolate global, instance and class variables
|
393
|
+
directly in strings.
|
394
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
395
|
+
Enabled: false
|
396
|
+
|
397
|
+
Style/WhenThen:
|
398
|
+
Description: 'Use when x then ... for one-line cases.'
|
399
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
400
|
+
Enabled: false
|
401
|
+
|
402
|
+
Style/WhileUntilModifier:
|
403
|
+
Description: >-
|
404
|
+
Favor modifier while/until usage when you have a
|
405
|
+
single-line body.
|
406
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
407
|
+
Enabled: false
|
408
|
+
|
409
|
+
Style/WordArray:
|
410
|
+
Description: 'Use %w or %W for arrays of words.'
|
411
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
412
|
+
Enabled: true
|
413
|
+
EnforcedStyle: brackets
|
414
|
+
|
415
|
+
Style/SymbolArray:
|
416
|
+
Enabled: true
|
417
|
+
EnforcedStyle: brackets
|
418
|
+
|
419
|
+
Style/AndOr:
|
420
|
+
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
421
|
+
# or completely (always).
|
422
|
+
EnforcedStyle: always
|
423
|
+
SupportedStyles:
|
424
|
+
- always
|
425
|
+
- conditionals
|
426
|
+
Exclude:
|
427
|
+
- 'app/controllers/**/*'
|
428
|
+
|
429
|
+
Style/RedundantBegin:
|
430
|
+
Enabled: false
|
431
|
+
|
432
|
+
# Layout
|
433
|
+
|
434
|
+
Layout/AlignParameters:
|
435
|
+
Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
|
436
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
437
|
+
Enabled: false
|
438
|
+
|
439
|
+
Layout/DotPosition:
|
440
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
441
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
442
|
+
EnforcedStyle: leading
|
443
|
+
|
444
|
+
Layout/ExtraSpacing:
|
445
|
+
Description: 'Do not use unnecessary spacing.'
|
446
|
+
Enabled: true
|
447
|
+
|
448
|
+
Layout/MultilineOperationIndentation:
|
449
|
+
Description: >-
|
450
|
+
Checks indentation of binary operations that span more than
|
451
|
+
one line.
|
452
|
+
Enabled: true
|
453
|
+
EnforcedStyle: indented
|
454
|
+
|
455
|
+
Layout/MultilineMethodCallIndentation:
|
456
|
+
Description: >-
|
457
|
+
Checks indentation of method calls with the dot operator
|
458
|
+
that span more than one line.
|
459
|
+
Enabled: true
|
460
|
+
EnforcedStyle: indented
|
461
|
+
|
462
|
+
Layout/InitialIndentation:
|
463
|
+
Description: >-
|
464
|
+
Checks the indentation of the first non-blank non-comment line in a file.
|
465
|
+
Enabled: false
|
466
|
+
|
467
|
+
# Lint
|
468
|
+
|
469
|
+
Lint/AmbiguousOperator:
|
470
|
+
Description: >-
|
471
|
+
Checks for ambiguous operators in the first argument of a
|
472
|
+
method invocation without parentheses.
|
473
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
474
|
+
Enabled: false
|
475
|
+
|
476
|
+
Lint/AmbiguousRegexpLiteral:
|
477
|
+
Description: >-
|
478
|
+
Checks for ambiguous regexp literals in the first argument of
|
479
|
+
a method invocation without parenthesis.
|
480
|
+
Enabled: false
|
481
|
+
|
482
|
+
Lint/AssignmentInCondition:
|
483
|
+
Description: "Don't use assignment in conditions."
|
484
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
485
|
+
Enabled: false
|
486
|
+
|
487
|
+
Lint/CircularArgumentReference:
|
488
|
+
Description: "Don't refer to the keyword argument in the default value."
|
489
|
+
Enabled: false
|
490
|
+
|
491
|
+
Lint/ConditionPosition:
|
492
|
+
Description: >-
|
493
|
+
Checks for condition placed in a confusing position relative to
|
494
|
+
the keyword.
|
495
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
496
|
+
Enabled: false
|
497
|
+
|
498
|
+
Lint/DeprecatedClassMethods:
|
499
|
+
Description: 'Check for deprecated class method calls.'
|
500
|
+
Enabled: false
|
501
|
+
|
502
|
+
Lint/DuplicatedKey:
|
503
|
+
Description: 'Check for duplicate keys in hash literals.'
|
504
|
+
Enabled: false
|
505
|
+
|
506
|
+
Lint/EachWithObjectArgument:
|
507
|
+
Description: 'Check for immutable argument given to each_with_object.'
|
508
|
+
Enabled: false
|
509
|
+
|
510
|
+
Lint/ElseLayout:
|
511
|
+
Description: 'Check for odd code arrangement in an else block.'
|
512
|
+
Enabled: false
|
513
|
+
|
514
|
+
Lint/FormatParameterMismatch:
|
515
|
+
Description: 'The number of parameters to format/sprint must match the fields.'
|
516
|
+
Enabled: false
|
517
|
+
|
518
|
+
Lint/HandleExceptions:
|
519
|
+
Description: "Don't suppress exception."
|
520
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
521
|
+
Enabled: false
|
522
|
+
|
523
|
+
Lint/LiteralInInterpolation:
|
524
|
+
Description: 'Checks for literals used in interpolation.'
|
525
|
+
Enabled: false
|
526
|
+
|
527
|
+
Lint/Loop:
|
528
|
+
Description: >-
|
529
|
+
Use Kernel#loop with break rather than begin/end/until or
|
530
|
+
begin/end/while for post-loop tests.
|
531
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
532
|
+
Enabled: false
|
533
|
+
|
534
|
+
Lint/NestedMethodDefinition:
|
535
|
+
Description: 'Do not use nested method definitions.'
|
536
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
|
537
|
+
Enabled: false
|
538
|
+
|
539
|
+
Lint/NonLocalExitFromIterator:
|
540
|
+
Description: 'Do not use return in iterator to cause non-local exit.'
|
541
|
+
Enabled: false
|
542
|
+
|
543
|
+
Lint/ParenthesesAsGroupedExpression:
|
544
|
+
Description: >-
|
545
|
+
Checks for method calls with a space before the opening
|
546
|
+
parenthesis.
|
547
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
548
|
+
Enabled: false
|
549
|
+
|
550
|
+
Lint/RequireParentheses:
|
551
|
+
Description: >-
|
552
|
+
Use parentheses in the method call to avoid confusion
|
553
|
+
about precedence.
|
554
|
+
Enabled: false
|
555
|
+
|
556
|
+
Lint/UnderscorePrefixedVariableName:
|
557
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
558
|
+
Enabled: false
|
559
|
+
|
560
|
+
Lint/UnneededDisable:
|
561
|
+
Description: >-
|
562
|
+
Checks for rubocop:disable comments that can be removed.
|
563
|
+
Note: this cop is not disabled when disabling all cops.
|
564
|
+
It must be explicitly disabled.
|
565
|
+
Enabled: false
|
566
|
+
|
567
|
+
Lint/Void:
|
568
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
569
|
+
Enabled: false
|
570
|
+
|
571
|
+
# Performance
|
572
|
+
|
573
|
+
Performance/CaseWhenSplat:
|
574
|
+
Description: >-
|
575
|
+
Place `when` conditions that use splat at the end
|
576
|
+
of the list of `when` branches.
|
577
|
+
Enabled: false
|
578
|
+
|
579
|
+
Performance/Count:
|
580
|
+
Description: >-
|
581
|
+
Use `count` instead of `select...size`, `reject...size`,
|
582
|
+
`select...count`, `reject...count`, `select...length`,
|
583
|
+
and `reject...length`.
|
584
|
+
Enabled: false
|
585
|
+
|
586
|
+
Performance/Detect:
|
587
|
+
Description: >-
|
588
|
+
Use `detect` instead of `select.first`, `find_all.first`,
|
589
|
+
`select.last`, and `find_all.last`.
|
590
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
591
|
+
Enabled: false
|
592
|
+
|
593
|
+
Performance/FlatMap:
|
594
|
+
Description: >-
|
595
|
+
Use `Enumerable#flat_map`
|
596
|
+
instead of `Enumerable#map...Array#flatten(1)`
|
597
|
+
or `Enumberable#collect..Array#flatten(1)`
|
598
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
599
|
+
Enabled: false
|
600
|
+
|
601
|
+
Performance/ReverseEach:
|
602
|
+
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
603
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
604
|
+
Enabled: false
|
605
|
+
|
606
|
+
Performance/Sample:
|
607
|
+
Description: >-
|
608
|
+
Use `sample` instead of `shuffle.first`,
|
609
|
+
`shuffle.last`, and `shuffle[Fixnum]`.
|
610
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
611
|
+
Enabled: false
|
612
|
+
|
613
|
+
Performance/Size:
|
614
|
+
Description: >-
|
615
|
+
Use `size` instead of `count` for counting
|
616
|
+
the number of elements in `Array` and `Hash`.
|
617
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
618
|
+
Enabled: false
|
619
|
+
|
620
|
+
Performance/StringReplacement:
|
621
|
+
Description: >-
|
622
|
+
Use `tr` instead of `gsub` when you are replacing the same
|
623
|
+
number of characters. Use `delete` instead of `gsub` when
|
624
|
+
you are deleting characters.
|
625
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
626
|
+
Enabled: false
|
627
|
+
|
628
|
+
# Rails
|
629
|
+
|
630
|
+
Rails/ActionFilter:
|
631
|
+
Description: 'Enforces consistent use of action filter methods.'
|
632
|
+
Enabled: false
|
633
|
+
|
634
|
+
Rails/Date:
|
635
|
+
Description: >-
|
636
|
+
Checks the correct usage of date aware methods,
|
637
|
+
such as Date.today, Date.current etc.
|
638
|
+
Enabled: false
|
639
|
+
|
640
|
+
Rails/FindBy:
|
641
|
+
Description: 'Prefer find_by over where.first.'
|
642
|
+
Enabled: false
|
643
|
+
|
644
|
+
Rails/FindEach:
|
645
|
+
Description: 'Prefer all.find_each over all.find.'
|
646
|
+
Enabled: false
|
647
|
+
|
648
|
+
Rails/HasAndBelongsToMany:
|
649
|
+
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
650
|
+
Enabled: false
|
651
|
+
|
652
|
+
Rails/Output:
|
653
|
+
Description: 'Checks for calls to puts, print, etc.'
|
654
|
+
Enabled: false
|
655
|
+
|
656
|
+
Rails/ReadWriteAttribute:
|
657
|
+
Description: >-
|
658
|
+
Checks for read_attribute(:attr) and
|
659
|
+
write_attribute(:attr, val).
|
660
|
+
Enabled: false
|
661
|
+
|
662
|
+
Rails/ScopeArgs:
|
663
|
+
Description: 'Checks the arguments of ActiveRecord scopes.'
|
664
|
+
Enabled: false
|
665
|
+
|
666
|
+
Rails/TimeZone:
|
667
|
+
Description: 'Checks the correct usage of time zone aware methods.'
|
668
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
|
669
|
+
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
670
|
+
Enabled: false
|
671
|
+
|
672
|
+
Rails/Validation:
|
673
|
+
Description: 'Use validates :attribute, hash of validations.'
|
674
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rake/testtask"
|
3
|
+
require "rubocop/rake_task"
|
3
4
|
|
4
|
-
|
5
|
+
RuboCop::RakeTask.new(:rubocop) do |t|
|
6
|
+
t.options = ["--display-cop-names"]
|
7
|
+
end
|
5
8
|
|
6
9
|
Rake::TestTask.new do |t|
|
7
|
-
t.libs <<
|
8
|
-
t.
|
10
|
+
t.libs << "test"
|
11
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
12
|
+
t.warning = false
|
9
13
|
end
|
14
|
+
|
15
|
+
task default: [:rubocop, :test]
|
@@ -11,14 +11,25 @@ module Procore
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def refresh(token:, refresh:)
|
14
|
-
|
15
|
-
|
14
|
+
begin
|
15
|
+
token = OAuth2::AccessToken.new(client, token, refresh_token: refresh)
|
16
|
+
new_token = token.refresh!
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
Procore::Auth::Token.new(
|
19
|
+
access_token: new_token.token,
|
20
|
+
refresh_token: new_token.refresh_token,
|
21
|
+
expires_at: new_token.expires_at,
|
22
|
+
)
|
23
|
+
rescue OAuth2::Error => e
|
24
|
+
raise OAuthError.new(e.description, response: e.response)
|
25
|
+
rescue Faraday::ConnectionFailed => e
|
26
|
+
raise APIConnectionError.new("Connection Error: #{e.message}")
|
27
|
+
rescue URI::BadURIError
|
28
|
+
raise OAuthError.new(
|
29
|
+
"Host is not a valid URI. Check your host option to make sure it " \
|
30
|
+
"is a properly formed url",
|
31
|
+
)
|
32
|
+
end
|
22
33
|
end
|
23
34
|
|
24
35
|
private
|
@@ -14,28 +14,27 @@ module Procore
|
|
14
14
|
@host = host
|
15
15
|
end
|
16
16
|
|
17
|
-
def refresh(
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
)
|
17
|
+
def refresh(*)
|
18
|
+
begin
|
19
|
+
new_token = client
|
20
|
+
.client_credentials
|
21
|
+
.get_token({}, auth_scheme: :request_body)
|
22
|
+
|
23
|
+
Procore::Auth::Token.new(
|
24
|
+
access_token: new_token.token,
|
25
|
+
refresh_token: new_token.refresh_token,
|
26
|
+
expires_at: new_token.expires_at,
|
27
|
+
)
|
28
|
+
rescue OAuth2::Error => e
|
29
|
+
raise OAuthError.new(e.description, response: e.response)
|
30
|
+
rescue Faraday::ConnectionFailed => e
|
31
|
+
raise APIConnectionError.new("Connection Error: #{e.message}")
|
32
|
+
rescue URI::BadURIError
|
33
|
+
raise OAuthError.new(
|
34
|
+
"Host is not a valid URI. Check your host option to make sure it " \
|
35
|
+
"is a properly formed url",
|
36
|
+
)
|
37
|
+
end
|
39
38
|
end
|
40
39
|
|
41
40
|
private
|
data/lib/procore/client.rb
CHANGED
@@ -55,7 +55,7 @@ module Procore
|
|
55
55
|
raise Procore::OAuthError.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
|
-
"before attempting to make API requests"
|
58
|
+
"before attempting to make API requests",
|
59
59
|
)
|
60
60
|
end
|
61
61
|
|
@@ -75,7 +75,7 @@ module Procore
|
|
75
75
|
"Unable to refresh the access token. Perhaps the Procore API is " \
|
76
76
|
"down or the your access token store is misconfigured. Either " \
|
77
77
|
"way, you should clear the store and prompt the user to sign in " \
|
78
|
-
"again."
|
78
|
+
"again.",
|
79
79
|
)
|
80
80
|
end
|
81
81
|
end
|
data/lib/procore/errors.rb
CHANGED
data/lib/procore/requestable.rb
CHANGED
@@ -22,7 +22,7 @@ module Procore
|
|
22
22
|
"API Request Initiated",
|
23
23
|
path: "#{base_api_path}/#{path}",
|
24
24
|
method: "GET",
|
25
|
-
query:
|
25
|
+
query: query.to_s,
|
26
26
|
)
|
27
27
|
|
28
28
|
with_response_handling do
|
@@ -50,7 +50,7 @@ module Procore
|
|
50
50
|
"API Request Initiated",
|
51
51
|
path: "#{base_api_path}/#{path}",
|
52
52
|
method: "POST",
|
53
|
-
body:
|
53
|
+
body: body.to_s,
|
54
54
|
)
|
55
55
|
|
56
56
|
with_response_handling do
|
@@ -77,7 +77,7 @@ module Procore
|
|
77
77
|
"API Request Initiated",
|
78
78
|
path: "#{base_api_path}/#{path}",
|
79
79
|
method: "PATCH",
|
80
|
-
body:
|
80
|
+
body: body.to_s,
|
81
81
|
)
|
82
82
|
|
83
83
|
with_response_handling do
|
@@ -97,12 +97,12 @@ module Procore
|
|
97
97
|
# client.delete("users/1")
|
98
98
|
#
|
99
99
|
# @return [Response]
|
100
|
-
def delete(path, query = {},
|
100
|
+
def delete(path, query = {}, _options = {})
|
101
101
|
Util.log_info(
|
102
102
|
"API Request Initiated",
|
103
103
|
path: "#{base_api_path}/#{path}",
|
104
104
|
method: "DELETE",
|
105
|
-
query:
|
105
|
+
query: query.to_s,
|
106
106
|
)
|
107
107
|
|
108
108
|
with_response_handling do
|
@@ -126,14 +126,14 @@ module Procore
|
|
126
126
|
rescue Timeout::Error, Errno::ECONNREFUSED => e
|
127
127
|
if retries <= Procore.configuration.max_retries
|
128
128
|
retries += 1
|
129
|
-
sleep 1.5
|
129
|
+
sleep 1.5**retries
|
130
130
|
retry
|
131
131
|
else
|
132
132
|
raise APIConnectionError.new(
|
133
133
|
"Cannot connect to the Procore API. Double check your timeout " \
|
134
134
|
"settings to ensure requests are not being cancelled before they " \
|
135
135
|
"can complete. Try setting the timeout and max_retries to larger " \
|
136
|
-
"values."
|
136
|
+
"values.",
|
137
137
|
), e
|
138
138
|
end
|
139
139
|
end
|
@@ -150,7 +150,7 @@ module Procore
|
|
150
150
|
Util.log_info(
|
151
151
|
"API Request Finished ",
|
152
152
|
path: result.request.path,
|
153
|
-
status:
|
153
|
+
status: result.code.to_s,
|
154
154
|
duration: "#{((Time.now - request_start_time) * 1000).round(0)}ms",
|
155
155
|
request_id: result.headers["x-request-id"],
|
156
156
|
)
|
@@ -158,10 +158,10 @@ module Procore
|
|
158
158
|
Util.log_error(
|
159
159
|
"API Request Failed",
|
160
160
|
path: result.request.path,
|
161
|
-
status:
|
161
|
+
status: result.code.to_s,
|
162
162
|
duration: "#{((Time.now - request_start_time) * 1000).round(0)}ms",
|
163
163
|
request_id: result.headers["x-request-id"],
|
164
|
-
retries: retries
|
164
|
+
retries: retries,
|
165
165
|
)
|
166
166
|
end
|
167
167
|
|
@@ -206,7 +206,7 @@ module Procore
|
|
206
206
|
"Accepts" => "application/json",
|
207
207
|
"Authorization" => "Bearer #{access_token}",
|
208
208
|
"Content-Type" => "application/json",
|
209
|
-
"User-Agent" => Procore.configuration.user_agent
|
209
|
+
"User-Agent" => Procore.configuration.user_agent,
|
210
210
|
}.tap do |headers|
|
211
211
|
if options[:idempotency_token]
|
212
212
|
headers["Idempotency-Token"] = options[:idempotency_token]
|
data/lib/procore/response.rb
CHANGED
@@ -37,7 +37,6 @@ module Procore
|
|
37
37
|
# last_page.pagination[:last]
|
38
38
|
# #=> nil
|
39
39
|
class Response
|
40
|
-
|
41
40
|
# @!attribute [r] headers
|
42
41
|
# @return [Hash<String, String>] Raw headers returned from Procore API.
|
43
42
|
# @!attribute [r] code
|
@@ -69,7 +68,7 @@ module Procore
|
|
69
68
|
end
|
70
69
|
|
71
70
|
def parse_pagination
|
72
|
-
headers["link"].to_s.split(", ").map(&:strip).
|
71
|
+
headers["link"].to_s.split(", ").map(&:strip).reduce({}) do |links, link|
|
73
72
|
url, name = link.match(/vapid\/(.*?)>; rel="(\w+)"/).captures
|
74
73
|
links.merge!(name.to_sym => url)
|
75
74
|
end
|
data/lib/procore/version.rb
CHANGED
data/procore.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
2
3
|
lib = File.expand_path("../lib", __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require "procore/version"
|
@@ -9,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
9
10
|
spec.authors = ["Procore Engineering"]
|
10
11
|
spec.email = ["opensource@procore.comm"]
|
11
12
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
13
|
+
spec.summary = "Procore Ruby Gem"
|
14
|
+
spec.description = "Procore Ruby Gem"
|
14
15
|
spec.homepage = "https://github.com/procore/ruby-sdk"
|
15
16
|
spec.license = "MIT"
|
16
17
|
|
@@ -29,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
29
30
|
spec.add_development_dependency "pry"
|
30
31
|
spec.add_development_dependency "rake"
|
31
32
|
spec.add_development_dependency "redis"
|
33
|
+
spec.add_development_dependency "rubocop"
|
32
34
|
spec.add_development_dependency "sqlite3"
|
33
35
|
spec.add_development_dependency "webmock"
|
34
36
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Procore Engineering
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: sqlite3
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,6 +200,7 @@ extensions: []
|
|
186
200
|
extra_rdoc_files: []
|
187
201
|
files:
|
188
202
|
- ".gitignore"
|
203
|
+
- ".rubocop.yml"
|
189
204
|
- ".travis.yml"
|
190
205
|
- CHANGELOG.md
|
191
206
|
- Gemfile
|