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 +4 -4
- data/.rubocop.yml +32 -31
- data/Gemfile.lock +8 -5
- data/lib/abank/big.rb +3 -4
- data/lib/abank/folha.rb +6 -6
- data/lib/abank/version.rb +1 -1
- data/lib/abank.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9fb1ca32457b6432b7315cb8b79448d15029d185180ad8b980e9601ec1d09afc
|
|
4
|
+
data.tar.gz: 8b4fa9d4e3ceeeab14844ec674cc37b3c96a38f28358e130c5c57f8810cd1fd7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
7
|
+
Metrics/ClassLength:
|
|
8
8
|
Enabled: false
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Metrics/ParameterLists:
|
|
11
11
|
Enabled: false
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
21
|
+
Max: 160
|
|
19
22
|
AllowHeredoc: true
|
|
20
23
|
AllowURI: true
|
|
21
24
|
|
|
22
25
|
Layout/IndentationWidth:
|
|
23
|
-
Width: 2
|
|
26
|
+
Width: 2
|
|
24
27
|
|
|
25
28
|
Layout/SpaceInsideHashLiteralBraces:
|
|
26
29
|
EnforcedStyle: space
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
Layout/SingleLineBlockChain:
|
|
32
|
+
Enabled: false
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
Layout/SpaceInsideParens:
|
|
35
|
+
Enabled: true
|
|
33
36
|
|
|
34
|
-
#
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Exclude:
|
|
38
|
-
- "spec/**/*.rb" # Ignore test files
|
|
37
|
+
# Style Preferences
|
|
38
|
+
Style/Copyright:
|
|
39
|
+
Enabled: false
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Exclude:
|
|
43
|
-
- "Rakefile"
|
|
41
|
+
Style/Documentation:
|
|
42
|
+
Enabled: false
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Enabled: true
|
|
44
|
+
Style/RequireOrder:
|
|
45
|
+
Enabled: false
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
Enabled:
|
|
47
|
+
Style/ConstantVisibility:
|
|
48
|
+
Enabled: false
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
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
|
|
57
|
+
MinDigits: 5
|
|
61
58
|
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
# Linting
|
|
60
|
+
Lint/UselessAssignment:
|
|
61
|
+
Enabled: true
|
|
64
62
|
|
|
65
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
156
|
-
|
|
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
|
|
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)
|
|
116
|
-
lre[:dl] += -1 if lre[:cnt]
|
|
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
|
|
69
|
+
return false if rowfc.first.is_a?(String)
|
|
70
70
|
|
|
71
71
|
rowfc[2] = rowfc[2].strip
|
|
72
|
-
rowfc[3] =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
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").
|
|
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").
|
|
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.
|
|
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-
|
|
10
|
+
date: 2025-02-16 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: bundler
|