cns 0.4.0 → 0.4.1

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: 334a8591863fae951394257a0438ee74c93dffcef41a6325bc52af78558db5b7
4
- data.tar.gz: 273a4345c1496657d551f401482218d28a827321b42012b175b5fe7228ee0e82
3
+ metadata.gz: 7ade5495375425e6c5f292f2333785f17246ab1d54b0492830e2d61fe1d6d88e
4
+ data.tar.gz: 8781b2c9d6b6885496b4ececf3766b626b88720122443a280d57c9281ea8d250
5
5
  SHA512:
6
- metadata.gz: 97c85c1c5a964348c13ddc21bbf2c9019b7188cf7e58c486410169957799a9ee6227e1830290fa7e09c4b264edc8e7a1c13ad92caa5c52344f57ef1d17212e63
7
- data.tar.gz: e2957ba0cdd37b4c3a6c34296f7a011a10b3e0face33faab6b1884faaab8748d1bbec91d9a5c51fee9b3c8f76e4589565f31dcb447d05e781aeca95f40aa1905
6
+ metadata.gz: 5bc3e8f04510a917f5e8d7f150b86f73a3ca22f5f7da041f61b00113838723d6b1e089c919914e04653af40e837a836460bd6b347ae93c544a32c8bc8a2d33ab
7
+ data.tar.gz: 5a5f0b86db6d8688f2abc96ea82ae0ecf416cd35e1e64cb04160a2184cc33b351bd084e70f4f7979629e74f613c8e93ec012146281847cbe611273e69a8c46ec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cns (0.4.0)
4
+ cns (0.4.1)
5
5
  curb
6
6
  faraday
7
7
  google-cloud-bigquery
@@ -23,9 +23,9 @@ GEM
23
23
  faraday-net_http (>= 2.0, < 3.1)
24
24
  ruby2_keywords (>= 0.0.4)
25
25
  faraday-net_http (3.0.2)
26
- google-apis-bigquery_v2 (0.56.0)
26
+ google-apis-bigquery_v2 (0.57.0)
27
27
  google-apis-core (>= 0.11.0, < 2.a)
28
- google-apis-core (0.11.0)
28
+ google-apis-core (0.11.1)
29
29
  addressable (~> 2.5, >= 2.5.1)
30
30
  googleauth (>= 0.16.2, < 2.a)
31
31
  httpclient (>= 2.8.1, < 3.a)
@@ -46,7 +46,7 @@ GEM
46
46
  google-cloud-env (1.6.0)
47
47
  faraday (>= 0.17.3, < 3.0)
48
48
  google-cloud-errors (1.3.1)
49
- googleauth (1.6.0)
49
+ googleauth (1.7.0)
50
50
  faraday (>= 0.17.3, < 3.a)
51
51
  jwt (>= 1.4, < 3.0)
52
52
  memoist (~> 0.16)
@@ -88,7 +88,7 @@ GEM
88
88
  retriable (3.1.2)
89
89
  reverse_markdown (2.1.1)
90
90
  nokogiri
91
- rexml (3.2.5)
91
+ rexml (3.2.6)
92
92
  rubocop (1.7.0)
93
93
  parallel (~> 1.10)
94
94
  parser (>= 2.7.1.5)
data/lib/cns/bitcoinde.rb CHANGED
@@ -38,7 +38,7 @@ module Cns
38
38
  # @return [String] texto saldos & transacoes & ajuste dias
39
39
  def mostra_resumo
40
40
  puts("\nBITCOINDE\ntipo bitcoinde bigquery")
41
- exd[:sl].each { |key, val| puts(formata_saldos(key, val)) }
41
+ exd[:sl].sort { |ant, prx| ant <=> prx }.each { |key, val| puts(formata_saldos(key, val)) }
42
42
  mostra_totais
43
43
 
44
44
  mostra_trades
@@ -72,8 +72,8 @@ module Cns
72
72
  # @param [Hash] hsx saldo bitcoinde da moeda
73
73
  # @return [String] texto formatado saldos
74
74
  def formata_saldos(moe, hsx)
75
- vbq = bqd[:sl][moe.downcase.to_sym].to_d
76
- vex = hsx[:total_amount].to_d
75
+ vbq = bqd[:sl][moe.downcase.to_sym].to_d.round(9)
76
+ vex = hsx[:total_amount].to_d.round(9)
77
77
  format(
78
78
  '%<mo>-5.5s %<ex>21.9f %<bq>21.9f %<ok>3.3s',
79
79
  mo: moe.upcase,
data/lib/cns/kraken.rb CHANGED
@@ -38,7 +38,7 @@ module Cns
38
38
  # @return [String] texto saldos & transacoes & ajuste dias
39
39
  def mostra_resumo
40
40
  puts("\nKRAKEN\ntipo kraken bigquery")
41
- exd[:sl].each { |key, val| puts(formata_saldos(key, val)) }
41
+ exd[:sl].sort { |ant, prx| ant <=> prx }.each { |key, val| puts(formata_saldos(key, val)) }
42
42
  mostra_totais
43
43
 
44
44
  mostra_trades
@@ -72,8 +72,8 @@ module Cns
72
72
  # @param [BigDecimal] sal saldo kraken da moeda
73
73
  # @return [String] texto formatado saldos
74
74
  def formata_saldos(moe, sal)
75
- vbq = bqd[:sl][moe.downcase.to_sym].to_d
76
- vsl = sal.to_d
75
+ vbq = bqd[:sl][moe.downcase.to_sym].to_d.round(9)
76
+ vsl = sal.to_d.round(9)
77
77
  format(
78
78
  '%<mo>-5.5s %<kr>21.9f %<bq>21.9f %<ok>3.3s',
79
79
  mo: moe.upcase,
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.4.0'
4
+ VERSION = '0.4.1'
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.4.0
4
+ version: 0.4.1
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-18 00:00:00.000000000 Z
11
+ date: 2023-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler