abank 0.6.5 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: faded94a2ee0aed687be574f427d89440cbf91246100ff495bc45f877fdf9572
4
- data.tar.gz: 6cb04251174ba4acdbccf3b8836b451331b11d6e25d44ad1d142477e9185fbbc
3
+ metadata.gz: 9fb1ca32457b6432b7315cb8b79448d15029d185180ad8b980e9601ec1d09afc
4
+ data.tar.gz: 8b4fa9d4e3ceeeab14844ec674cc37b3c96a38f28358e130c5c57f8810cd1fd7
5
5
  SHA512:
6
- metadata.gz: 03ccf481864bb07ffdecb47ce41103dd6a50d531db141b201c8bad6836ce6acffd16387352d9297ba4e8a7d4e23d2c0ab3c56aab4b6fd17eba272c8a7a68a3ba
7
- data.tar.gz: 6d54126148e37af2b0701b33b62d3954d8582df25d669a8ea646ca8f99749a527bb99614533d0c9b7fbf99049beac559f52b391c5139e6bc2d55f7645ff74d36
6
+ metadata.gz: ad8f9bb914961c971e6845b57404fb52d4f2456aadcddb3f3b422ddfa91ecd4d41ea8ed96aece21bb13fa5adffa7348f67dd4f1067628ee92767c0002cb546c2
7
+ data.tar.gz: f0a96e627a3a0aa3ac792f70823a9627a6a027c4e6e6e851a6ae8e5abdf4bb55486ca7711360eed0c5b477b91e965ff5b5ec40faeff4a793925662d7ce9c14da
data/.rubocop.yml CHANGED
@@ -4,63 +4,64 @@ AllCops:
4
4
  EnabledByDefault: true
5
5
  NewCops: enable # Automatically enable new cops introduced in updates
6
6
 
7
- Style/Copyright:
7
+ Metrics/ClassLength:
8
8
  Enabled: false
9
9
 
10
- Lint/ConstantResolution:
10
+ Metrics/ParameterLists:
11
11
  Enabled: false
12
12
 
13
- Style/ConstantVisibility:
14
- Enabled: false
13
+ Metrics/MethodLength:
14
+ Max: 25
15
+
16
+ Metrics/AbcSize:
17
+ Max: 40
15
18
 
16
19
  # Formatting Rules
17
20
  Layout/LineLength:
18
- Max: 160 # Increase max line length from default 80 to 100
21
+ Max: 160
19
22
  AllowHeredoc: true
20
23
  AllowURI: true
21
24
 
22
25
  Layout/IndentationWidth:
23
- Width: 2 # Use 2 spaces for indentation (default)
26
+ Width: 2
24
27
 
25
28
  Layout/SpaceInsideHashLiteralBraces:
26
29
  EnforcedStyle: space
27
30
 
28
- Style/TrailingCommaInArrayLiteral:
29
- EnforcedStyleForMultiline: consistent_comma
31
+ Layout/SingleLineBlockChain:
32
+ Enabled: false
30
33
 
31
- Style/TrailingCommaInHashLiteral:
32
- EnforcedStyleForMultiline: consistent_comma
34
+ Layout/SpaceInsideParens:
35
+ Enabled: true
33
36
 
34
- # Disable specific cops
35
- Metrics/MethodLength:
36
- Max: 15 # Allow methods up to 15 lines (default is too strict)
37
- Exclude:
38
- - "spec/**/*.rb" # Ignore test files
37
+ # Style Preferences
38
+ Style/Copyright:
39
+ Enabled: false
39
40
 
40
- Metrics/BlockLength:
41
- Max: 20
42
- Exclude:
43
- - "Rakefile"
41
+ Style/Documentation:
42
+ Enabled: false
44
43
 
45
- # Linting
46
- Lint/UselessAssignment:
47
- Enabled: true
44
+ Style/RequireOrder:
45
+ Enabled: false
48
46
 
49
- Lint/AmbiguousOperatorPrecedence:
50
- Enabled: true
47
+ Style/ConstantVisibility:
48
+ Enabled: false
51
49
 
52
- # Style Preferences
53
- Style/FrozenStringLiteralComment:
54
- Enabled: false # Don't require `# frozen_string_literal: true` at the top of files
50
+ Style/OptionHash:
51
+ Enabled: false
55
52
 
56
53
  Style/StringLiterals:
57
54
  EnforcedStyle: single_quotes
58
55
 
59
56
  Style/NumericLiterals:
60
- MinDigits: 5 # Add underscores for long numbers: `100_000`
57
+ MinDigits: 5
61
58
 
62
- Style/Documentation:
63
- Enabled: false # Don't require top-level documentation comments
59
+ # Linting
60
+ Lint/UselessAssignment:
61
+ Enabled: true
64
62
 
65
- Style/RequireOrder:
63
+ Lint/AmbiguousOperatorPrecedence:
64
+ Enabled: true
65
+
66
+ Lint/ConstantResolution:
66
67
  Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- abank (0.6.5)
4
+ abank (0.6.6)
5
5
  google-cloud-bigquery
6
6
  roo
7
7
  thor
@@ -108,6 +108,8 @@ GEM
108
108
  nokogiri (1.18.2)
109
109
  mini_portile2 (~> 2.8.2)
110
110
  racc (~> 1.4)
111
+ nokogiri (1.18.2-x86_64-linux-gnu)
112
+ racc (~> 1.4)
111
113
  observer (0.1.2)
112
114
  os (1.1.4)
113
115
  ostruct (0.6.1)
@@ -135,7 +137,7 @@ GEM
135
137
  retriable (3.1.2)
136
138
  reverse_markdown (3.0.0)
137
139
  nokogiri
138
- rexml (3.4.0)
140
+ rexml (3.4.1)
139
141
  roo (2.10.1)
140
142
  nokogiri (~> 1)
141
143
  rubyzip (>= 1.3.0, < 3.0.0)
@@ -152,8 +154,9 @@ GEM
152
154
  unicode-display_width (>= 2.4.0, < 4.0)
153
155
  rubocop-ast (1.38.0)
154
156
  parser (>= 3.3.1.0)
155
- rubocop-rake (0.6.0)
156
- rubocop (~> 1.0)
157
+ rubocop-rake (0.7.1)
158
+ lint_roller (~> 1.1)
159
+ rubocop (>= 1.72.1)
157
160
  ruby-progressbar (1.13.0)
158
161
  rubyzip (2.4.1)
159
162
  signet (0.19.0)
@@ -206,4 +209,4 @@ DEPENDENCIES
206
209
  yard
207
210
 
208
211
  BUNDLED WITH
209
- 2.3.7
212
+ 2.6.3
data/lib/abank/big.rb CHANGED
@@ -112,8 +112,8 @@ module Abank
112
112
  def ct_dados
113
113
  ctlct.map! do |ctr|
114
114
  opcao[:c] = ctr[:ct]
115
- lre = sql(sql_last_re)[0]
116
- lre[:dl] += -1 if lre[:cnt] == 0
115
+ lre = sql(sql_last_re).first
116
+ lre[:dl] += -1 if lre[:cnt].zero?
117
117
  ctr.merge(lre, mv: sql(sql_novo_mv(lre[:dl])))
118
118
  end
119
119
  self
@@ -141,8 +141,7 @@ module Abank
141
141
 
142
142
  # @return [String] texto formatado que representa lista de contratos arrendamento
143
143
  def str_lc(sep = "'")
144
- ctlct.map { |cid| sep + cid[:ct] + sep }
145
- .join(',')
144
+ ctlct.map { |cid| sep + cid[:ct] + sep }.join(',')
146
145
  end
147
146
 
148
147
  # @return [String] sql para obter ultima renda do contrato arrendamento
data/lib/abank/folha.rb CHANGED
@@ -66,10 +66,10 @@ module Abank
66
66
  # @return [Boolean] linha com valores para processar?
67
67
  def ok?(linha)
68
68
  @rowfc = linha.values
69
- return false if rowfc[0].is_a?(String)
69
+ return false if rowfc.first.is_a?(String)
70
70
 
71
71
  rowfc[2] = rowfc[2].strip
72
- rowfc[3] = -1 * rowfc[3] if conta > 1
72
+ rowfc[3] = rowfc[3] * -1 if conta > 1
73
73
  true
74
74
  end
75
75
 
@@ -93,7 +93,7 @@ module Abank
93
93
  # @return [Big] acesso a base dados abank no bigquery
94
94
  def mv_insert
95
95
  unless mvvls.empty?
96
- @mvvls = mvvls[1..] if mvvls[0] == ','
96
+ @mvvls = mvvls[1..] if mvvls.first == ','
97
97
  dml("insert #{BD}.mv VALUES#{mvvls}")
98
98
  puts("MOVIMENTOS INSERIDOS #{bqnrs}")
99
99
  mv_classifica if bqnrs.positive?
@@ -118,7 +118,7 @@ module Abank
118
118
 
119
119
  # @return [String] texto base formatado para display
120
120
  def linha_base
121
- "#{rowfc[0].strftime(DF)} #{format('%<v3>-34.34s %<v4>8.2f', v3: rowfc[2], v4: rowfc[3])}"
121
+ "#{rowfc.first.strftime(DF)} #{format('%<v3>-34.34s %<v4>8.2f', v3: rowfc[2], v4: rowfc[3])}"
122
122
  end
123
123
 
124
124
  # @return [String] texto linha existente formatada para display
@@ -145,14 +145,14 @@ module Abank
145
145
 
146
146
  # @return [String] sql para movimentos no bigquery
147
147
  def sql_existe_mv
148
- "select * from #{BD}.gmv where nc=#{conta} and dl='#{rowfc[0].strftime(DF)}' and vl=#{rowfc[3]}"
148
+ "select * from #{BD}.gmv where nc=#{conta} and dl='#{rowfc.first.strftime(DF)}' and vl=#{rowfc[3]}"
149
149
  end
150
150
 
151
151
  # obtem movimento (values.mv) para inserir
152
152
  #
153
153
  # @return [String] ' NOVO'
154
154
  def values_mv
155
- @mvvls += ",('#{rowfc[0].strftime(DF)}','#{dvc.strftime(DF)}','#{rowfc[2]}',#{rowfc[3]},#{conta},#{dvc.year},#{dvc.month},'#{tpc}',#{ctc},null,null)"
155
+ @mvvls += ",('#{rowfc.first.strftime(DF)}','#{dvc.strftime(DF)}','#{rowfc[2]}',#{rowfc[3]},#{conta},#{dvc.year},#{dvc.month},'#{tpc}',#{ctc},null,null)"
156
156
  ' NOVO'
157
157
  end
158
158
 
data/lib/abank/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Abank
4
- VERSION = '0.6.5'
4
+ VERSION = '0.6.6'
5
5
  end
data/lib/abank.rb CHANGED
@@ -7,7 +7,7 @@ require('abank/version')
7
7
 
8
8
  # @author Hernani Rodrigues Vaz
9
9
  module Abank
10
- DR = "/home/#{`whoami`.chomp}/Downloads"
10
+ DR = "/home/#{`whoami`.chomp}/Downloads".freeze
11
11
 
12
12
  # CLI para carregar folhas calculo comuns no bigquery
13
13
  class CLI < Thor
@@ -65,7 +65,7 @@ module Abank
65
65
  option :g, banner: 'TAG', default: '', desc: 'classificacao para movimentos a carregar'
66
66
  # carrega/apaga dados da folha calculo
67
67
  def work
68
- Dir.glob("#{DR}/*.xlsx").sort.each do |file|
68
+ Dir.glob("#{DR}/*.xlsx").each do |file|
69
69
  Folha.new(options.transform_keys(&:to_sym).merge(f: file, i: true)).processa_xls
70
70
  end
71
71
  end
@@ -73,7 +73,7 @@ module Abank
73
73
  desc 'show', 'mostra dados da folha calculo'
74
74
  # mostra folha calculo
75
75
  def show
76
- Dir.glob("#{DR}/*.xlsx").sort.each do |file|
76
+ Dir.glob("#{DR}/*.xlsx").each do |file|
77
77
  Folha.new(options.merge(f: file)).processa_xls
78
78
  end
79
79
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hernâni Rodrigues Vaz
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-02-15 00:00:00.000000000 Z
10
+ date: 2025-02-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bundler