cns 0.3.9 → 0.4.0

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
2
  SHA256:
3
- metadata.gz: '09ec6b41ad03d5c325247f93965f8b5678183511658e350ed66a748189d740f1'
4
- data.tar.gz: 1a0a33fab63109b9b0f5bc1d6942bd2a7d3df7267c73e665398675168324b211
3
+ metadata.gz: 334a8591863fae951394257a0438ee74c93dffcef41a6325bc52af78558db5b7
4
+ data.tar.gz: 273a4345c1496657d551f401482218d28a827321b42012b175b5fe7228ee0e82
5
5
  SHA512:
6
- metadata.gz: f09a8091f549786ece0d79ebccf2626d6c5bd03736b8967e1abd158753efda8a8e1c020366bee743e8aea29cdbbeab0015a8349bbdacc0ac7655866c432ad256
7
- data.tar.gz: 829489a9a52691fea47a509f99cc4347228f8665cf3d45b4fcaf5fbdff2a96d9d0d88dc7ee3929edc87de6d3f443f0d9e5214f2dbcf9ce9120f40984cccc0241
6
+ metadata.gz: 97c85c1c5a964348c13ddc21bbf2c9019b7188cf7e58c486410169957799a9ee6227e1830290fa7e09c4b264edc8e7a1c13ad92caa5c52344f57ef1d17212e63
7
+ data.tar.gz: e2957ba0cdd37b4c3a6c34296f7a011a10b3e0face33faab6b1884faaab8748d1bbec91d9a5c51fee9b3c8f76e4589565f31dcb447d05e781aeca95f40aa1905
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cns (0.3.9)
4
+ cns (0.4.0)
5
5
  curb
6
6
  faraday
7
7
  google-cloud-bigquery
data/lib/cns/etherscan.rb CHANGED
@@ -187,7 +187,7 @@ module Cns
187
187
  def mostra_resumo
188
188
  return unless dados.count.positive?
189
189
 
190
- puts("\nid address etherscan tn ti tb tk tw bigquery tn ti tb tk tw")
190
+ puts("\nid address etherscan tn ti tb tk tw bigquery tn ti tb tk tw")
191
191
  dados.each { |obj| puts(formata_carteira(obj)) }
192
192
  mostra_transacao_norml
193
193
  mostra_transacao_inter
@@ -201,9 +201,9 @@ module Cns
201
201
  # @return [String] texto formatado duma carteira
202
202
  def formata_carteira(hjn)
203
203
  format(
204
- '%<s1>-6.6s %<s2>-16.16s ',
204
+ '%<s1>-6.6s %<s2>-10.10s ',
205
205
  s1: hjn[:id],
206
- s2: formata_enderec1(hjn[:ax], 16)
206
+ s2: formata_enderec1(hjn[:ax], 10)
207
207
  ) + formata_valores(hjn)
208
208
  end
209
209
 
@@ -211,7 +211,7 @@ module Cns
211
211
  # @return [String] texto formatado valores duma carteira
212
212
  def formata_valores(hjn)
213
213
  format(
214
- '%<v1>12.6f %<n1>3i %<n2>2i %<n3>2i %<n4>2i %<w1>3i %<v2>12.6f %<n5>3i %<n6>2i %<n7>2i %<n8>2i %<w2>3i %<ok>-3s',
214
+ '%<v1>11.4f %<n1>3i %<n2>2i %<n3>2i %<n4>2i %<w1>3i %<v2>11.4f %<n5>3i %<n6>2i %<n7>2i %<n8>2i %<w2>3i %<ok>-3s',
215
215
  v1: hjn[:es],
216
216
  n1: hjn[:et].count,
217
217
  n2: hjn[:ei].count,
@@ -231,7 +231,7 @@ module Cns
231
231
  # @param (see formata_carteira)
232
232
  # @return [Boolean] carteira tem transacoes novas(sim=NOK, nao=OK)?
233
233
  def ok?(hjn)
234
- hjn[:bs].round(6) == hjn[:es].round(6) && hjn[:bt].count == hjn[:et].count && hjn[:bi].count == hjn[:ei].count && hjn[:bp].count == hjn[:ep].count && hjn[:bk].count == hjn[:ek].count && hjn[:bw].count == hjn[:ew].count
234
+ hjn[:bs].round(4) == hjn[:es].round(4) && hjn[:bt].count == hjn[:et].count && hjn[:bi].count == hjn[:ei].count && hjn[:bp].count == hjn[:ep].count && hjn[:bk].count == hjn[:ek].count && hjn[:bw].count == hjn[:ew].count
235
235
  end
236
236
 
237
237
  # @example ether address inicio..fim
@@ -243,7 +243,7 @@ module Cns
243
243
  return 'erro' if max < 7
244
244
 
245
245
  max -= 2
246
- ini = Integer(max / 2) + 3
246
+ ini = Integer(max / 2) + 4
247
247
  inf = max % 2
248
248
  "#{add[0, ini - 3]}..#{add[-inf - ini - 3..]}"
249
249
  end
data/lib/cns/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cns
4
- VERSION = '0.3.9'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hernâni Rodrigues Vaz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-17 00:00:00.000000000 Z
11
+ date: 2023-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler