moip2 0.1.4 → 1.0.0

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 (99) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +644 -0
  3. data/.travis.yml +14 -3
  4. data/CONTRIBUTING.md +42 -0
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +25 -6
  7. data/Guardfile +1 -2
  8. data/README.md +373 -74
  9. data/Rakefile +2 -2
  10. data/changelog.md +36 -0
  11. data/lib/moip2/accounts_api.rb +27 -0
  12. data/lib/moip2/api.rb +25 -2
  13. data/lib/moip2/auth/basic.rb +2 -5
  14. data/lib/moip2/auth/oauth.rb +0 -3
  15. data/lib/moip2/client.rb +45 -31
  16. data/lib/moip2/connect_api.rb +41 -0
  17. data/lib/moip2/customer_api.rb +16 -2
  18. data/lib/moip2/exceptions/invalid_enviroment_error.rb +0 -2
  19. data/lib/moip2/invoice_api.rb +8 -3
  20. data/lib/moip2/keys_api.rb +14 -14
  21. data/lib/moip2/multi_order_api.rb +1 -3
  22. data/lib/moip2/multi_payment_api.rb +1 -1
  23. data/lib/moip2/notifications_api.rb +33 -0
  24. data/lib/moip2/order_api.rb +18 -3
  25. data/lib/moip2/payment_api.rb +11 -1
  26. data/lib/moip2/refund_api.rb +5 -4
  27. data/lib/moip2/resource/account.rb +12 -0
  28. data/lib/moip2/resource/connect.rb +9 -0
  29. data/lib/moip2/resource/credit_card.rb +12 -0
  30. data/lib/moip2/resource/customer.rb +0 -4
  31. data/lib/moip2/resource/invoice.rb +0 -2
  32. data/lib/moip2/resource/keys.rb +1 -3
  33. data/lib/moip2/resource/multi_order.rb +2 -6
  34. data/lib/moip2/resource/multi_payment.rb +1 -3
  35. data/lib/moip2/resource/notification.rb +12 -0
  36. data/lib/moip2/resource/order.rb +0 -4
  37. data/lib/moip2/resource/payment.rb +0 -4
  38. data/lib/moip2/resource/refund.rb +1 -2
  39. data/lib/moip2/resource/webhooks.rb +11 -13
  40. data/lib/moip2/response.rb +7 -7
  41. data/lib/moip2/util/filters_encoder.rb +28 -0
  42. data/lib/moip2/version.rb +1 -1
  43. data/lib/moip2/webhooks_api.rb +16 -16
  44. data/lib/moip2.rb +10 -5
  45. data/moip2.gemspec +21 -7
  46. data/spec/moip2/accounts_api_spec.rb +189 -0
  47. data/spec/moip2/api_spec.rb +22 -4
  48. data/spec/moip2/auth/basic_spec.rb +8 -4
  49. data/spec/moip2/auth/oauth_spec.rb +4 -4
  50. data/spec/moip2/client_spec.rb +20 -27
  51. data/spec/moip2/connect_api_spec.rb +68 -0
  52. data/spec/moip2/customer_api_spec.rb +147 -72
  53. data/spec/moip2/invoice_spec.rb +51 -32
  54. data/spec/moip2/keys_spec.rb +16 -18
  55. data/spec/moip2/multi_order_api_spec.rb +99 -108
  56. data/spec/moip2/multi_payment_api_spec.rb +8 -11
  57. data/spec/moip2/notifications_api_spec.rb +104 -0
  58. data/spec/moip2/order_api_spec.rb +100 -20
  59. data/spec/moip2/payment_api_spec.rb +77 -17
  60. data/spec/moip2/refund_api_spec.rb +2 -4
  61. data/spec/moip2/resource/order_spec.rb +24 -28
  62. data/spec/moip2/response_spec.rb +0 -8
  63. data/spec/moip2/webhooks_spec.rb +18 -21
  64. data/spec/moip2_spec.rb +6 -13
  65. data/spec/spec_helper.rb +24 -10
  66. data/vcr_cassettes/_create_invoice.yml +42 -0
  67. data/vcr_cassettes/_get_invoice.yml +41 -0
  68. data/vcr_cassettes/account_doesnt_exist.yml +44 -0
  69. data/vcr_cassettes/account_exists.yml +46 -0
  70. data/vcr_cassettes/accounts_show_existent.yml +50 -0
  71. data/vcr_cassettes/accounts_show_nonexistent.yml +42 -0
  72. data/vcr_cassettes/cancel_payment.yml +43 -0
  73. data/vcr_cassettes/capture_payment.yml +42 -0
  74. data/vcr_cassettes/create_account_success_company.yml +87 -0
  75. data/vcr_cassettes/create_account_success_standalone.yml +74 -0
  76. data/vcr_cassettes/create_credit_card_customer.yml +41 -0
  77. data/vcr_cassettes/create_invoice.yml +10 -16
  78. data/vcr_cassettes/create_notification.yml +38 -0
  79. data/vcr_cassettes/create_notification_app.yml +38 -0
  80. data/vcr_cassettes/delete_credit_card_customer.yml +40 -0
  81. data/vcr_cassettes/delete_nonexistent_credit_card_customer.yml +40 -0
  82. data/vcr_cassettes/delete_nonexistent_notification.yml +40 -0
  83. data/vcr_cassettes/delete_notification.yml +36 -0
  84. data/vcr_cassettes/find_all_orders_filters.yml +56 -0
  85. data/vcr_cassettes/find_all_orders_limit.yml +48 -0
  86. data/vcr_cassettes/find_all_orders_multi_filters.yml +57 -0
  87. data/vcr_cassettes/find_all_orders_no_filter.yml +56 -0
  88. data/vcr_cassettes/generate_oauth_token.yml +42 -0
  89. data/vcr_cassettes/get_invoice.yml +10 -15
  90. data/vcr_cassettes/get_keys.yml +1 -1
  91. data/vcr_cassettes/get_notification.yml +38 -0
  92. data/vcr_cassettes/get_notifications_list.yml +38 -0
  93. data/vcr_cassettes/get_payment.yml +42 -0
  94. data/vcr_cassettes/get_payment_not_found.yml +40 -0
  95. data/vcr_cassettes/get_webhooks.yml +1 -1
  96. data/vcr_cassettes/list_invoices.yml +2 -2
  97. data/vcr_cassettes/refresh_oauth_token.yml +40 -0
  98. data/vcr_cassettes/update_invoice.yml +1 -1
  99. metadata +69 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16b0237e494bc1f124a86d4e56f7618bad9fefdd
4
- data.tar.gz: 1e34ba91258214bf60fa8489c20d9677bb2895f3
3
+ metadata.gz: 015adab12411ead291fe058fd03c731acec47181
4
+ data.tar.gz: cee1090c633e11fb965d57be09ff0f6970c33cf7
5
5
  SHA512:
6
- metadata.gz: edd670b8f65b0945cbf33cd338640924e342aeada8581e7938e15b99cceaa1b7dc64ded2c6896dc98464dfd96f117eafe7128d17919981f970fe0fe6fbb557e6
7
- data.tar.gz: 5a7458ba9a797d9bfe8331eaef4d6b3e0d7ce7bb92c0ae78c824393ef31d7139510bc336e3ac2b7e0534a097c99a0fdbc7e713533832ffc502607469646f9101
6
+ metadata.gz: 63ec3ecf7c8493d551fd136bd34c461a8722d60d6b291cda2f7d2df05894f553de8e35a3dc3c8fe70532f581ef10252f35357cae4030b6e74537eae36302faa9
7
+ data.tar.gz: 73844787d62a4904870d36729665522ee0c9055b97fd3110be7568ee6f6cb13bc79e5d2ec31098fd3f7417448ab2acd2584be8e27403ea49069505fd67e89018
data/.rubocop.yml ADDED
@@ -0,0 +1,644 @@
1
+ # Adapted from Thoughtbot's recommended config (https://github.com/thoughtbot/guides/blob/master/style/ruby/.rubocop.yml)
2
+
3
+ Style/AccessorMethodName:
4
+ Description: Check the naming of accessor methods for get_/set_.
5
+ Enabled: false
6
+
7
+ Style/Alias:
8
+ Description: 'Use alias_method instead of alias.'
9
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
10
+ Enabled: false
11
+
12
+ Style/ArrayJoin:
13
+ Description: 'Use Array#join instead of Array#*.'
14
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
15
+ Enabled: false
16
+
17
+ Style/AsciiComments:
18
+ Description: 'Use only ascii symbols in comments.'
19
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
20
+ Enabled: false
21
+
22
+ Style/AsciiIdentifiers:
23
+ Description: 'Use only ascii symbols in identifiers.'
24
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
25
+ Enabled: false
26
+
27
+ Style/Attr:
28
+ Description: 'Checks for uses of Module#attr.'
29
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
30
+ Enabled: false
31
+
32
+ Metrics/BlockNesting:
33
+ Description: 'Avoid excessive block nesting'
34
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
35
+ Enabled: false
36
+
37
+ Style/CaseEquality:
38
+ Description: 'Avoid explicit use of the case equality operator(===).'
39
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
40
+ Enabled: false
41
+
42
+ Style/CharacterLiteral:
43
+ Description: 'Checks for uses of character literals.'
44
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
45
+ Enabled: false
46
+
47
+ Style/ClassAndModuleChildren:
48
+ Description: 'Checks style of children classes and modules.'
49
+ Enabled: true
50
+ EnforcedStyle: nested
51
+
52
+ Metrics/ClassLength:
53
+ Description: 'Avoid classes longer than 100 lines of code.'
54
+ Enabled: false
55
+
56
+ Metrics/ModuleLength:
57
+ Description: 'Avoid modules longer than 100 lines of code.'
58
+ Enabled: false
59
+
60
+ Style/ClassVars:
61
+ Description: 'Avoid the use of class variables.'
62
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
63
+ Enabled: false
64
+
65
+ Style/CollectionMethods:
66
+ Enabled: true
67
+ PreferredMethods:
68
+ find: detect
69
+ inject: reduce
70
+ collect: map
71
+ find_all: select
72
+
73
+ Style/ColonMethodCall:
74
+ Description: 'Do not use :: for method call.'
75
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
76
+ Enabled: false
77
+
78
+ Style/CommentAnnotation:
79
+ Description: >-
80
+ Checks formatting of special comments
81
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
82
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
83
+ Enabled: false
84
+
85
+ Metrics/AbcSize:
86
+ Description: >-
87
+ A calculated magnitude based on number of assignments,
88
+ branches, and conditions.
89
+ Enabled: false
90
+
91
+ Metrics/BlockLength:
92
+ CountComments: true # count full line comments?
93
+ Max: 25
94
+ ExcludedMethods: []
95
+ Exclude:
96
+ - "spec/**/*"
97
+
98
+ Metrics/CyclomaticComplexity:
99
+ Description: >-
100
+ A complexity metric that is strongly correlated to the number
101
+ of test cases needed to validate a method.
102
+ Enabled: false
103
+
104
+ Rails/Delegate:
105
+ Description: 'Prefer delegate method for delegations.'
106
+ Enabled: false
107
+
108
+ Style/PreferredHashMethods:
109
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
110
+ StyleGuide: '#hash-key'
111
+ Enabled: false
112
+
113
+ Style/Documentation:
114
+ Description: 'Document classes and non-namespace modules.'
115
+ Enabled: false
116
+
117
+ Style/DoubleNegation:
118
+ Description: 'Checks for uses of double negation (!!).'
119
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
120
+ Enabled: false
121
+
122
+ Style/EachWithObject:
123
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
124
+ Enabled: false
125
+
126
+ Style/EmptyLiteral:
127
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
128
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
129
+ Enabled: false
130
+
131
+ # Checks whether the source file has a utf-8 encoding comment or not
132
+ # AutoCorrectEncodingComment must match the regex
133
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
134
+ Style/Encoding:
135
+ Enabled: false
136
+
137
+ Style/EvenOdd:
138
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
139
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
140
+ Enabled: false
141
+
142
+ Style/FileName:
143
+ Description: 'Use snake_case for source file names.'
144
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
145
+ Enabled: false
146
+
147
+ Style/FrozenStringLiteralComment:
148
+ Description: >-
149
+ Add the frozen_string_literal comment to the top of files
150
+ to help transition from Ruby 2.3.0 to Ruby 3.0.
151
+ Enabled: false
152
+
153
+ Style/FlipFlop:
154
+ Description: 'Checks for flip flops'
155
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
156
+ Enabled: false
157
+
158
+ Style/FormatString:
159
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
160
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
161
+ Enabled: false
162
+
163
+ Style/GlobalVars:
164
+ Description: 'Do not introduce global variables.'
165
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
166
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
167
+ Enabled: false
168
+
169
+ Style/GuardClause:
170
+ Description: 'Check for conditionals that can be replaced with guard clauses'
171
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
172
+ Enabled: false
173
+
174
+ Style/IfUnlessModifier:
175
+ Description: >-
176
+ Favor modifier if/unless usage when you have a
177
+ single-line body.
178
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
179
+ Enabled: false
180
+
181
+ Style/IfWithSemicolon:
182
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
183
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
184
+ Enabled: false
185
+
186
+ Style/InlineComment:
187
+ Description: 'Avoid inline comments.'
188
+ Enabled: false
189
+
190
+ Style/Lambda:
191
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
192
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
193
+ Enabled: false
194
+
195
+ Style/LambdaCall:
196
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
197
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
198
+ Enabled: false
199
+
200
+ Style/LineEndConcatenation:
201
+ Description: >-
202
+ Use \ instead of + or << to concatenate two string literals at
203
+ line end.
204
+ Enabled: false
205
+
206
+ Metrics/LineLength:
207
+ Description: 'Limit lines to 100 characters.'
208
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
209
+ Max: 100
210
+
211
+ Metrics/MethodLength:
212
+ Description: 'Avoid methods longer than 10 lines of code.'
213
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
214
+ Enabled: false
215
+
216
+ Style/ModuleFunction:
217
+ Description: 'Checks for usage of `extend self` in modules.'
218
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
219
+ Enabled: false
220
+
221
+ Style/MultilineBlockChain:
222
+ Description: 'Avoid multi-line chains of blocks.'
223
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
224
+ Enabled: false
225
+
226
+ Style/NegatedIf:
227
+ Description: >-
228
+ Favor unless over if for negative conditions
229
+ (or control flow or).
230
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
231
+ Enabled: false
232
+
233
+ Style/NegatedWhile:
234
+ Description: 'Favor until over while for negative conditions.'
235
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
236
+ Enabled: false
237
+
238
+ Style/Next:
239
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
240
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
241
+ Enabled: false
242
+
243
+ Style/NilComparison:
244
+ Description: 'Prefer x.nil? to x == nil.'
245
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
246
+ Enabled: false
247
+
248
+ Style/Not:
249
+ Description: 'Use ! instead of not.'
250
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
251
+ Enabled: false
252
+
253
+ Style/NumericLiterals:
254
+ Description: >-
255
+ Add underscores to large numeric literals to improve their
256
+ readability.
257
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
258
+ Enabled: false
259
+
260
+ Style/OneLineConditional:
261
+ Description: >-
262
+ Favor the ternary operator(?:) over
263
+ if/then/else/end constructs.
264
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
265
+ Enabled: false
266
+
267
+ Style/OpMethod:
268
+ Description: 'When defining binary operators, name the argument other.'
269
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
270
+ Enabled: false
271
+
272
+ Metrics/ParameterLists:
273
+ Description: 'Avoid parameter lists longer than three or four parameters.'
274
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
275
+ Enabled: false
276
+
277
+ Style/PercentLiteralDelimiters:
278
+ Description: 'Use `%`-literal delimiters consistently'
279
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
280
+ Enabled: false
281
+
282
+ Style/PerlBackrefs:
283
+ Description: 'Avoid Perl-style regex back references.'
284
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
285
+ Enabled: false
286
+
287
+ Style/PredicateName:
288
+ Description: 'Check the names of predicate methods.'
289
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
290
+ NamePrefixBlacklist:
291
+ - is_
292
+ Exclude:
293
+ - spec/**/*
294
+
295
+ Style/Proc:
296
+ Description: 'Use proc instead of Proc.new.'
297
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
298
+ Enabled: false
299
+
300
+ Style/RaiseArgs:
301
+ Description: 'Checks the arguments passed to raise/fail.'
302
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
303
+ Enabled: false
304
+
305
+ Style/RegexpLiteral:
306
+ Description: 'Use / or %r around regular expressions.'
307
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
308
+ Enabled: false
309
+
310
+ Style/SelfAssignment:
311
+ Description: >-
312
+ Checks for places where self-assignment shorthand should have
313
+ been used.
314
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
315
+ Enabled: false
316
+
317
+ Style/SingleLineBlockParams:
318
+ Description: 'Enforces the names of some block params.'
319
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
320
+ Enabled: false
321
+
322
+ Style/SingleLineMethods:
323
+ Description: 'Avoid single-line methods.'
324
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
325
+ Enabled: false
326
+
327
+ Style/SignalException:
328
+ Description: 'Checks for proper usage of fail and raise.'
329
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
330
+ Enabled: false
331
+
332
+ Style/SpecialGlobalVars:
333
+ Description: 'Avoid Perl-style global variables.'
334
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
335
+ Enabled: false
336
+
337
+ Style/StringLiterals:
338
+ Description: 'Checks if uses of quotes match the configured preference.'
339
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
340
+ EnforcedStyle: double_quotes
341
+ Enabled: true
342
+
343
+ Style/TrailingCommaInArguments:
344
+ Description: 'Checks for trailing comma in argument lists.'
345
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
346
+ EnforcedStyleForMultiline: comma
347
+ SupportedStylesForMultiline:
348
+ - comma
349
+ - consistent_comma
350
+ - no_comma
351
+ Enabled: true
352
+
353
+ Style/TrailingCommaInLiteral:
354
+ Description: 'Checks for trailing comma in array and hash literals.'
355
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
356
+ EnforcedStyleForMultiline: comma
357
+ SupportedStylesForMultiline:
358
+ - comma
359
+ - consistent_comma
360
+ - no_comma
361
+ Enabled: true
362
+
363
+ Style/TrivialAccessors:
364
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
365
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
366
+ Enabled: false
367
+
368
+ Style/VariableInterpolation:
369
+ Description: >-
370
+ Don't interpolate global, instance and class variables
371
+ directly in strings.
372
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
373
+ Enabled: false
374
+
375
+ Style/WhenThen:
376
+ Description: 'Use when x then ... for one-line cases.'
377
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
378
+ Enabled: false
379
+
380
+ Style/WhileUntilModifier:
381
+ Description: >-
382
+ Favor modifier while/until usage when you have a
383
+ single-line body.
384
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
385
+ Enabled: false
386
+
387
+ Style/WordArray:
388
+ Description: 'Use %w or %W for arrays of words.'
389
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
390
+ Enabled: false
391
+
392
+ # Layout
393
+
394
+ Layout/AlignParameters:
395
+ Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
396
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
397
+ Enabled: false
398
+
399
+ Layout/DotPosition:
400
+ Description: 'Checks the position of the dot in multi-line method calls.'
401
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
402
+ EnforcedStyle: trailing
403
+
404
+ Layout/ExtraSpacing:
405
+ Description: 'Do not use unnecessary spacing.'
406
+ Enabled: true
407
+
408
+ Layout/MultilineOperationIndentation:
409
+ Description: >-
410
+ Checks indentation of binary operations that span more than
411
+ one line.
412
+ Enabled: true
413
+ EnforcedStyle: indented
414
+
415
+ Layout/MultilineMethodCallIndentation:
416
+ Description: >-
417
+ Checks indentation of method calls with the dot operator
418
+ that span more than one line.
419
+ Enabled: true
420
+ EnforcedStyle: indented
421
+
422
+ Layout/InitialIndentation:
423
+ Description: >-
424
+ Checks the indentation of the first non-blank non-comment line in a file.
425
+ Enabled: false
426
+
427
+ # Lint
428
+
429
+ Lint/AmbiguousOperator:
430
+ Description: >-
431
+ Checks for ambiguous operators in the first argument of a
432
+ method invocation without parentheses.
433
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
434
+ Enabled: false
435
+
436
+ Lint/AmbiguousRegexpLiteral:
437
+ Description: >-
438
+ Checks for ambiguous regexp literals in the first argument of
439
+ a method invocation without parenthesis.
440
+ Enabled: false
441
+
442
+ Lint/AssignmentInCondition:
443
+ Description: "Don't use assignment in conditions."
444
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
445
+ Enabled: false
446
+
447
+ Lint/CircularArgumentReference:
448
+ Description: "Don't refer to the keyword argument in the default value."
449
+ Enabled: false
450
+
451
+ Lint/ConditionPosition:
452
+ Description: >-
453
+ Checks for condition placed in a confusing position relative to
454
+ the keyword.
455
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
456
+ Enabled: false
457
+
458
+ Lint/DeprecatedClassMethods:
459
+ Description: 'Check for deprecated class method calls.'
460
+ Enabled: false
461
+
462
+ Lint/DuplicatedKey:
463
+ Description: 'Check for duplicate keys in hash literals.'
464
+ Enabled: false
465
+
466
+ Lint/EachWithObjectArgument:
467
+ Description: 'Check for immutable argument given to each_with_object.'
468
+ Enabled: false
469
+
470
+ Lint/ElseLayout:
471
+ Description: 'Check for odd code arrangement in an else block.'
472
+ Enabled: false
473
+
474
+ Lint/FormatParameterMismatch:
475
+ Description: 'The number of parameters to format/sprint must match the fields.'
476
+ Enabled: false
477
+
478
+ Lint/HandleExceptions:
479
+ Description: "Don't suppress exception."
480
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
481
+ Enabled: false
482
+
483
+ Lint/InvalidCharacterLiteral:
484
+ Description: >-
485
+ Checks for invalid character literals with a non-escaped
486
+ whitespace character.
487
+ Enabled: false
488
+
489
+ Lint/LiteralInCondition:
490
+ Description: 'Checks of literals used in conditions.'
491
+ Enabled: false
492
+
493
+ Lint/LiteralInInterpolation:
494
+ Description: 'Checks for literals used in interpolation.'
495
+ Enabled: false
496
+
497
+ Lint/Loop:
498
+ Description: >-
499
+ Use Kernel#loop with break rather than begin/end/until or
500
+ begin/end/while for post-loop tests.
501
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
502
+ Enabled: false
503
+
504
+ Lint/NestedMethodDefinition:
505
+ Description: 'Do not use nested method definitions.'
506
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
507
+ Enabled: false
508
+
509
+ Lint/NonLocalExitFromIterator:
510
+ Description: 'Do not use return in iterator to cause non-local exit.'
511
+ Enabled: false
512
+
513
+ Lint/ParenthesesAsGroupedExpression:
514
+ Description: >-
515
+ Checks for method calls with a space before the opening
516
+ parenthesis.
517
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
518
+ Enabled: false
519
+
520
+ Lint/RequireParentheses:
521
+ Description: >-
522
+ Use parentheses in the method call to avoid confusion
523
+ about precedence.
524
+ Enabled: false
525
+
526
+ Lint/UnderscorePrefixedVariableName:
527
+ Description: 'Do not use prefix `_` for a variable that is used.'
528
+ Enabled: false
529
+
530
+ Lint/UnneededDisable:
531
+ Description: >-
532
+ Checks for rubocop:disable comments that can be removed.
533
+ Note: this cop is not disabled when disabling all cops.
534
+ It must be explicitly disabled.
535
+ Enabled: false
536
+
537
+ Lint/Void:
538
+ Description: 'Possible use of operator/literal/variable in void context.'
539
+ Enabled: false
540
+
541
+ # Performance
542
+
543
+ Performance/CaseWhenSplat:
544
+ Description: >-
545
+ Place `when` conditions that use splat at the end
546
+ of the list of `when` branches.
547
+ Enabled: false
548
+
549
+ Performance/Count:
550
+ Description: >-
551
+ Use `count` instead of `select...size`, `reject...size`,
552
+ `select...count`, `reject...count`, `select...length`,
553
+ and `reject...length`.
554
+ Enabled: false
555
+
556
+ Performance/Detect:
557
+ Description: >-
558
+ Use `detect` instead of `select.first`, `find_all.first`,
559
+ `select.last`, and `find_all.last`.
560
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
561
+ Enabled: false
562
+
563
+ Performance/FlatMap:
564
+ Description: >-
565
+ Use `Enumerable#flat_map`
566
+ instead of `Enumerable#map...Array#flatten(1)`
567
+ or `Enumberable#collect..Array#flatten(1)`
568
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
569
+ Enabled: false
570
+
571
+ Performance/ReverseEach:
572
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
573
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
574
+ Enabled: false
575
+
576
+ Performance/Sample:
577
+ Description: >-
578
+ Use `sample` instead of `shuffle.first`,
579
+ `shuffle.last`, and `shuffle[Fixnum]`.
580
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
581
+ Enabled: false
582
+
583
+ Performance/Size:
584
+ Description: >-
585
+ Use `size` instead of `count` for counting
586
+ the number of elements in `Array` and `Hash`.
587
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
588
+ Enabled: false
589
+
590
+ Performance/StringReplacement:
591
+ Description: >-
592
+ Use `tr` instead of `gsub` when you are replacing the same
593
+ number of characters. Use `delete` instead of `gsub` when
594
+ you are deleting characters.
595
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
596
+ Enabled: false
597
+
598
+ # Rails
599
+
600
+ Rails/ActionFilter:
601
+ Description: 'Enforces consistent use of action filter methods.'
602
+ Enabled: false
603
+
604
+ Rails/Date:
605
+ Description: >-
606
+ Checks the correct usage of date aware methods,
607
+ such as Date.today, Date.current etc.
608
+ Enabled: false
609
+
610
+ Rails/FindBy:
611
+ Description: 'Prefer find_by over where.first.'
612
+ Enabled: false
613
+
614
+ Rails/FindEach:
615
+ Description: 'Prefer all.find_each over all.find.'
616
+ Enabled: false
617
+
618
+ Rails/HasAndBelongsToMany:
619
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
620
+ Enabled: false
621
+
622
+ Rails/Output:
623
+ Description: 'Checks for calls to puts, print, etc.'
624
+ Enabled: false
625
+
626
+ Rails/ReadWriteAttribute:
627
+ Description: >-
628
+ Checks for read_attribute(:attr) and
629
+ write_attribute(:attr, val).
630
+ Enabled: false
631
+
632
+ Rails/ScopeArgs:
633
+ Description: 'Checks the arguments of ActiveRecord scopes.'
634
+ Enabled: false
635
+
636
+ Rails/TimeZone:
637
+ Description: 'Checks the correct usage of time zone aware methods.'
638
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
639
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
640
+ Enabled: false
641
+
642
+ Rails/Validation:
643
+ Description: 'Use validates :attribute, hash of validations.'
644
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,5 +1,16 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2
4
- - 2.1
5
- - 2.0.0
3
+ - 2.2
4
+ - 2.1
5
+ - 2.0.0
6
+ before_install:
7
+ - gem update bundler
8
+ bundler_args: --no-deployment
9
+ deploy:
10
+ provider: rubygems
11
+ api_key:
12
+ secure: tGQRV+41CkKVpG+SUnGAYayQ8Uxd3EgZhVDCVRu8CzQMe7yvjkeOOdBpQviRoWAl+H+ThX/i3yE/zegeK4bv6biURj86PU2KzINGukVkqt+EoVqj9BDi4EKJgGUosNuGVuLiio58Pns2rvxndYN+czIKRu7GDJgNxWWGe3a11ekHDLgnecikqsZZRxX0GM+9lkZfQ2KhVqpBYEnVgAdT7w6QTdm91TW6/BDJxg1LTIt7X6qH++HJGmF6WdnPtPXKnucrYLZIfSSGqlB5q/8YtOwg6pxoTOtfsvM4afzDmxdUL8bA6qgvWU6qwIiH4iHP+cdBuuat4UdNNt4uds1t/y3cMdUU5EbQSldKB/zn+adTGYfb/WvS455jwS/RkRqn5AOPyySKclwBewOaZvrK7feR6OIIHEm1RR7s/nYLCa7YIZRyxuZ9C4QxPh2zRy+cnf9FhDi2gbgTcWd66E4xR26yPSnhNBpWXm6BLZB2ozvGO7CHZuNsWyAVJUcDGffSWq+rMlY+3mBwG3xwKxxYwpe8axBlDE7R6i7FwxYdoLWJixKoI7PS4jfx5SsHznYszzz4P4q6X8cx7HV3ahLas7eMuoxutsIsapnPqzsV8FTpHmfGL9tRO1d90IOWQ/92zUMCnOhWGZdB+63DOpZuvvgScVgs5UkdOjgRUFx+tZ4=
13
+ gem: moip2
14
+ on:
15
+ tags: true
16
+ repo: moip/moip-sdk-ruby