bank_api 0.5.1 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3242dbf95fcc8324a10205abe1ff6eb703c8e744
4
- data.tar.gz: 40f51eb01898627f73549b0ad699ef1a794e6058
2
+ SHA256:
3
+ metadata.gz: 5470f8a6efd79fb2a6c682f8bb1f20377b8da9717a8d142ec69e6585aabebb4f
4
+ data.tar.gz: c1db9695592d8f0e7f0c72fcd2eebf749295f6ff0d4b93c9621fef4b9ef2e203
5
5
  SHA512:
6
- metadata.gz: 8274e7540abe44a0471409c0d58327af86342a1eace4b9272f95480ec627e3382e01ba0c374d18d49fc198b4df96bb49bcbe9b7284a3920da1b4f076e39eaaa2
7
- data.tar.gz: 67341222e54018dd58ead169f743599948ec9a07e70771d8dfb3082833191141ff79910251a061fce605e909825c3e154e7fa871a6f6502f361084ced97909b6
6
+ metadata.gz: ff3ff90e99eff53acdaf34cecc01770c9019c85a87f5642ffb3a4a053a45c14adedbeccb5334a01cc00f44cb01fb904e36695fa37cc39616fd4c51b79023df33
7
+ data.tar.gz: 9e8c48bbb270a0b62ffad7b4a6482f15e7c2549dfb4f4060d3de141b6b55bc7e261e4c372701e6f72a4a8e9d223a4d8746b983c9ce5dbd2639e8e12138d79513
data/.gitignore CHANGED
@@ -9,3 +9,8 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ # rvm
13
+ .ruby-gemset
14
+ # vscode
15
+ settings.json
16
+ test.rb
data/.rubocop.yml ADDED
@@ -0,0 +1,1027 @@
1
+ AllCops:
2
+ Include:
3
+ - "**/*.rake"
4
+ - "**/Gemfile"
5
+ - "**/Rakefile"
6
+ Exclude:
7
+ - "vendor/**/*"
8
+ - "db/**/*"
9
+ - "bin/**/*"
10
+ DisplayCopNames: false
11
+ StyleGuideCopsOnly: false
12
+ TargetRubyVersion: 2.3
13
+ Layout/AccessModifierIndentation:
14
+ Description: Check indentation of private/protected visibility modifiers.
15
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
16
+ Enabled: true
17
+ EnforcedStyle: indent
18
+ SupportedStyles:
19
+ - outdent
20
+ - indent
21
+ Layout/AlignHash:
22
+ Description: Align the elements of a hash literal if they span more than one line.
23
+ Enabled: true
24
+ EnforcedHashRocketStyle: key
25
+ EnforcedColonStyle: key
26
+ EnforcedLastArgumentHashStyle: always_inspect
27
+ SupportedLastArgumentHashStyles:
28
+ - always_inspect
29
+ - always_ignore
30
+ - ignore_implicit
31
+ - ignore_explicit
32
+ Layout/AlignParameters:
33
+ Description: Align the parameters of a method call if they span more than one line.
34
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
35
+ Enabled: true
36
+ EnforcedStyle: with_fixed_indentation
37
+ SupportedStyles:
38
+ - with_first_parameter
39
+ - with_fixed_indentation
40
+ Style/AndOr:
41
+ Description: Use &&/|| instead of and/or.
42
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
43
+ Enabled: true
44
+ EnforcedStyle: always
45
+ SupportedStyles:
46
+ - always
47
+ - conditionals
48
+ Style/BarePercentLiterals:
49
+ Description: Checks if usage of %() or %Q() matches configuration.
50
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
51
+ Enabled: true
52
+ EnforcedStyle: bare_percent
53
+ SupportedStyles:
54
+ - percent_q
55
+ - bare_percent
56
+ Metrics/BlockLength:
57
+ Enabled: false
58
+ Style/BracesAroundHashParameters:
59
+ Description: Enforce braces style around hash parameters.
60
+ Enabled: true
61
+ EnforcedStyle: no_braces
62
+ SupportedStyles:
63
+ - braces
64
+ - no_braces
65
+ - context_dependent
66
+ Layout/CaseIndentation:
67
+ Description: Indentation of when in a case/when/[else/]end.
68
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
69
+ Enabled: true
70
+ EnforcedStyle: case
71
+ SupportedStyles:
72
+ - case
73
+ - end
74
+ IndentOneStep: false
75
+ Style/ClassAndModuleChildren:
76
+ Description: Checks style of children classes and modules.
77
+ Enabled: false
78
+ EnforcedStyle: nested
79
+ SupportedStyles:
80
+ - nested
81
+ - compact
82
+ Style/ClassCheck:
83
+ Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
84
+ Enabled: true
85
+ EnforcedStyle: is_a?
86
+ SupportedStyles:
87
+ - is_a?
88
+ - kind_of?
89
+ Style/CollectionMethods:
90
+ Description: Preferred collection methods.
91
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
92
+ Enabled: false
93
+ PreferredMethods:
94
+ collect: map
95
+ collect!: map!
96
+ inject: reduce
97
+ detect: find
98
+ find_all: select
99
+ find: detect
100
+ Style/CommentAnnotation:
101
+ Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
102
+ REVIEW).
103
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
104
+ Enabled: false
105
+ Keywords:
106
+ - TODO
107
+ - FIXME
108
+ - OPTIMIZE
109
+ - HACK
110
+ - REVIEW
111
+ Layout/DotPosition:
112
+ Description: Checks the position of the dot in multi-line method calls.
113
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
114
+ Enabled: true
115
+ EnforcedStyle: leading
116
+ SupportedStyles:
117
+ - leading
118
+ - trailing
119
+ Layout/EmptyLineBetweenDefs:
120
+ Description: Use empty lines between defs.
121
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
122
+ Enabled: true
123
+ AllowAdjacentOneLineDefs: false
124
+ Layout/EmptyLinesAroundBlockBody:
125
+ Description: Keeps track of empty lines around block bodies.
126
+ Enabled: true
127
+ EnforcedStyle: no_empty_lines
128
+ SupportedStyles:
129
+ - empty_lines
130
+ - no_empty_lines
131
+ Layout/EmptyLinesAroundClassBody:
132
+ Description: Keeps track of empty lines around class bodies.
133
+ Enabled: true
134
+ EnforcedStyle: no_empty_lines
135
+ SupportedStyles:
136
+ - empty_lines
137
+ - no_empty_lines
138
+ Layout/EmptyLinesAroundModuleBody:
139
+ Description: Keeps track of empty lines around module bodies.
140
+ Enabled: true
141
+ EnforcedStyle: no_empty_lines
142
+ SupportedStyles:
143
+ - empty_lines
144
+ - no_empty_lines
145
+ Style/Encoding:
146
+ Description: Use UTF-8 as the source file encoding.
147
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8
148
+ Enabled: false
149
+ Naming/FileName:
150
+ Description: Use snake_case for source file names.
151
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
152
+ Enabled: false
153
+ Exclude: []
154
+ Layout/FirstParameterIndentation:
155
+ Description: Checks the indentation of the first parameter in a method call.
156
+ Enabled: true
157
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
158
+ SupportedStyles:
159
+ - consistent
160
+ - special_for_inner_method_call
161
+ - special_for_inner_method_call_in_parentheses
162
+ Style/For:
163
+ Description: Checks use of for or each in multiline loops.
164
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
165
+ Enabled: true
166
+ EnforcedStyle: each
167
+ SupportedStyles:
168
+ - for
169
+ - each
170
+ Style/FormatString:
171
+ Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
172
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
173
+ Enabled: false
174
+ EnforcedStyle: format
175
+ SupportedStyles:
176
+ - format
177
+ - sprintf
178
+ - percent
179
+ Style/FrozenStringLiteralComment:
180
+ Enabled: false
181
+ Style/GlobalVars:
182
+ Description: Do not introduce global variables.
183
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
184
+ Enabled: false
185
+ AllowedVariables: []
186
+ Style/GuardClause:
187
+ Description: Check for conditionals that can be replaced with guard clauses
188
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
189
+ Enabled: false
190
+ MinBodyLength: 1
191
+ Style/HashSyntax:
192
+ Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a =>
193
+ 1, :b => 2 }.'
194
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
195
+ Enabled: true
196
+ EnforcedStyle: ruby19
197
+ SupportedStyles:
198
+ - ruby19
199
+ - hash_rockets
200
+ Style/IfUnlessModifier:
201
+ Description: Favor modifier if/unless usage when you have a single-line body.
202
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
203
+ Enabled: false
204
+ Layout/IndentationWidth:
205
+ Description: Use 2 spaces for indentation.
206
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
207
+ Enabled: true
208
+ Width: 2
209
+ Layout/IndentHash:
210
+ Description: Checks the indentation of the first key in a hash literal.
211
+ Enabled: true
212
+ EnforcedStyle: special_inside_parentheses
213
+ SupportedStyles:
214
+ - special_inside_parentheses
215
+ - consistent
216
+ Style/LambdaCall:
217
+ Description: Use lambda.call(...) instead of lambda.(...).
218
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
219
+ Enabled: false
220
+ EnforcedStyle: call
221
+ SupportedStyles:
222
+ - call
223
+ - braces
224
+ Style/Next:
225
+ Description: Use `next` to skip iteration instead of a condition at the end.
226
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
227
+ Enabled: false
228
+ EnforcedStyle: skip_modifier_ifs
229
+ MinBodyLength: 3
230
+ SupportedStyles:
231
+ - skip_modifier_ifs
232
+ - always
233
+ Style/NonNilCheck:
234
+ Description: Checks for redundant nil checks.
235
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks
236
+ Enabled: true
237
+ IncludeSemanticChanges: false
238
+ Style/MethodDefParentheses:
239
+ Description: Checks if the method definitions have or don't have parentheses.
240
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
241
+ Enabled: true
242
+ EnforcedStyle: require_parentheses
243
+ SupportedStyles:
244
+ - require_parentheses
245
+ - require_no_parentheses
246
+ Naming/MethodName:
247
+ Description: Use the configured style when naming methods.
248
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
249
+ Enabled: true
250
+ EnforcedStyle: snake_case
251
+ SupportedStyles:
252
+ - snake_case
253
+ - camelCase
254
+ Layout/MultilineOperationIndentation:
255
+ Description: Checks indentation of binary operations that span more than one line.
256
+ Enabled: true
257
+ EnforcedStyle: indented
258
+ SupportedStyles:
259
+ - aligned
260
+ - indented
261
+ Style/MutableConstant:
262
+ Description: Do not assign mutable objects to constants.
263
+ Enabled: false
264
+ Style/NumericLiterals:
265
+ Description: Add underscores to large numeric literals to improve their readability.
266
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
267
+ Enabled: false
268
+ MinDigits: 5
269
+ Style/ParenthesesAroundCondition:
270
+ Description: Don't use parentheses around the condition of an if/unless/while.
271
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if
272
+ Enabled: true
273
+ AllowSafeAssignment: true
274
+ Style/PercentLiteralDelimiters:
275
+ Description: Use `%`-literal delimiters consistently
276
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
277
+ Enabled: false
278
+ PreferredDelimiters:
279
+ "%": "()"
280
+ "%i": "()"
281
+ "%q": "()"
282
+ "%Q": "()"
283
+ "%r": "{}"
284
+ "%s": "()"
285
+ "%w": "()"
286
+ "%W": "()"
287
+ "%x": "()"
288
+ Style/PercentQLiterals:
289
+ Description: Checks if uses of %Q/%q match the configured preference.
290
+ Enabled: true
291
+ EnforcedStyle: lower_case_q
292
+ SupportedStyles:
293
+ - lower_case_q
294
+ - upper_case_q
295
+ Naming/PredicateName:
296
+ Description: Check the names of predicate methods.
297
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
298
+ Enabled: true
299
+ NamePrefix:
300
+ - is_
301
+ - has_
302
+ - have_
303
+ NamePrefixBlacklist:
304
+ - is_
305
+ Style/RaiseArgs:
306
+ Description: Checks the arguments passed to raise/fail.
307
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
308
+ Enabled: false
309
+ EnforcedStyle: exploded
310
+ SupportedStyles:
311
+ - compact
312
+ - exploded
313
+ Style/RedundantReturn:
314
+ Description: Don't use return where it's not required.
315
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
316
+ Enabled: true
317
+ AllowMultipleReturnValues: false
318
+ Style/Semicolon:
319
+ Description: Don't use semicolons to terminate expressions.
320
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
321
+ Enabled: true
322
+ AllowAsExpressionSeparator: false
323
+ Style/SignalException:
324
+ Description: Checks for proper usage of fail and raise.
325
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
326
+ Enabled: false
327
+ EnforcedStyle: semantic
328
+ SupportedStyles:
329
+ - only_raise
330
+ - only_fail
331
+ - semantic
332
+ Style/SingleLineBlockParams:
333
+ Description: Enforces the names of some block params.
334
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
335
+ Enabled: false
336
+ Methods:
337
+ - reduce:
338
+ - a
339
+ - e
340
+ - inject:
341
+ - a
342
+ - e
343
+ Style/SingleLineMethods:
344
+ Description: Avoid single-line methods.
345
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
346
+ Enabled: false
347
+ AllowIfMethodIsEmpty: true
348
+ Style/StringLiterals:
349
+ Description: Checks if uses of quotes match the configured preference.
350
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
351
+ Enabled: false
352
+ EnforcedStyle: double_quotes
353
+ SupportedStyles:
354
+ - single_quotes
355
+ - double_quotes
356
+ Style/StringLiteralsInInterpolation:
357
+ Description: Checks if uses of quotes inside expressions in interpolated strings
358
+ match the configured preference.
359
+ Enabled: true
360
+ EnforcedStyle: single_quotes
361
+ SupportedStyles:
362
+ - single_quotes
363
+ - double_quotes
364
+ Layout/SpaceAroundBlockParameters:
365
+ Description: Checks the spacing inside and after block parameters pipes.
366
+ Enabled: true
367
+ EnforcedStyleInsidePipes: no_space
368
+ Layout/SpaceAroundEqualsInParameterDefault:
369
+ Description: Checks that the equals signs in parameter default assignments have
370
+ or don't have surrounding space depending on configuration.
371
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
372
+ Enabled: true
373
+ EnforcedStyle: space
374
+ SupportedStyles:
375
+ - space
376
+ - no_space
377
+ Layout/SpaceBeforeBlockBraces:
378
+ Description: Checks that the left block brace has or doesn't have space before it.
379
+ Enabled: true
380
+ EnforcedStyle: space
381
+ SupportedStyles:
382
+ - space
383
+ - no_space
384
+ Layout/SpaceInsideBlockBraces:
385
+ Description: Checks that block braces have or don't have surrounding space. For
386
+ blocks taking parameters, checks that the left brace has or doesn't have trailing
387
+ space.
388
+ Enabled: true
389
+ EnforcedStyle: space
390
+ SupportedStyles:
391
+ - space
392
+ - no_space
393
+ EnforcedStyleForEmptyBraces: no_space
394
+ SpaceBeforeBlockParameters: true
395
+ Layout/SpaceInsideHashLiteralBraces:
396
+ Description: Use spaces inside hash literal braces - or don't.
397
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
398
+ Enabled: true
399
+ EnforcedStyle: space
400
+ EnforcedStyleForEmptyBraces: no_space
401
+ SupportedStyles:
402
+ - space
403
+ - no_space
404
+ Style/SymbolProc:
405
+ Description: Use symbols as procs instead of blocks when possible.
406
+ Enabled: true
407
+ IgnoredMethods:
408
+ - respond_to
409
+ Layout/TrailingBlankLines:
410
+ Description: Checks trailing blank lines and final newline.
411
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
412
+ Enabled: true
413
+ EnforcedStyle: final_newline
414
+ SupportedStyles:
415
+ - final_newline
416
+ - final_blank_line
417
+ Style/TrailingCommaInArguments:
418
+ Description: Checks for trailing comma in argument lists.
419
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
420
+ Enabled: true
421
+ Style/TrailingCommaInArrayLiteral:
422
+ Description: Checks for trailing comma in array and hash literals.
423
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
424
+ Enabled: true
425
+ Style/TrailingCommaInHashLiteral:
426
+ Description: Checks for trailing comma in array and hash literals.
427
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
428
+ Enabled: true
429
+ Style/TrivialAccessors:
430
+ Description: Prefer attr_* methods to trivial readers/writers.
431
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
432
+ Enabled: false
433
+ ExactNameMatch: false
434
+ AllowPredicates: false
435
+ AllowDSLWriters: false
436
+ Whitelist:
437
+ - to_ary
438
+ - to_a
439
+ - to_c
440
+ - to_enum
441
+ - to_h
442
+ - to_hash
443
+ - to_i
444
+ - to_int
445
+ - to_io
446
+ - to_open
447
+ - to_path
448
+ - to_proc
449
+ - to_r
450
+ - to_regexp
451
+ - to_str
452
+ - to_s
453
+ - to_sym
454
+ Naming/VariableName:
455
+ Description: Use the configured style when naming variables.
456
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
457
+ Enabled: true
458
+ EnforcedStyle: snake_case
459
+ SupportedStyles:
460
+ - snake_case
461
+ - camelCase
462
+ Style/WhileUntilModifier:
463
+ Description: Favor modifier while/until usage when you have a single-line body.
464
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
465
+ Enabled: false
466
+ Style/WordArray:
467
+ Description: Use %w or %W for arrays of words.
468
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
469
+ Enabled: false
470
+ MinSize: 0
471
+ WordRegex: !ruby/regexp /\A[\p{Word}]+\z/
472
+ Metrics/AbcSize:
473
+ Description: A calculated magnitude based on number of assignments, branches, and
474
+ conditions.
475
+ Enabled: true
476
+ Max: 25
477
+ Metrics/BlockNesting:
478
+ Description: Avoid excessive block nesting
479
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
480
+ Enabled: true
481
+ Max: 3
482
+ Metrics/ClassLength:
483
+ Description: Avoid classes longer than 100 lines of code.
484
+ Enabled: false
485
+ CountComments: false
486
+ Max: 100
487
+ Metrics/CyclomaticComplexity:
488
+ Description: A complexity metric that is strongly correlated to the number of test
489
+ cases needed to validate a method.
490
+ Enabled: true
491
+ Max: 6
492
+ Metrics/LineLength:
493
+ Description: Limit lines to 100 characters.
494
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#100-character-limits
495
+ Enabled: true
496
+ Max: 100
497
+ AllowURI: true
498
+ URISchemes:
499
+ - http
500
+ - https
501
+ Metrics/MethodLength:
502
+ Description: Avoid methods longer than 15 lines of code.
503
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
504
+ Enabled: true
505
+ CountComments: true
506
+ Max: 15
507
+ Exclude:
508
+ - "spec/**/*"
509
+ Metrics/ParameterLists:
510
+ Description: Avoid long parameter lists.
511
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
512
+ Enabled: false
513
+ Max: 5
514
+ CountKeywordArgs: true
515
+ Metrics/PerceivedComplexity:
516
+ Description: A complexity metric geared towards measuring complexity for a human
517
+ reader.
518
+ Enabled: true
519
+ Max: 7
520
+ Lint/AssignmentInCondition:
521
+ Description: Don't use assignment in conditions.
522
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
523
+ Enabled: false
524
+ AllowSafeAssignment: true
525
+ Layout/EndAlignment:
526
+ Description: Align ends correctly.
527
+ Enabled: true
528
+ EnforcedStyleAlignWith: keyword
529
+ Layout/DefEndAlignment:
530
+ Description: Align ends corresponding to defs correctly.
531
+ Enabled: true
532
+ EnforcedStyleAlignWith: start_of_line
533
+ Rails/ActionFilter:
534
+ Description: Enforces consistent use of action filter methods.
535
+ Enabled: true
536
+ EnforcedStyle: action
537
+ SupportedStyles:
538
+ - action
539
+ - filter
540
+ Include:
541
+ - app/controllers/**/*.rb
542
+ Rails/HasAndBelongsToMany:
543
+ Description: Prefer has_many :through to has_and_belongs_to_many.
544
+ Enabled: true
545
+ Include:
546
+ - app/models/**/*.rb
547
+ Rails/Output:
548
+ Description: Checks for calls to puts, print, etc.
549
+ Enabled: true
550
+ Include:
551
+ - app/**/*.rb
552
+ - config/**/*.rb
553
+ - db/**/*.rb
554
+ - lib/**/*.rb
555
+ Rails/ReadWriteAttribute:
556
+ Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
557
+ Enabled: true
558
+ Include:
559
+ - app/models/**/*.rb
560
+ Rails/ScopeArgs:
561
+ Description: Checks the arguments of ActiveRecord scopes.
562
+ Enabled: true
563
+ Include:
564
+ - app/models/**/*.rb
565
+ Rails/Validation:
566
+ Description: Use validates :attribute, hash of validations.
567
+ Enabled: true
568
+ Include:
569
+ - app/models/**/*.rb
570
+ Style/InlineComment:
571
+ Description: Avoid inline comments.
572
+ Enabled: false
573
+ Style/MethodCalledOnDoEndBlock:
574
+ Description: Avoid chaining a method call on a do...end block.
575
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
576
+ Enabled: false
577
+ Style/SymbolArray:
578
+ Description: Use %i or %I for arrays of symbols.
579
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
580
+ Enabled: false
581
+ Layout/ExtraSpacing:
582
+ Description: Do not use unnecessary spacing.
583
+ Enabled: false
584
+ Naming/AccessorMethodName:
585
+ Description: Check the naming of accessor methods for get_/set_.
586
+ Enabled: false
587
+ Style/Alias:
588
+ Description: Use alias_method instead of alias.
589
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
590
+ Enabled: false
591
+ Layout/AlignArray:
592
+ Description: Align the elements of an array literal if they span more than one line.
593
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
594
+ Enabled: true
595
+ Style/ArrayJoin:
596
+ Description: Use Array#join instead of Array#*.
597
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
598
+ Enabled: false
599
+ Style/AsciiComments:
600
+ Description: Use only ascii symbols in comments.
601
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
602
+ Enabled: false
603
+ Naming/AsciiIdentifiers:
604
+ Description: Use only ascii symbols in identifiers.
605
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
606
+ Enabled: false
607
+ Style/Attr:
608
+ Description: Checks for uses of Module#attr.
609
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
610
+ Enabled: false
611
+ Style/BeginBlock:
612
+ Description: Avoid the use of BEGIN blocks.
613
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
614
+ Enabled: true
615
+ Style/BlockComments:
616
+ Description: Do not use block comments.
617
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
618
+ Enabled: false
619
+ Layout/BlockEndNewline:
620
+ Description: Put end statement of multiline block on its own line.
621
+ Enabled: true
622
+ Style/CaseEquality:
623
+ Description: Avoid explicit use of the case equality operator(===).
624
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
625
+ Enabled: false
626
+ Style/CharacterLiteral:
627
+ Description: Checks for uses of character literals.
628
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
629
+ Enabled: false
630
+ Naming/ClassAndModuleCamelCase:
631
+ Description: Use CamelCase for classes and modules.
632
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
633
+ Enabled: true
634
+ Style/ClassMethods:
635
+ Description: Use self when defining module/class methods.
636
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-singletons
637
+ Enabled: true
638
+ Style/ClassVars:
639
+ Description: Avoid the use of class variables.
640
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
641
+ Enabled: false
642
+ Style/ColonMethodCall:
643
+ Description: 'Do not use :: for method call.'
644
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
645
+ Enabled: false
646
+ Layout/CommentIndentation:
647
+ Description: Indentation of comments.
648
+ Enabled: true
649
+ Naming/ConstantName:
650
+ Description: Constants should use SCREAMING_SNAKE_CASE.
651
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
652
+ Enabled: true
653
+ Style/DefWithParentheses:
654
+ Description: Use def with parentheses when there are arguments.
655
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
656
+ Enabled: true
657
+ Style/PreferredHashMethods:
658
+ Description: Checks for use of deprecated Hash methods.
659
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
660
+ Enabled: false
661
+ Style/Documentation:
662
+ Description: Document classes and non-namespace modules.
663
+ Enabled: false
664
+ Style/DoubleNegation:
665
+ Description: Checks for uses of double negation (!!).
666
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
667
+ Enabled: false
668
+ Style/EachWithObject:
669
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
670
+ Enabled: false
671
+ Layout/ElseAlignment:
672
+ Description: Align elses and elsifs correctly.
673
+ Enabled: true
674
+ Style/EmptyElse:
675
+ Description: Avoid empty else-clauses.
676
+ Enabled: true
677
+ Layout/EmptyLines:
678
+ Description: Don't use several empty lines in a row.
679
+ Enabled: true
680
+ Layout/EmptyLinesAroundAccessModifier:
681
+ Description: Keep blank lines around access modifiers.
682
+ Enabled: true
683
+ Layout/EmptyLinesAroundMethodBody:
684
+ Description: Keeps track of empty lines around method bodies.
685
+ Enabled: true
686
+ Style/EmptyLiteral:
687
+ Description: Prefer literals to Array.new/Hash.new/String.new.
688
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
689
+ Enabled: false
690
+ Style/EndBlock:
691
+ Description: Avoid the use of END blocks.
692
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
693
+ Enabled: true
694
+ Layout/EndOfLine:
695
+ Description: Use Unix-style line endings.
696
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
697
+ Enabled: true
698
+ Style/EvenOdd:
699
+ Description: Favor the use of Fixnum#even? && Fixnum#odd?
700
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
701
+ Enabled: false
702
+ Style/FlipFlop:
703
+ Description: Checks for flip flops
704
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
705
+ Enabled: false
706
+ Style/IfWithSemicolon:
707
+ Description: Do not use if x; .... Use the ternary operator instead.
708
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
709
+ Enabled: false
710
+ Layout/IndentationConsistency:
711
+ Description: Keep indentation straight.
712
+ Enabled: true
713
+ Layout/IndentArray:
714
+ Description: Checks the indentation of the first element in an array literal.
715
+ Enabled: true
716
+ Style/InfiniteLoop:
717
+ Description: Use Kernel#loop for infinite loops.
718
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
719
+ Enabled: true
720
+ Style/Lambda:
721
+ Description: Use the new lambda literal syntax for single-line blocks.
722
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
723
+ Enabled: false
724
+ Layout/LeadingCommentSpace:
725
+ Description: Comments should start with a space.
726
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
727
+ Enabled: true
728
+ Style/LineEndConcatenation:
729
+ Description: Use \ instead of + or << to concatenate two string literals at line
730
+ end.
731
+ Enabled: false
732
+ Style/MethodCallWithoutArgsParentheses:
733
+ Description: Do not use parentheses for method calls with no arguments.
734
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
735
+ Enabled: true
736
+ Style/ModuleFunction:
737
+ Description: Checks for usage of `extend self` in modules.
738
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
739
+ Enabled: false
740
+ Style/MultilineBlockChain:
741
+ Description: Avoid multi-line chains of blocks.
742
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
743
+ Enabled: false
744
+ Layout/MultilineBlockLayout:
745
+ Description: Ensures newlines after multiline block do statements.
746
+ Enabled: false
747
+ Style/MultilineIfThen:
748
+ Description: Do not use then for multi-line if/unless.
749
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
750
+ Enabled: true
751
+ Style/MultilineTernaryOperator:
752
+ Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
753
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
754
+ Enabled: true
755
+ Style/NegatedIf:
756
+ Description: Favor unless over if for negative conditions (or control flow or).
757
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
758
+ Enabled: false
759
+ Style/NegatedWhile:
760
+ Description: Favor until over while for negative conditions.
761
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
762
+ Enabled: false
763
+ Style/NestedTernaryOperator:
764
+ Description: Use one expression per branch in a ternary operator.
765
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
766
+ Enabled: true
767
+ Style/NilComparison:
768
+ Description: Prefer x.nil? to x == nil.
769
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
770
+ Enabled: false
771
+ Style/Not:
772
+ Description: Use ! instead of not.
773
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
774
+ Enabled: true
775
+ Style/OneLineConditional:
776
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
777
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
778
+ Enabled: false
779
+ Naming/BinaryOperatorParameterName:
780
+ Description: When defining binary operators, name the argument other.
781
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
782
+ Enabled: false
783
+ Style/PerlBackrefs:
784
+ Description: Avoid Perl-style regex back references.
785
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
786
+ Enabled: false
787
+ Style/Proc:
788
+ Description: Use proc instead of Proc.new.
789
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
790
+ Enabled: false
791
+ Style/RedundantBegin:
792
+ Description: Don't use begin blocks when they are not needed.
793
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
794
+ Enabled: true
795
+ Style/RedundantException:
796
+ Description: Checks for an obsolete RuntimeException argument in raise/fail.
797
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
798
+ Enabled: true
799
+ Style/RedundantSelf:
800
+ Description: Don't use self where it's not needed.
801
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
802
+ Enabled: true
803
+ Style/RescueModifier:
804
+ Description: Avoid using rescue in its modifier form.
805
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
806
+ Enabled: true
807
+ Style/SelfAssignment:
808
+ Description: Checks for places where self-assignment shorthand should have been
809
+ used.
810
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
811
+ Enabled: false
812
+ Layout/SpaceAfterColon:
813
+ Description: Use spaces after colons.
814
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
815
+ Enabled: true
816
+ Layout/SpaceAfterComma:
817
+ Description: Use spaces after commas.
818
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
819
+ Enabled: true
820
+ Layout/SpaceAroundKeyword:
821
+ Description: Use a space around keywords if appropriate.
822
+ Enabled: true
823
+ Layout/SpaceAfterMethodName:
824
+ Description: Do not put a space between a method name and the opening parenthesis
825
+ in a method definition.
826
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
827
+ Enabled: true
828
+ Layout/SpaceAfterNot:
829
+ Description: Tracks redundant space after the ! operator.
830
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
831
+ Enabled: true
832
+ Layout/SpaceAfterSemicolon:
833
+ Description: Use spaces after semicolons.
834
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
835
+ Enabled: true
836
+ Layout/SpaceBeforeComma:
837
+ Description: No spaces before commas.
838
+ Enabled: true
839
+ Layout/SpaceBeforeComment:
840
+ Description: Checks for missing space between code and a comment on the same line.
841
+ Enabled: true
842
+ Layout/SpaceBeforeFirstArg:
843
+ Description: Put a space between a method name and the first argument in a method
844
+ call without parentheses.
845
+ Enabled: true
846
+ Layout/SpaceBeforeSemicolon:
847
+ Description: No spaces before semicolons.
848
+ Enabled: true
849
+ Layout/SpaceAroundOperators:
850
+ Description: Use spaces around operators.
851
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
852
+ Enabled: true
853
+ Layout/SpaceInsideArrayLiteralBrackets:
854
+ Description: No spaces after [ or before ].
855
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
856
+ Enabled: true
857
+ Layout/SpaceInsideReferenceBrackets:
858
+ Description: No spaces after [ or before ].
859
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
860
+ Enabled: true
861
+ Layout/SpaceInsideParens:
862
+ Description: No spaces after ( or before ).
863
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
864
+ Enabled: true
865
+ Layout/SpaceInsideRangeLiteral:
866
+ Description: No spaces inside range literals.
867
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
868
+ Enabled: true
869
+ Style/SpecialGlobalVars:
870
+ Description: Avoid Perl-style global variables.
871
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
872
+ Enabled: false
873
+ Style/StructInheritance:
874
+ Description: Checks for inheritance from Struct.new.
875
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
876
+ Enabled: true
877
+ Layout/Tab:
878
+ Description: No hard tabs.
879
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
880
+ Enabled: true
881
+ Layout/TrailingWhitespace:
882
+ Description: Avoid trailing whitespace.
883
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
884
+ Enabled: true
885
+ Style/UnlessElse:
886
+ Description: Do not use unless with else. Rewrite these with the positive case first.
887
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
888
+ Enabled: true
889
+ Style/UnneededCapitalW:
890
+ Description: Checks for %W when interpolation is not needed.
891
+ Enabled: true
892
+ Style/UnneededPercentQ:
893
+ Description: Checks for %q/%Q when single quotes or double quotes would do.
894
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
895
+ Enabled: true
896
+ Style/VariableInterpolation:
897
+ Description: Don't interpolate global, instance and class variables directly in
898
+ strings.
899
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
900
+ Enabled: false
901
+ Style/WhenThen:
902
+ Description: Use when x then ... for one-line cases.
903
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
904
+ Enabled: false
905
+ Style/WhileUntilDo:
906
+ Description: Checks for redundant do after while or until.
907
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
908
+ Enabled: true
909
+ Lint/AmbiguousOperator:
910
+ Description: Checks for ambiguous operators in the first argument of a method invocation
911
+ without parentheses.
912
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
913
+ Enabled: false
914
+ Lint/AmbiguousRegexpLiteral:
915
+ Description: Checks for ambiguous regexp literals in the first argument of a method
916
+ invocation without parenthesis.
917
+ Enabled: false
918
+ Layout/BlockAlignment:
919
+ Description: Align block ends correctly.
920
+ Enabled: true
921
+ Layout/ConditionPosition:
922
+ Description: Checks for condition placed in a confusing position relative to the
923
+ keyword.
924
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
925
+ Enabled: false
926
+ Lint/Debugger:
927
+ Description: Check for debugger calls.
928
+ Enabled: true
929
+ Lint/DeprecatedClassMethods:
930
+ Description: Check for deprecated class method calls.
931
+ Enabled: false
932
+ Lint/DuplicateMethods:
933
+ Description: Check for duplicate methods calls.
934
+ Enabled: true
935
+ Lint/ElseLayout:
936
+ Description: Check for odd code arrangement in an else block.
937
+ Enabled: false
938
+ Lint/EmptyEnsure:
939
+ Description: Checks for empty ensure block.
940
+ Enabled: true
941
+ Lint/EmptyInterpolation:
942
+ Description: Checks for empty string interpolation.
943
+ Enabled: true
944
+ Lint/EndInMethod:
945
+ Description: END blocks should not be placed inside method definitions.
946
+ Enabled: true
947
+ Lint/EnsureReturn:
948
+ Description: Do not use return in an ensure block.
949
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
950
+ Enabled: true
951
+ Security/Eval:
952
+ Description: The use of eval represents a serious security risk.
953
+ Enabled: true
954
+ Lint/HandleExceptions:
955
+ Description: Don't suppress exception.
956
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
957
+ Enabled: false
958
+ Lint/LiteralAsCondition:
959
+ Description: Checks of literals used in conditions.
960
+ Enabled: false
961
+ Lint/LiteralInInterpolation:
962
+ Description: Checks for literals used in interpolation.
963
+ Enabled: false
964
+ Lint/Loop:
965
+ Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
966
+ for post-loop tests.
967
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
968
+ Enabled: false
969
+ Lint/ParenthesesAsGroupedExpression:
970
+ Description: Checks for method calls with a space before the opening parenthesis.
971
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
972
+ Enabled: false
973
+ Lint/RequireParentheses:
974
+ Description: Use parentheses in the method call to avoid confusion about precedence.
975
+ Enabled: false
976
+ Lint/RescueException:
977
+ Description: Avoid rescuing the Exception class.
978
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
979
+ Enabled: true
980
+ Lint/ShadowingOuterLocalVariable:
981
+ Description: Do not use the same name as outer local variable for block arguments
982
+ or block local variables.
983
+ Enabled: true
984
+ Lint/StringConversionInInterpolation:
985
+ Description: Checks for Object#to_s usage in string interpolation.
986
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
987
+ Enabled: true
988
+ Lint/UnderscorePrefixedVariableName:
989
+ Description: Do not use prefix `_` for a variable that is used.
990
+ Enabled: false
991
+ Lint/UnusedBlockArgument:
992
+ Description: Checks for unused block arguments.
993
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
994
+ Enabled: true
995
+ Lint/UnusedMethodArgument:
996
+ Description: Checks for unused method arguments.
997
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
998
+ Enabled: true
999
+ Lint/UnreachableCode:
1000
+ Description: Unreachable code.
1001
+ Enabled: true
1002
+ Lint/UselessAccessModifier:
1003
+ Description: Checks for useless access modifiers.
1004
+ Enabled: true
1005
+ Lint/UselessAssignment:
1006
+ Description: Checks for useless assignment to a local variable.
1007
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
1008
+ Enabled: true
1009
+ Lint/UselessComparison:
1010
+ Description: Checks for comparison of something with itself.
1011
+ Enabled: true
1012
+ Lint/UselessElseWithoutRescue:
1013
+ Description: Checks for useless `else` in `begin..end` without `rescue`.
1014
+ Enabled: true
1015
+ Lint/UselessSetterCall:
1016
+ Description: Checks for useless setter call to a local variable.
1017
+ Enabled: true
1018
+ Lint/Void:
1019
+ Description: Possible use of operator/literal/variable in void context.
1020
+ Enabled: false
1021
+ Rails/Delegate:
1022
+ Description: Prefer delegate method for delegations.
1023
+ Enabled: false
1024
+ Performance/RedundantBlockCall:
1025
+ Description: Use `yield` instead of `block.call`.
1026
+ Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
1027
+ Enabled: false
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in bank_api.gemspec
6
6
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bank_api (0.5.1)
4
+ bank_api (0.6.1)
5
5
  pincers
6
6
  rest-client
7
7
  timezone (~> 1.0)
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
data/lib/bank_api.rb CHANGED
@@ -25,6 +25,10 @@ module BankApi
25
25
  Clients::BancoDeChileCompanyClient.new(configuration).get_recent_deposits
26
26
  end
27
27
 
28
+ def self.get_bdc_company_balance
29
+ Clients::BancoDeChileCompanyClient.new(configuration).get_account_balance
30
+ end
31
+
28
32
  module BancoSecurity
29
33
  def self.get_account_balance(account_number)
30
34
  company_instance.get_balance(account_number)
@@ -8,6 +8,7 @@ module BankApi::Clients
8
8
  COMPANY_LOGIN_URL = 'https://www.empresas.bancochile.cl/cgi-bin/navega?pagina=enlinea/login_fus'
9
9
  COMPANY_DEPOSITS_URL = 'https://www.empresas.bancochile.cl/GlosaInternetEmpresaRecibida/ConsultaRecibidaAction.do'
10
10
  COMPANY_DEPOSITS_TXT_URL = 'https://www.empresas.bancochile.cl/GlosaInternetEmpresaRecibida/RespuestaConsultaRecibidaAction.do'
11
+ COMPANY_CC_BALANCE_URL = 'https://www.empresas.bancochile.cl/CCOLDerivadorWEB/selectorCuentas.do?accion=initSelectorCuentas&opcion=saldos&moduloProducto=CC'
11
12
 
12
13
  DATE_COLUMN = 0
13
14
  RUT_COLUMN = 4
@@ -38,6 +39,37 @@ module BankApi::Clients
38
39
  ].any?(&:nil?)
39
40
  end
40
41
 
42
+ def get_balance
43
+ login
44
+ goto_balance
45
+ select_account
46
+ click_fetch_balance_button
47
+ money_to_i read_balance
48
+ end
49
+
50
+ def goto_balance
51
+ browser.goto COMPANY_CC_BALANCE_URL
52
+ end
53
+
54
+ def select_account
55
+ first_account = browser.search("select[name=cuenta] option").find do |account|
56
+ account.value.include? @bdc_account
57
+ end.value
58
+ browser.search("select[name=cuenta]").set by_value: first_account
59
+ end
60
+
61
+ def click_fetch_balance_button
62
+ browser.search('#btnSeleccionarCuenta').click
63
+ end
64
+
65
+ def money_to_i(text)
66
+ text.delete(".").delete("$").delete(" ").to_i
67
+ end
68
+
69
+ def read_balance
70
+ browser.search('table.detalleSaldosMov tr:nth-child(2) > td.aRight.bold').text
71
+ end
72
+
41
73
  def get_deposits(_options = {})
42
74
  login
43
75
  goto_deposits
@@ -16,6 +16,11 @@ module BankApi::Clients
16
16
  parse_entries(get_deposits(options))
17
17
  end
18
18
 
19
+ def get_account_balance
20
+ validate_credentials
21
+ get_balance
22
+ end
23
+
19
24
  def transfer(transfer_data)
20
25
  validate_credentials
21
26
  validate_transfer_missing_data(transfer_data)
@@ -46,6 +51,10 @@ module BankApi::Clients
46
51
  raise NotImplementedError
47
52
  end
48
53
 
54
+ def get_balance
55
+ raise NotImplementedError
56
+ end
57
+
49
58
  def validate_transfer_missing_data(_transfer_data)
50
59
  raise NotImplementedError
51
60
  end
@@ -1,3 +1,3 @@
1
1
  module BankApi
2
- VERSION = "0.5.1"
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bank_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - oaestay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-17 00:00:00.000000000 Z
11
+ date: 2018-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pincers
@@ -145,6 +145,7 @@ extra_rdoc_files: []
145
145
  files:
146
146
  - ".gitignore"
147
147
  - ".rspec"
148
+ - ".rubocop.yml"
148
149
  - ".ruby-version"
149
150
  - ".travis.yml"
150
151
  - CODE_OF_CONDUCT.md
@@ -193,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
194
  version: '0'
194
195
  requirements: []
195
196
  rubyforge_project:
196
- rubygems_version: 2.5.2
197
+ rubygems_version: 2.7.7
197
198
  signing_key:
198
199
  specification_version: 4
199
200
  summary: Wrapper for chilean banks