cryptum 0.0.302 → 0.0.304

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: d94e7dec4dd43fc5e867d337bdbb0d026fcea3fedeabf6caf3b13b933d4970af
4
- data.tar.gz: bf56ad4e8b6f7174c24edf007b18a441da67cc9582bedc830e55fe4fd8ea3f8c
3
+ metadata.gz: b37f8bc5a291c5835e20e3aed98f9a335eec5205ccd33a300936d453c4551a82
4
+ data.tar.gz: fbf92d12bf47308bbc4f3dd4ace134c6758a24e686777d7aa2c5ca86fe06e934
5
5
  SHA512:
6
- metadata.gz: 0a8ceee4b2b70baa2214dece9afeaaf239f81e4f982bb93fa32cba7096d944a868ecd1833ea5f18693c34d4b327320e2a2a9519bb1929ae73d87bb20e7848631
7
- data.tar.gz: fccd07d4fb586c20a893fcedf923fb12862895934db9fb9f1b3ad7c4dbad8020e43a5927541947a78df0846849703209b739308a0859fc814c58b3829a4def4c
6
+ metadata.gz: 794d011d2d13d98cf16a80a403d331b5a812a24e5a3a4dad3beb23dffe2cb4c5da5b4b37ab93b1d08c2106c1b59c6858a0efec54ab55ca384e6cb7f5a051b960
7
+ data.tar.gz: 66c6ddc051add4700c0917740aefe95a699ea8c1d1da72106410b7c1a65adce46497ffcc981ce9b018830b2a9e6d1bfc4ed23d915165a9d8779f01a152d82a13
data/.rubocop_todo.yml CHANGED
@@ -1,12 +1,12 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-12-08 23:40:45 UTC using RuboCop version 1.40.0.
3
+ # on 2022-12-08 23:59:51 UTC using RuboCop version 1.40.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 89
9
+ # Offense count: 88
10
10
  Lint/UselessAssignment:
11
11
  Enabled: false
12
12
 
@@ -20,6 +20,15 @@ Style/ConditionalAssignment:
20
20
  - 'lib/cryptum/option.rb'
21
21
  - 'lib/cryptum/ui/order_execute_details.rb'
22
22
 
23
+ # Offense count: 2
24
+ # This cop supports unsafe autocorrection (--autocorrect-all).
25
+ # Configuration parameters: EnforcedStyle.
26
+ # SupportedStyles: left_coerce, right_coerce, single_coerce, fdiv
27
+ Style/FloatDivision:
28
+ Exclude:
29
+ - 'lib/cryptum/ui/order_plan.rb'
30
+ - 'lib/cryptum/ui/portfolio.rb'
31
+
23
32
  # Offense count: 2
24
33
  # This cop supports safe autocorrection (--autocorrect).
25
34
  Style/RedundantAssignment:
@@ -413,11 +413,12 @@ module Cryptum
413
413
  )
414
414
 
415
415
  # ROWS 3-10
416
+ remaining_blank_rows = 0
417
+ remaining_blank_rows = max_rows_to_display if order_history_meta.empty?
416
418
  max_rows_to_display = event_history.order_execute_max_rows_to_display
417
419
  max_records_available_to_display = event_history.order_execute_max_records_available_to_display
418
420
  first_row = event_history.order_execute_index_offset
419
421
  last_row = first_row + max_rows_to_display
420
- remaining_blank_rows = 0
421
422
  if last_row >= order_history_meta.length
422
423
  last_row = order_history_meta.length - 1
423
424
  event_history.order_execute_max_records_available_to_display = last_row if last_row < max_rows_to_display
@@ -75,13 +75,9 @@ module Cryptum
75
75
  balance.to_f * ticker_price
76
76
  )
77
77
 
78
- # crypto_invested_percent = format(
79
- # '%0.2f',
80
- # (current_crypto_fiat_value.to_f / total_holdings.to_f) * 100
81
- # )
82
78
  crypto_invested_percent = format(
83
79
  '%0.2f',
84
- current_crypto_fiat_value.to_f.fdiv(total_holdings.to_f) * 100
80
+ (current_crypto_fiat_value.to_f / total_holdings.to_f) * 100
85
81
  )
86
82
 
87
83
  event_history.red_pill = true if crypto_invested_percent.to_f > autotrade_percent
@@ -259,6 +255,8 @@ module Cryptum
259
255
  )
260
256
 
261
257
  # ROWS 3-10
258
+ remaining_blank_rows = 0
259
+ # remaining_blank_rows = max_rows_to_display if order_plan.empty?
262
260
  if event_history.red_pill
263
261
  out_line_no += 1
264
262
  order_plan_win.setpos(out_line_no, Cryptum::UI.col_first)
@@ -340,7 +338,6 @@ module Cryptum
340
338
  max_records_available_to_display = event_history.order_plan_max_records_available_to_display
341
339
  first_row = event_history.order_plan_index_offset
342
340
  last_row = first_row + max_rows_to_display
343
- remaining_blank_rows = 0
344
341
  if last_row >= order_plan.length
345
342
  last_row = order_plan.length - 1
346
343
  event_history.order_plan_max_records_available_to_display = last_row if last_row < max_rows_to_display
@@ -95,13 +95,9 @@ module Cryptum
95
95
  (1 - (fiat_budget / total_holdings.to_f)) * 100
96
96
  )
97
97
 
98
- # crypto_invested_percent = format(
99
- # '%0.2f',
100
- # (current_crypto_fiat_value.to_f / total_holdings.to_f) * 100
101
- # )
102
98
  crypto_invested_percent = format(
103
99
  '%0.2f',
104
- current_crypto_fiat_value.to_f.fdiv(total_holdings.to_f) * 100
100
+ (current_crypto_fiat_value.to_f / total_holdings.to_f) * 100
105
101
  )
106
102
  # TODO: Everything Above this Line Needs to be Indicators ^
107
103
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.302'
4
+ VERSION = '0.0.304'
5
5
  end
data/lib/cryptum.rb CHANGED
@@ -137,6 +137,8 @@ module Cryptum
137
137
  beautify_whole = whole_num.reverse.scan(/.{1,3}/).join(',').reverse
138
138
  beautify_num = "#{beautify_whole}.#{fraction}" unless is_negative
139
139
  beautify_num = "-#{beautify_whole}.#{fraction}" if is_negative
140
+
141
+ beautify_num
140
142
  rescue Interrupt
141
143
  # Exit Gracefully if CTRL+C is Pressed During Session
142
144
  Cryptum.exit_gracefully(which_self: self)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.302
4
+ version: 0.0.304
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-08 00:00:00.000000000 Z
11
+ date: 2022-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable