cryptum 0.0.385 → 0.0.386

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: 458a0c463a08f598e1694034fbf077f46a8ba8b263c408fd574b35211c40a69b
4
- data.tar.gz: 8b8bf8cf3ff0cd9dfa1ebb3609ad50e6f05d09aea705e726b840060e58d39c32
3
+ metadata.gz: 5326c18bca5498dc766a763307c15c2b10e2424417f70125c858d12b3dbe497d
4
+ data.tar.gz: bc48615fe7fc8794749031a1dc08417ca7945a534bee74f6fc592b2dcdd1c738
5
5
  SHA512:
6
- metadata.gz: 3963c369c745590402ff8943487eb057541b6eae6278cf67992981cbdb0919c847207fcfb43cac8b3cf991b5c1c866adc57035e6106a5715ed7f439ab4e92a8a
7
- data.tar.gz: d6abdb55f67bab96545d5207c9d4e995edcbec9d9a85d49b13e01a4a2d4522c5e9b20529460f1b2e20a10dad7f3dc2edfc78376215f85888b2278f5d0131582f
6
+ metadata.gz: e73499a8ed1543920e925621a76d94955ef772fa9ff8f7a7a80426487c1efc03d3dd0a9aad84bbfd06718b48f7ad70aad37dc5f409bda4eb93b22d2980ae9508
7
+ data.tar.gz: 0300f39bd3215071819f2eba942433927dedcd19e90125663afcb7e89b3e415b39627be1f24cda41eda79515d98ffd36fa4777473f5dacc0ce787b67bf9a87b6
data/Gemfile CHANGED
@@ -26,7 +26,7 @@ gem 'rdoc', '6.5.0'
26
26
  gem 'require_all', '3.0.0'
27
27
  gem 'rest-client', '2.1.0'
28
28
  gem 'rspec', '3.12.0'
29
- gem 'rubocop', '1.48.1'
29
+ gem 'rubocop', '1.49.0'
30
30
  gem 'rubocop-rake', '0.6.0'
31
31
  gem 'rubocop-rspec', '2.19.0'
32
32
  gem 'ruby-prof', '1.6.1'
data/bin/cryptum CHANGED
@@ -61,13 +61,17 @@ begin
61
61
  )
62
62
  rescue Interrupt
63
63
  # Exit Gracefully if CTRL+C is Pressed During Session
64
- Cryptum::UI::Exit.gracefully(
65
- which_self: self,
66
- event_history: event_history,
67
- option_choice: option_choice,
68
- env: env
69
- )
64
+ puts 'CTRL+C Detected...Good Bye.'
65
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
70
66
  rescue StandardError => e
71
67
  # Produce a Stacktrace for anything else
68
+ Curses.close_screen
72
69
  raise e
70
+ # TODO: everything should be returned to this
71
+ # single ensure block for exiting gracefully,
72
+ # however, that means event_history will need
73
+ # to be returned back to this driver prior to
74
+ # exit.
75
+ # ensure
76
+ # Cryptum::UI::Exit.gracefully(event_history: event_history)
73
77
  end
@@ -50,7 +50,6 @@ module Cryptum
50
50
  )
51
51
  rescue StandardError => e
52
52
  # Produce a Stacktrace for anything else
53
- Curses.close_screen
54
53
  raise e
55
54
  end
56
55
 
@@ -157,7 +156,6 @@ module Cryptum
157
156
  )
158
157
  rescue StandardError => e
159
158
  # Produce a Stacktrace for anything else
160
- Curses.close_screen
161
159
  raise e
162
160
  end
163
161
 
@@ -190,7 +188,6 @@ module Cryptum
190
188
  )
191
189
  rescue StandardError => e
192
190
  # Produce a Stacktrace for anything else
193
- Curses.close_screen
194
191
  raise e
195
192
  end
196
193
 
@@ -8,18 +8,9 @@ module Cryptum
8
8
  # Cryptum::Event::Exit.gracefully(
9
9
  # )
10
10
  public_class_method def self.gracefully(opts = {})
11
- terminal_win = opts[:terminal_win]
12
11
  event_history = opts[:event_history]
13
- option_choice = opts[:option_choice]
14
- env = opts[:env]
15
12
 
16
- terminal_win.key_press_event.key_x = false
17
- Cryptum::UI::Exit.gracefully(
18
- which_self: self,
19
- event_history: event_history,
20
- option_choice: option_choice,
21
- env: env
22
- )
13
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
23
14
  rescue StandardError => e
24
15
  raise e
25
16
  end
@@ -18,10 +18,9 @@ module Cryptum
18
18
 
19
19
  rescue Interrupt
20
20
  # Exit Gracefully if CTRL+C is Pressed During Session
21
- Cryptum::UI::Exit.gracefully(which_self: self)
21
+ Cryptum::UI::Exit.gracefully
22
22
  rescue StandardError => e
23
23
  # Produce a Stacktrace for anything else
24
- Curses.close_screen
25
24
  raise e
26
25
  end
27
26
  end
@@ -293,7 +293,7 @@ module Cryptum
293
293
  key_press_event.key_x
294
294
  rescue Interrupt
295
295
  # Exit Gracefully if CTRL+C is Pressed During Session
296
- Cryptum::UI::Exit.gracefully(which_self: self)
296
+ Cryptum::UI::Exit.gracefully
297
297
  rescue StandardError => e
298
298
  raise e
299
299
  end
@@ -5,32 +5,22 @@ module Cryptum
5
5
  # This Class is Used to Detect Key Press Events
6
6
  module Exit
7
7
  public_class_method def self.gracefully(opts = {})
8
- which_self = opts[:which_self]
9
8
  event_history = opts[:event_history]
10
- # option_choice = opts[:option_choice]
11
- # env = opts[:env]
12
-
13
- # Clear out candle data to ensure
14
- # Cryptum Statistics Only Apply to
15
- # Live Sessions
16
- if event_history
17
- File.write(
18
- order_book_file,
19
- JSON.pretty_generate(event_history.order_book)
20
- )
21
- end
22
9
 
23
10
  Curses.close_screen
24
- puts "Interrupt detected in #{which_self}...goodbye."
25
-
26
- exit 0
27
- rescue NameError
28
- puts "\nInterrupt detected in #{which_self}...goodbye."
29
11
 
30
12
  exit 0
31
13
  rescue StandardError => e
32
14
  # Produce a Stacktrace for anything else
33
15
  raise e
16
+ ensure
17
+ if event_history
18
+ order_book_file = event_history.order_book[:path]
19
+ File.write(
20
+ order_book_file,
21
+ JSON.pretty_generate(event_history.order_book)
22
+ )
23
+ end
34
24
  end
35
25
 
36
26
  # Display a List of Every UI Module
@@ -23,10 +23,9 @@ module Cryptum
23
23
 
24
24
  rescue Interrupt
25
25
  # Exit Gracefully if CTRL+C is Pressed During Session
26
- Cryptum::UI::Exit.gracefully(which_self: self)
26
+ Cryptum::UI::Exit.gracefully
27
27
  rescue StandardError => e
28
28
  # Produce a Stacktrace for anything else
29
- Curses.close_screen
30
29
  raise e
31
30
  end
32
31
 
@@ -55,10 +55,7 @@ module Cryptum
55
55
  event_history
56
56
  rescue Interrupt
57
57
  # Exit Gracefully if CTRL+C is Pressed During Session
58
- Cryptum::UI::Exit.gracefully(
59
- which_self: self,
60
- event_history: event_history
61
- )
58
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
62
59
  rescue StandardError => e
63
60
  raise e
64
61
  end
@@ -170,7 +170,7 @@ module Cryptum
170
170
  matrix_row += matrix_arr.sample
171
171
  rescue Interrupt
172
172
  # Exit Gracefully if CTRL+C is Pressed During Session
173
- Cryptum::UI::Exit.gracefully(which_self: self)
173
+ Cryptum::UI::Exit.gracefully
174
174
  rescue StandardError => e
175
175
  raise e
176
176
  end
@@ -601,12 +601,7 @@ module Cryptum
601
601
  event_history
602
602
  rescue Interrupt
603
603
  # Exit Gracefully if CTRL+C is Pressed During Session
604
- Cryptum::UI::Exit.gracefully(
605
- which_self: self,
606
- event_history: event_history,
607
- option_choice: option_choice,
608
- env: env
609
- )
604
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
610
605
  rescue StandardError => e
611
606
  raise e
612
607
  end
@@ -278,10 +278,7 @@ module Cryptum
278
278
  event_history
279
279
  rescue Interrupt
280
280
  # Exit Gracefully if CTRL+C is Pressed During Session
281
- Cryptum::UI::Exit.gracefully(
282
- which_self: self,
283
- event_history: event_history
284
- )
281
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
285
282
  rescue StandardError => e
286
283
  raise e
287
284
  end
@@ -493,11 +493,7 @@ module Cryptum
493
493
  event_history
494
494
  rescue Interrupt
495
495
  # Exit Gracefully if CTRL+C is Pressed During Session
496
- Cryptum::UI::Exit.gracefully(
497
- which_self: self,
498
- event_history: event_history,
499
- option_choice: option_choice
500
- )
496
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
501
497
  rescue StandardError => e
502
498
  raise e
503
499
  end
@@ -221,10 +221,7 @@ module Cryptum
221
221
  event_history
222
222
  rescue Interrupt
223
223
  # Exit Gracefully if CTRL+C is Pressed During Session
224
- Cryptum::UI::Exit.gracefully(
225
- which_self: self,
226
- event_history: event_history
227
- )
224
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
228
225
  rescue StandardError => e
229
226
  raise e
230
227
  end
@@ -117,11 +117,7 @@ module Cryptum
117
117
  order_countdown.to_f
118
118
  rescue Interrupt
119
119
  # Exit Gracefully if CTRL+C is Pressed During Session
120
- Cryptum::UI::Exit.gracefully(
121
- which_self: self,
122
- event_history: event_history,
123
- option_choice: option_choice
124
- )
120
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
125
121
  rescue StandardError => e
126
122
  raise e
127
123
  end
@@ -199,11 +199,7 @@ module Cryptum
199
199
  event_history
200
200
  rescue Interrupt
201
201
  # Exit Gracefully if CTRL+C is Pressed During Session
202
- Cryptum::UI::Exit.gracefully(
203
- which_self: self,
204
- event_history: event_history,
205
- option_choice: option_choice
206
- )
202
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
207
203
  rescue StandardError => e
208
204
  raise e
209
205
  end
@@ -87,7 +87,7 @@ module Cryptum
87
87
  indicator_status
88
88
  rescue Interrupt
89
89
  # Exit Gracefully if CTRL+C is Pressed During Session
90
- Cryptum::UI::Exit.gracefully(which_self: self)
90
+ Cryptum::UI::Exit.gracefully
91
91
  rescue StandardError => e
92
92
  raise e
93
93
  end
@@ -99,10 +99,9 @@ module Cryptum
99
99
  end
100
100
  rescue Interrupt
101
101
  # Exit Gracefully if CTRL+C is Pressed During Session
102
- Cryptum::UI::Exit.gracefully(which_self: self)
102
+ Cryptum::UI::Exit.gracefully
103
103
  rescue StandardError => e
104
104
  # Produce a Stacktrace for anything else
105
- Curses.close_screen
106
105
  raise e
107
106
  end
108
107
  end
@@ -297,10 +297,7 @@ module Cryptum
297
297
  event_history
298
298
  rescue Interrupt
299
299
  # Exit Gracefully if CTRL+C is Pressed During Session
300
- Cryptum::UI::Exit.gracefully(
301
- which_self: self,
302
- event_history: event_history
303
- )
300
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
304
301
  rescue StandardError => e
305
302
  raise e
306
303
  end
data/lib/cryptum/ui.rb CHANGED
@@ -48,7 +48,7 @@ module Cryptum
48
48
  Cryptum::UI::TerminalWindow.new
49
49
  rescue Interrupt
50
50
  # Exit Gracefully if CTRL+C is Pressed During Session
51
- Cryptum::UI::Exit.gracefully(which_self: self)
51
+ Cryptum::UI::Exit.gracefully
52
52
  rescue StandardError => e
53
53
  # Produce a Stacktrace for anything else
54
54
  Curses.close_screen
@@ -73,7 +73,7 @@ module Cryptum
73
73
  window
74
74
  rescue Interrupt
75
75
  # Exit Gracefully if CTRL+C is Pressed During Session
76
- Cryptum::UI::Exit.gracefully(which_self: self)
76
+ Cryptum::UI::Exit.gracefully
77
77
  rescue StandardError => e
78
78
  # Produce a Stacktrace for anything else
79
79
  Curses.close_screen
@@ -99,7 +99,7 @@ module Cryptum
99
99
  )
100
100
  rescue Interrupt
101
101
  # Exit Gracefully if CTRL+C is Pressed During Session
102
- Cryptum::UI::Exit.gracefully(which_self: self)
102
+ Cryptum::UI::Exit.gracefully
103
103
  rescue StandardError => e
104
104
  # Produce a Stacktrace for anything else
105
105
  Curses.close_screen
@@ -197,7 +197,7 @@ module Cryptum
197
197
  end
198
198
  rescue Interrupt
199
199
  # Exit Gracefully if CTRL+C is Pressed During Session
200
- Cryptum::UI::Exit.gracefully(which_self: self)
200
+ Cryptum::UI::Exit.gracefully
201
201
  rescue StandardError => e
202
202
  # Produce a Stacktrace for anything else
203
203
  Curses.close_screen
@@ -212,7 +212,7 @@ module Cryptum
212
212
  (Curses.cols / 2) - str_divided_by_two
213
213
  rescue Interrupt
214
214
  # Exit Gracefully if CTRL+C is Pressed During Session
215
- Cryptum::UI::Exit.gracefully(which_self: self)
215
+ Cryptum::UI::Exit.gracefully
216
216
  rescue StandardError => e
217
217
  # Produce a Stacktrace for anything else
218
218
  Curses.close_screen
@@ -223,7 +223,7 @@ module Cryptum
223
223
  0
224
224
  rescue Interrupt
225
225
  # Exit Gracefully if CTRL+C is Pressed During Session
226
- Cryptum::UI::Exit.gracefully(which_self: self)
226
+ Cryptum::UI::Exit.gracefully
227
227
  rescue StandardError => e
228
228
  # Produce a Stacktrace for anything else
229
229
  Curses.close_screen
@@ -235,7 +235,7 @@ module Cryptum
235
235
  (Curses.cols / 8) + 5
236
236
  rescue Interrupt
237
237
  # Exit Gracefully if CTRL+C is Pressed During Session
238
- Cryptum::UI::Exit.gracefully(which_self: self)
238
+ Cryptum::UI::Exit.gracefully
239
239
  rescue StandardError => e
240
240
  # Produce a Stacktrace for anything else
241
241
  Curses.close_screen
@@ -247,7 +247,7 @@ module Cryptum
247
247
  ((Curses.cols / 8) * 3) + 2
248
248
  rescue Interrupt
249
249
  # Exit Gracefully if CTRL+C is Pressed During Session
250
- Cryptum::UI::Exit.gracefully(which_self: self)
250
+ Cryptum::UI::Exit.gracefully
251
251
  rescue StandardError => e
252
252
  # Produce a Stacktrace for anything else
253
253
  Curses.close_screen
@@ -259,7 +259,7 @@ module Cryptum
259
259
  ((Curses.cols / 4) * 3) - 3
260
260
  rescue Interrupt
261
261
  # Exit Gracefully if CTRL+C is Pressed During Session
262
- Cryptum::UI::Exit.gracefully(which_self: self)
262
+ Cryptum::UI::Exit.gracefully
263
263
  rescue StandardError => e
264
264
  # Produce a Stacktrace for anything else
265
265
  Curses.close_screen
@@ -322,7 +322,7 @@ module Cryptum
322
322
  key_press_event
323
323
  rescue Interrupt
324
324
  # Exit Gracefully if CTRL+C is Pressed During Session
325
- Cryptum::UI::Exit.gracefully(which_self: self)
325
+ Cryptum::UI::Exit.gracefully
326
326
  rescue StandardError => e
327
327
  # Produce a Stacktrace for anything else
328
328
  Curses.close_screen
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptum
4
- VERSION = '0.0.385'
4
+ VERSION = '0.0.386'
5
5
  end
@@ -50,7 +50,7 @@ module Cryptum
50
50
  ws
51
51
  rescue Interrupt
52
52
  # Exit Gracefully if CTRL+C is Pressed During Session
53
- Cryptum::UI::Exit.gracefully(which_self: self)
53
+ Cryptum::UI::Exit.gracefully
54
54
  rescue StandardError => e
55
55
  raise e
56
56
  end
@@ -114,14 +114,7 @@ module Cryptum
114
114
  end
115
115
 
116
116
  # Exit if x is Pressed
117
- if terminal_win.key_press_event.key_x
118
- Cryptum::Event::Exit.gracefully(
119
- terminal_win: terminal_win,
120
- event_history: event_history,
121
- option_choice: option_choice,
122
- env: env
123
- )
124
- end
117
+ Cryptum::Event::Exit.gracefully(event_history: event_history) if terminal_win.key_press_event.key_x
125
118
 
126
119
  # TAB through Order Plan / Order Execution Window Panes
127
120
  if terminal_win.key_press_event.key_tab
@@ -252,12 +245,7 @@ module Cryptum
252
245
  end
253
246
  rescue Interrupt
254
247
  # Exit Gracefully if CTRL+C is Pressed During Session
255
- Cryptum::UI::Exit.gracefully(
256
- which_self: self,
257
- event_history: event_history,
258
- option_choice: option_choice,
259
- env: env
260
- )
248
+ Cryptum::UI::Exit.gracefully(event_history: event_history)
261
249
  rescue StandardError => e
262
250
  raise e
263
251
  end
data/lib/cryptum.rb CHANGED
@@ -93,7 +93,6 @@ module Cryptum
93
93
  Cryptum.exit_gracefully(which_self: self)
94
94
  rescue StandardError => e
95
95
  # Produce a Stacktrace for anything else
96
- Curses.close_screen
97
96
  raise e
98
97
  end
99
98
 
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.385
4
+ version: 0.0.386
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-01 00:00:00.000000000 Z
11
+ date: 2023-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - '='
228
228
  - !ruby/object:Gem::Version
229
- version: 1.48.1
229
+ version: 1.49.0
230
230
  type: :runtime
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - '='
235
235
  - !ruby/object:Gem::Version
236
- version: 1.48.1
236
+ version: 1.49.0
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: rubocop-rake
239
239
  requirement: !ruby/object:Gem::Requirement