bigcommerce 1.0.0.beta → 1.0.1

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.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +115 -39
  3. data/bigcommerce.gemspec +12 -13
  4. data/lib/bigcommerce.rb +5 -34
  5. data/lib/bigcommerce/config.rb +14 -0
  6. data/lib/bigcommerce/connection.rb +26 -0
  7. data/lib/bigcommerce/exception.rb +25 -18
  8. data/lib/bigcommerce/request.rb +8 -9
  9. data/lib/bigcommerce/resource_actions.rb +11 -11
  10. data/lib/bigcommerce/resources/content/blog_post.rb +3 -5
  11. data/lib/bigcommerce/resources/content/blog_tag.rb +2 -3
  12. data/lib/bigcommerce/resources/content/redirect.rb +2 -2
  13. data/lib/bigcommerce/resources/customers/customer.rb +22 -2
  14. data/lib/bigcommerce/resources/customers/customer_address.rb +5 -5
  15. data/lib/bigcommerce/resources/customers/customer_group.rb +2 -2
  16. data/lib/bigcommerce/resources/geography/country.rb +4 -3
  17. data/lib/bigcommerce/resources/geography/state.rb +6 -5
  18. data/lib/bigcommerce/resources/marketing/banner.rb +21 -0
  19. data/lib/bigcommerce/resources/marketing/coupon.rb +2 -2
  20. data/lib/bigcommerce/resources/marketing/gift_certificates.rb +25 -0
  21. data/lib/bigcommerce/resources/orders/order.rb +46 -44
  22. data/lib/bigcommerce/resources/orders/order_coupon.rb +5 -5
  23. data/lib/bigcommerce/resources/orders/order_message.rb +8 -7
  24. data/lib/bigcommerce/resources/orders/order_product.rb +37 -36
  25. data/lib/bigcommerce/resources/orders/order_shipping_address.rb +24 -23
  26. data/lib/bigcommerce/resources/orders/order_status.rb +2 -1
  27. data/lib/bigcommerce/resources/orders/order_tax.rb +8 -7
  28. data/lib/bigcommerce/resources/orders/shipment.rb +11 -10
  29. data/lib/bigcommerce/resources/products/brand.rb +2 -2
  30. data/lib/bigcommerce/resources/products/bulk_pricing_rule.rb +6 -5
  31. data/lib/bigcommerce/resources/products/category.rb +2 -2
  32. data/lib/bigcommerce/resources/products/configurable_field.rb +6 -5
  33. data/lib/bigcommerce/resources/products/custom_field.rb +6 -5
  34. data/lib/bigcommerce/resources/products/google_product_search_mapping.rb +9 -8
  35. data/lib/bigcommerce/resources/products/option.rb +2 -2
  36. data/lib/bigcommerce/resources/products/option_set.rb +2 -2
  37. data/lib/bigcommerce/resources/products/option_set_option.rb +2 -1
  38. data/lib/bigcommerce/resources/products/option_value.rb +1 -0
  39. data/lib/bigcommerce/resources/products/product.rb +61 -61
  40. data/lib/bigcommerce/resources/products/product_image.rb +4 -4
  41. data/lib/bigcommerce/resources/products/product_option.rb +2 -1
  42. data/lib/bigcommerce/resources/products/product_review.rb +1 -5
  43. data/lib/bigcommerce/resources/products/product_rule.rb +4 -4
  44. data/lib/bigcommerce/resources/products/product_video.rb +4 -4
  45. data/lib/bigcommerce/resources/products/sku.rb +15 -9
  46. data/lib/bigcommerce/resources/shipping/shipping_method.rb +2 -1
  47. data/lib/bigcommerce/resources/store/store_information.rb +18 -14
  48. data/lib/bigcommerce/resources/system/time.rb +2 -2
  49. data/lib/bigcommerce/resources/tax/tax_class.rb +2 -1
  50. data/lib/bigcommerce/resources/webhooks/webhook.rb +2 -1
  51. data/lib/bigcommerce/subresource_actions.rb +14 -14
  52. data/lib/bigcommerce/version.rb +1 -1
  53. metadata +47 -166
  54. data/.gitignore +0 -17
  55. data/.rspec +0 -2
  56. data/.rubocop.yml +0 -620
  57. data/.travis.yml +0 -15
  58. data/CHANGELOG.md +0 -11
  59. data/CONTRIBUTING.md +0 -119
  60. data/DEPENDENCIES.md +0 -7
  61. data/Gemfile +0 -15
  62. data/Guardfile +0 -22
  63. data/LICENSE +0 -20
  64. data/RELEASING.md +0 -64
  65. data/Rakefile +0 -13
  66. data/examples/README.md +0 -148
  67. data/examples/configuration/legacy_auth.rb +0 -12
  68. data/examples/configuration/oauth.rb +0 -9
  69. data/examples/content/blog_post.rb +0 -39
  70. data/examples/content/blog_tag.rb +0 -10
  71. data/examples/content/redirect.rb +0 -43
  72. data/examples/customers/customer.rb +0 -36
  73. data/examples/customers/customer_address.rb +0 -50
  74. data/examples/customers/customer_group.rb +0 -35
  75. data/examples/exception_handling.rb +0 -50
  76. data/examples/geography/country.rb +0 -16
  77. data/examples/geography/state.rb +0 -19
  78. data/examples/marketing/coupon.rb +0 -44
  79. data/examples/orders/order.rb +0 -53
  80. data/examples/orders/order_coupon.rb +0 -17
  81. data/examples/orders/order_message.rb +0 -17
  82. data/examples/orders/order_product.rb +0 -23
  83. data/examples/orders/order_shipping_address.rb +0 -23
  84. data/examples/orders/order_status.rb +0 -15
  85. data/examples/orders/order_tax.rb +0 -17
  86. data/examples/orders/shipment.rb +0 -57
  87. data/examples/payments/payment_method.rb +0 -10
  88. data/examples/products/brand.rb +0 -36
  89. data/examples/products/bulk_pricing_rule.rb +0 -47
  90. data/examples/products/category.rb +0 -37
  91. data/examples/products/configurable_field.rb +0 -29
  92. data/examples/products/custom_field.rb +0 -44
  93. data/examples/products/google_product_search_mapping.rb +0 -12
  94. data/examples/products/option.rb +0 -37
  95. data/examples/products/option_set.rb +0 -35
  96. data/examples/products/option_set_option.rb +0 -50
  97. data/examples/products/option_value.rb +0 -43
  98. data/examples/products/product.rb +0 -44
  99. data/examples/products/product_image.rb +0 -42
  100. data/examples/products/product_option.rb +0 -17
  101. data/examples/products/product_review.rb +0 -12
  102. data/examples/products/product_rule.rb +0 -54
  103. data/examples/products/product_video.rb +0 -45
  104. data/examples/products/sku.rb +0 -48
  105. data/examples/shipping/shipping_method.rb +0 -13
  106. data/examples/store/store_info.rb +0 -10
  107. data/examples/system/time.rb +0 -10
  108. data/examples/tax/tax_class.rb +0 -13
  109. data/examples/webhooks/webhook.rb +0 -29
  110. data/spec/bigcommerce/bigcommerce_spec.rb +0 -76
  111. data/spec/bigcommerce/unit/actions_spec.rb +0 -151
  112. data/spec/bigcommerce/unit/exception_spec.rb +0 -53
  113. data/spec/bigcommerce/unit/middleware/auth_spec.rb +0 -18
  114. data/spec/bigcommerce/unit/middleware/http_exception_spec.rb +0 -40
  115. data/spec/bigcommerce/unit/request_spec.rb +0 -180
  116. data/spec/bigcommerce/unit/resources/content/blog_post_spec.rb +0 -12
  117. data/spec/bigcommerce/unit/resources/content/blog_tag_spec.rb +0 -12
  118. data/spec/bigcommerce/unit/resources/content/redirect_spec.rb +0 -12
  119. data/spec/bigcommerce/unit/resources/customers/customer_address_spec.rb +0 -21
  120. data/spec/bigcommerce/unit/resources/customers/customer_group_spec.rb +0 -12
  121. data/spec/bigcommerce/unit/resources/customers/customer_spec.rb +0 -12
  122. data/spec/bigcommerce/unit/resources/geography/country_spec.rb +0 -12
  123. data/spec/bigcommerce/unit/resources/geography/state_spec.rb +0 -21
  124. data/spec/bigcommerce/unit/resources/marketing/coupon_spec.rb +0 -12
  125. data/spec/bigcommerce/unit/resources/orders/order_product_spec.rb +0 -21
  126. data/spec/bigcommerce/unit/resources/orders/order_shipping_address_spec.rb +0 -21
  127. data/spec/bigcommerce/unit/resources/orders/order_spec.rb +0 -13
  128. data/spec/bigcommerce/unit/resources/orders/shipment_spec.rb +0 -21
  129. data/spec/bigcommerce/unit/resources/payments/payment_method_spec.rb +0 -23
  130. data/spec/bigcommerce/unit/resources/products/brand_spec.rb +0 -12
  131. data/spec/bigcommerce/unit/resources/products/bulk_pricing_rule_spec.rb +0 -21
  132. data/spec/bigcommerce/unit/resources/products/category_spec.rb +0 -12
  133. data/spec/bigcommerce/unit/resources/products/configurable_field_spec.rb +0 -21
  134. data/spec/bigcommerce/unit/resources/products/custom_field_spec.rb +0 -21
  135. data/spec/bigcommerce/unit/resources/products/google_product_search_mapping_spec.rb +0 -14
  136. data/spec/bigcommerce/unit/resources/products/option_set_spec.rb +0 -12
  137. data/spec/bigcommerce/unit/resources/products/option_spec.rb +0 -12
  138. data/spec/bigcommerce/unit/resources/products/product_image_spec.rb +0 -21
  139. data/spec/bigcommerce/unit/resources/products/product_review_spec.rb +0 -14
  140. data/spec/bigcommerce/unit/resources/products/product_rule_spec.rb +0 -21
  141. data/spec/bigcommerce/unit/resources/products/product_spec.rb +0 -13
  142. data/spec/bigcommerce/unit/resources/products/product_video_spec.rb +0 -21
  143. data/spec/bigcommerce/unit/resources/products/sku_spec.rb +0 -21
  144. data/spec/bigcommerce/unit/resources/resource_spec.rb +0 -4
  145. data/spec/bigcommerce/unit/resources/store_info/store_information_spec.rb +0 -12
  146. data/spec/bigcommerce/unit/resources/system/time_spec.rb +0 -12
  147. data/spec/bigcommerce/unit/version_spec.rb +0 -7
  148. data/spec/spec_helper.rb +0 -11
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .DS_Store
4
- .bundle
5
- .rvmrc
6
- .ruby-version
7
- .yardoc
8
- .rake_tasks~
9
- Gemfile.lock
10
- coverage/*
11
- doc/*
12
- log/*
13
- pkg/*
14
- .idea/*
15
- tmp/*
16
- .env
17
- .env-*
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --colour
2
- --format=documentation
@@ -1,620 +0,0 @@
1
- # This is the default configuration file. Enabling and disabling is configured
2
- # in separate files. This file adds all other parameters apart from Enabled.
3
-
4
- # Common configuration.
5
- AllCops:
6
- # Include gemspec and Rakefile
7
- Include:
8
- - '**/*.gemspec'
9
- - '**/*.podspec'
10
- - '**/*.jbuilder'
11
- - '**/*.rake'
12
- - '**/*.opal'
13
- - '**/Gemfile'
14
- - '**/Rakefile'
15
- - '**/Capfile'
16
- - '**/Guardfile'
17
- - '**/Podfile'
18
- - '**/Thorfile'
19
- - '**/Vagrantfile'
20
- - '**/Berksfile'
21
- - '**/Cheffile'
22
- - '**/Vagabondfile'
23
- Exclude:
24
- - 'vendor/**/*'
25
- - 'spec/**/*'
26
- # By default, the rails cops are not run. Override in project or home
27
- # directory .rubocop.yml files, or by giving the -R/--rails option.
28
- RunRailsCops: false
29
- # Cop names are not displayed in offense messages by default. Change behavior
30
- # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
31
- # option.
32
- DisplayCopNames: false
33
- # Additional cops that do not reference a style guide rule may be enabled by
34
- # default. Change behavior by overriding StyleGuideCopsOnly, or by giving
35
- # the --only-guide-cops option.
36
- StyleGuideCopsOnly: false
37
-
38
- # Indent private/protected/public as deep as method definitions
39
- Style/Documentation:
40
- Enabled: false
41
-
42
- Style/AccessModifierIndentation:
43
- EnforcedStyle: indent
44
- SupportedStyles:
45
- - outdent
46
- - indent
47
-
48
- # Align the elements of a hash literal if they span more than one line.
49
- Style/AlignHash:
50
- # Alignment of entries using hash rocket as separator. Valid values are:
51
- #
52
- # key - left alignment of keys
53
- # 'a' => 2
54
- # 'bb' => 3
55
- # separator - alignment of hash rockets, keys are right aligned
56
- # 'a' => 2
57
- # 'bb' => 3
58
- # table - left alignment of keys, hash rockets, and values
59
- # 'a' => 2
60
- # 'bb' => 3
61
- EnforcedHashRocketStyle: key
62
- # Alignment of entries using colon as separator. Valid values are:
63
- #
64
- # key - left alignment of keys
65
- # a: 0
66
- # bb: 1
67
- # separator - alignment of colons, keys are right aligned
68
- # a: 0
69
- # bb: 1
70
- # table - left alignment of keys and values
71
- # a: 0
72
- # bb: 1
73
- EnforcedColonStyle: key
74
- # Select whether hashes that are the last argument in a method call should be
75
- # inspected? Valid values are:
76
- #
77
- # always_inspect - Inspect both implicit and explicit hashes.
78
- # Registers an offense for:
79
- # function(a: 1,
80
- # b: 2)
81
- # Registers an offense for:
82
- # function({a: 1,
83
- # b: 2})
84
- # always_ignore - Ignore both implicit and explicit hashes.
85
- # Accepts:
86
- # function(a: 1,
87
- # b: 2)
88
- # Accepts:
89
- # function({a: 1,
90
- # b: 2})
91
- # ignore_implicit - Ignore only implicit hashes.
92
- # Accepts:
93
- # function(a: 1,
94
- # b: 2)
95
- # Registers an offense for:
96
- # function({a: 1,
97
- # b: 2})
98
- # ignore_explicit - Ignore only explicit hashes.
99
- # Accepts:
100
- # function({a: 1,
101
- # b: 2})
102
- # Registers an offense for:
103
- # function(a: 1,
104
- # b: 2)
105
- EnforcedLastArgumentHashStyle: always_inspect
106
- SupportedLastArgumentHashStyles:
107
- - always_inspect
108
- - always_ignore
109
- - ignore_implicit
110
- - ignore_explicit
111
-
112
- Style/AlignParameters:
113
- # Alignment of parameters in multi-line method calls.
114
- #
115
- # The `with_first_parameter` style aligns the following lines along the same
116
- # column as the first parameter.
117
- #
118
- # method_call(a,
119
- # b)
120
- #
121
- # The `with_fixed_indentation` style aligns the following lines with one
122
- # level of indentation relative to the start of the line with the method call.
123
- #
124
- # method_call(a,
125
- # b)
126
- EnforcedStyle: with_first_parameter
127
- SupportedStyles:
128
- - with_first_parameter
129
- - with_fixed_indentation
130
-
131
- Style/AndOr:
132
- # Whether `and` and `or` are banned only in conditionals (conditionals)
133
- # or completely (always).
134
- EnforcedStyle: always
135
- SupportedStyles:
136
- - always
137
- - conditionals
138
-
139
-
140
- # Checks if usage of %() or %Q() matches configuration.
141
- Style/BarePercentLiterals:
142
- EnforcedStyle: bare_percent
143
- SupportedStyles:
144
- - percent_q
145
- - bare_percent
146
-
147
- Style/BracesAroundHashParameters:
148
- EnforcedStyle: no_braces
149
- SupportedStyles:
150
- # The `braces` style enforces braces around all method parameters that are
151
- # hashes.
152
- - braces
153
- # The `no_braces` style checks that the last parameter doesn't have braces
154
- # around it.
155
- - no_braces
156
- # The `context_dependent` style checks that the last parameter doesn't have
157
- # braces around it, but requires braces if the second to last parameter is
158
- # also a hash literal.
159
- - context_dependent
160
-
161
- # Indentation of `when`.
162
- Style/CaseIndentation:
163
- IndentWhenRelativeTo: case
164
-
165
- Style/ClassAndModuleChildren:
166
- # Checks the style of children definitions at classes and modules.
167
- #
168
- # Basically there are two different styles:
169
- #
170
- # `nested` - have each child on a separate line
171
- # class Foo
172
- # class Bar
173
- # end
174
- # end
175
- #
176
- # `compact` - combine definitions as much as possible
177
- # class Foo::Bar
178
- # end
179
- #
180
- # The compact style is only forced, for classes / modules with one child.
181
- EnforcedStyle: nested
182
- SupportedStyles:
183
- - nested
184
- - compact
185
-
186
- Style/ClassCheck:
187
- EnforcedStyle: is_a?
188
- SupportedStyles:
189
- - is_a?
190
- - kind_of?
191
-
192
- # Align with the style guide.
193
- Style/CollectionMethods:
194
- # Mapping from undesired method to desired_method
195
- # e.g. to use `detect` over `find`:
196
- #
197
- # CollectionMethods:
198
- # PreferredMethods:
199
- # find: detect
200
- PreferredMethods:
201
- collect: 'map'
202
- collect!: 'map!'
203
- inject: 'reduce'
204
- detect: 'find'
205
- find_all: 'select'
206
-
207
- # Checks formatting of special comments
208
- Style/CommentAnnotation:
209
- Keywords:
210
- - TODO
211
- - FIXME
212
- - OPTIMIZE
213
- - HACK
214
- - REVIEW
215
-
216
- # Multi-line method chaining should be done with leading dots.
217
- Style/DotPosition:
218
- EnforcedStyle: leading
219
- SupportedStyles:
220
- - leading
221
- - trailing
222
-
223
- # Use empty lines between defs.
224
- Style/EmptyLineBetweenDefs:
225
- # If true, this parameter means that single line method definitions don't
226
- # need an empty line between them.
227
- AllowAdjacentOneLineDefs: false
228
-
229
- Style/EmptyLinesAroundBlockBody:
230
- EnforcedStyle: no_empty_lines
231
- SupportedStyles:
232
- - empty_lines
233
- - no_empty_lines
234
-
235
- Style/EmptyLinesAroundClassBody:
236
- EnforcedStyle: no_empty_lines
237
- SupportedStyles:
238
- - empty_lines
239
- - no_empty_lines
240
-
241
- Style/EmptyLinesAroundModuleBody:
242
- EnforcedStyle: no_empty_lines
243
- SupportedStyles:
244
- - empty_lines
245
- - no_empty_lines
246
-
247
- Style/FileName:
248
- # File names listed in AllCops:Include are excluded by default. Add extra
249
- # excludes here.
250
- Exclude: []
251
-
252
- Style/FirstParameterIndentation:
253
- EnforcedStyle: special_for_inner_method_call_in_parentheses
254
- SupportedStyles:
255
- # The first parameter should always be indented one step more than the
256
- # preceding line.
257
- - consistent
258
- # The first parameter should normally be indented one step more than the
259
- # preceding line, but if it's a parameter for a method call that is itself
260
- # a parameter in a method call, then the inner parameter should be indented
261
- # relative to the inner method.
262
- - special_for_inner_method_call
263
- # Same as special_for_inner_method_call except that the special rule only
264
- # applies if the outer method call encloses its arguments in parentheses.
265
- - special_for_inner_method_call_in_parentheses
266
-
267
- # Checks use of for or each in multiline loops.
268
- Style/For:
269
- EnforcedStyle: each
270
- SupportedStyles:
271
- - for
272
- - each
273
-
274
- # Enforce the method used for string formatting.
275
- Style/FormatString:
276
- EnforcedStyle: format
277
- SupportedStyles:
278
- - format
279
- - sprintf
280
- - percent
281
-
282
- # Built-in global variables are allowed by default.
283
- Style/GlobalVars:
284
- AllowedVariables: []
285
-
286
- # `MinBodyLength` defines the number of lines of the a body of an if / unless
287
- # needs to have to trigger this cop
288
- Style/GuardClause:
289
- MinBodyLength: 1
290
-
291
- Style/HashSyntax:
292
- EnforcedStyle: ruby19
293
- SupportedStyles:
294
- - ruby19
295
- - ruby19_no_mixed_keys
296
- - hash_rockets
297
-
298
- Style/IfUnlessModifier:
299
- MaxLineLength: 90
300
-
301
- Style/IndentationWidth:
302
- # Number of spaces for each indentation level.
303
- Width: 2
304
-
305
- # Checks the indentation of the first key in a hash literal.
306
- Style/IndentHash:
307
- # The value `special_inside_parentheses` means that hash literals with braces
308
- # that have their opening brace on the same line as a surrounding opening
309
- # round parenthesis, shall have their first key indented relative to the
310
- # first position inside the parenthesis.
311
- # The value `consistent` means that the indentation of the first key shall
312
- # always be relative to the first position of the line where the opening
313
- # brace is.
314
- EnforcedStyle: special_inside_parentheses
315
- SupportedStyles:
316
- - special_inside_parentheses
317
- - consistent
318
-
319
- Style/LambdaCall:
320
- EnforcedStyle: call
321
- SupportedStyles:
322
- - call
323
- - braces
324
-
325
- Style/Next:
326
- # With `always` all conditions at the end of an iteration needs to be
327
- # replaced by next - with `skip_modifier_ifs` the modifier if like this one
328
- # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
329
- EnforcedStyle: skip_modifier_ifs
330
- # `MinBodyLength` defines the number of lines of the a body of an if / unless
331
- # needs to have to trigger this cop
332
- MinBodyLength: 3
333
- SupportedStyles:
334
- - skip_modifier_ifs
335
- - always
336
-
337
- Style/NonNilCheck:
338
- # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
339
- # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
340
- # **usually** OK, but might change behavior.
341
- #
342
- # With `IncludeSemanticChanges` set to `false`, this cop does not report
343
- # offenses for `!x.nil?` and does no changes that might change behavior.
344
- IncludeSemanticChanges: false
345
-
346
- Style/MethodDefParentheses:
347
- EnforcedStyle: require_parentheses
348
- SupportedStyles:
349
- - require_parentheses
350
- - require_no_parentheses
351
-
352
- Style/MethodName:
353
- EnforcedStyle: snake_case
354
- SupportedStyles:
355
- - snake_case
356
- - camelCase
357
-
358
- Style/MultilineOperationIndentation:
359
- EnforcedStyle: aligned
360
- SupportedStyles:
361
- - aligned
362
- - indented
363
-
364
- Style/NumericLiterals:
365
- MinDigits: 5
366
-
367
- # Allow safe assignment in conditions.
368
- Style/ParenthesesAroundCondition:
369
- AllowSafeAssignment: true
370
-
371
- Style/PercentLiteralDelimiters:
372
- PreferredDelimiters:
373
- '%': ()
374
- '%i': ()
375
- '%q': ()
376
- '%Q': ()
377
- '%r': '{}'
378
- '%s': ()
379
- '%w': ()
380
- '%W': ()
381
- '%x': ()
382
-
383
- Style/PercentQLiterals:
384
- EnforcedStyle: lower_case_q
385
- SupportedStyles:
386
- - lower_case_q # Use %q when possible, %Q when necessary
387
- - upper_case_q # Always use %Q
388
-
389
- Style/PredicateName:
390
- # Predicate name prefices.
391
- NamePrefix:
392
- - is_
393
- - has_
394
- - have_
395
- # Predicate name prefices that should be removed.
396
- NamePrefixBlacklist:
397
- - is_
398
- - has_
399
- - have_
400
-
401
- Style/RaiseArgs:
402
- EnforcedStyle: exploded
403
- SupportedStyles:
404
- - compact # raise Exception.new(msg)
405
- - exploded # raise Exception, msg
406
-
407
- Style/RedundantReturn:
408
- # When true allows code like `return x, y`.
409
- AllowMultipleReturnValues: false
410
-
411
- Style/RegexpLiteral:
412
- # The maximum number of (escaped) slashes that a slash-delimited regexp is
413
- # allowed to have. If there are more slashes, a %r regexp shall be used.
414
- MaxSlashes: 1
415
-
416
- Style/Semicolon:
417
- # Allow ; to separate several expressions on the same line.
418
- AllowAsExpressionSeparator: false
419
-
420
- Style/SignalException:
421
- EnforcedStyle: semantic
422
- SupportedStyles:
423
- - only_raise
424
- - only_fail
425
- - semantic
426
-
427
- Style/SingleLineBlockParams:
428
- Methods:
429
- - reduce:
430
- - a
431
- - e
432
- - inject:
433
- - a
434
- - e
435
-
436
- Style/SingleLineMethods:
437
- AllowIfMethodIsEmpty: true
438
-
439
- Style/StringLiterals:
440
- EnforcedStyle: single_quotes
441
- SupportedStyles:
442
- - single_quotes
443
- - double_quotes
444
-
445
- Style/StringLiteralsInInterpolation:
446
- EnforcedStyle: single_quotes
447
- SupportedStyles:
448
- - single_quotes
449
- - double_quotes
450
-
451
- Style/SpaceAroundBlockParameters:
452
- EnforcedStyleInsidePipes: no_space
453
- SupportedStyles:
454
- - space
455
- - no_space
456
-
457
- Style/SpaceAroundEqualsInParameterDefault:
458
- EnforcedStyle: space
459
- SupportedStyles:
460
- - space
461
- - no_space
462
-
463
- Style/SpaceBeforeBlockBraces:
464
- EnforcedStyle: space
465
- SupportedStyles:
466
- - space
467
- - no_space
468
-
469
- Style/SpaceInsideBlockBraces:
470
- EnforcedStyle: space
471
- SupportedStyles:
472
- - space
473
- - no_space
474
- # Valid values are: space, no_space
475
- EnforcedStyleForEmptyBraces: no_space
476
- # Space between { and |. Overrides EnforcedStyle if there is a conflict.
477
- SpaceBeforeBlockParameters: true
478
-
479
- Style/SpaceInsideHashLiteralBraces:
480
- EnforcedStyle: space
481
- EnforcedStyleForEmptyBraces: no_space
482
- SupportedStyles:
483
- - space
484
- - no_space
485
-
486
- Style/SymbolProc:
487
- # A list of method names to be ignored by the check.
488
- # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
489
- IgnoredMethods:
490
- - respond_to
491
-
492
- Style/TrailingBlankLines:
493
- EnforcedStyle: final_newline
494
- SupportedStyles:
495
- - final_newline
496
- - final_blank_line
497
-
498
- Style/TrailingComma:
499
- # If EnforcedStyleForMultiline is comma, the cop requires a comma after the
500
- # last item of a list, but only for lists where each item is on its own line.
501
- # If EnforcedStyleForMultiline is consistent_comma, the cop requires a comma
502
- # after the last item of a list, for all lists.
503
- EnforcedStyleForMultiline: no_comma
504
- SupportedStyles:
505
- - comma
506
- - consistent_comma
507
- - no_comma
508
-
509
- # TrivialAccessors doesn't require exact name matches and doesn't allow
510
- # predicated methods by default.
511
- Style/TrivialAccessors:
512
- ExactNameMatch: false
513
- AllowPredicates: false
514
- # Allows trivial writers that don't end in an equal sign. e.g.
515
- #
516
- # def on_exception(action)
517
- # @on_exception=action
518
- # end
519
- # on_exception :restart
520
- #
521
- # Commonly used in DSLs
522
- AllowDSLWriters: false
523
- Whitelist:
524
- - to_ary
525
- - to_a
526
- - to_c
527
- - to_enum
528
- - to_h
529
- - to_hash
530
- - to_i
531
- - to_int
532
- - to_io
533
- - to_open
534
- - to_path
535
- - to_proc
536
- - to_r
537
- - to_regexp
538
- - to_str
539
- - to_s
540
- - to_sym
541
-
542
- Style/VariableName:
543
- EnforcedStyle: snake_case
544
- SupportedStyles:
545
- - snake_case
546
- - camelCase
547
-
548
- Style/WhileUntilModifier:
549
- MaxLineLength: 90
550
-
551
- Style/WordArray:
552
- MinSize: 0
553
- # The regular expression WordRegex decides what is considered a word.
554
- WordRegex: !ruby/regexp '/\A[\p{Word}]+\z/'
555
-
556
- ##################### Metrics ##################################
557
-
558
- Metrics/AbcSize:
559
- # The ABC size is a calculated magnitude, so this number can be a Fixnum or
560
- # a Float.
561
- Max: 20
562
-
563
- Metrics/BlockNesting:
564
- Max: 3
565
-
566
- Metrics/ClassLength:
567
- CountComments: false # count full line comments?
568
- Max: 100
569
-
570
- # Avoid complex methods.
571
- Metrics/CyclomaticComplexity:
572
- Max: 6
573
-
574
- Metrics/LineLength:
575
- Max: 90
576
- # To make it possible to copy or click on URIs in the code, we allow lines
577
- # contaning a URI to be longer than Max.
578
- AllowURI: true
579
- URISchemes:
580
- - http
581
- - https
582
-
583
- Metrics/MethodLength:
584
- CountComments: false # count full line comments?
585
- Max: 15
586
-
587
- Metrics/ParameterLists:
588
- Max: 5
589
- CountKeywordArgs: true
590
-
591
- Metrics/PerceivedComplexity:
592
- Max: 7
593
-
594
- ##################### Lint ##################################
595
-
596
- # Allow safe assignment in conditions.
597
- Lint/AssignmentInCondition:
598
- AllowSafeAssignment: true
599
-
600
- # Align ends correctly.
601
- Lint/EndAlignment:
602
- # The value `keyword` means that `end` should be aligned with the matching
603
- # keyword (if, while, etc.).
604
- # The value `variable` means that in assignments, `end` should be aligned
605
- # with the start of the variable on the left hand side of `=`. In all other
606
- # situations, `end` should still be aligned with the keyword.
607
- AlignWith: keyword
608
- SupportedStyles:
609
- - keyword
610
- - variable
611
-
612
- Lint/DefEndAlignment:
613
- # The value `def` means that `end` should be aligned with the def keyword.
614
- # The value `start_of_line` means that `end` should be aligned with method
615
- # calls like `private`, `public`, etc, if present in front of the `def`
616
- # keyword on the same line.
617
- AlignWith: start_of_line
618
- SupportedStyles:
619
- - start_of_line
620
- - def