lib/cryptum/ui.rb in cryptum-0.0.381 vs lib/cryptum/ui.rb in cryptum-0.0.382
- old
+ new
@@ -5,22 +5,24 @@
module Cryptum
# Cryptum::UI Module used for Presenting the
# Cryptum Curses Interface
module UI
+ require 'cryptum/ui/command'
+ require 'cryptum/ui/exit'
require 'cryptum/ui/key_press_event'
- require 'cryptum/ui/terminal_window'
- require 'cryptum/ui/ticker'
- require 'cryptum/ui/portfolio'
+ require 'cryptum/ui/market_trend'
+ require 'cryptum/ui/matrix'
+ require 'cryptum/ui/order_execution'
+ require 'cryptum/ui/order_execute_details'
require 'cryptum/ui/order_plan'
require 'cryptum/ui/order_plan_details'
require 'cryptum/ui/order_timer'
- require 'cryptum/ui/market_trend'
+ require 'cryptum/ui/portfolio'
require 'cryptum/ui/signal_engine'
- require 'cryptum/ui/order_execution'
- require 'cryptum/ui/order_execute_details'
- require 'cryptum/ui/command'
+ require 'cryptum/ui/terminal_window'
+ require 'cryptum/ui/ticker'
# Initialize the UI
public_class_method def self.init
# Initialize curses Screen
Curses.init_screen
@@ -51,11 +53,11 @@
# This object is used to pass all of the UI sections
# around to various Cryptum modules
Cryptum::UI::TerminalWindow.new
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end
@@ -76,11 +78,11 @@
window.nodelay = true
window
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end
@@ -102,11 +104,11 @@
style: style,
string: "\u2500" * Curses.cols
)
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end
@@ -200,11 +202,11 @@
ui_win.attron(Curses.color_pair(color_id) | font) do
ui_win.addstr(string)
end
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end
@@ -215,22 +217,22 @@
str_divided_by_two = str.length / 2
(Curses.cols / 2) - str_divided_by_two
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end
public_class_method def self.col_first
0
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end
@@ -238,11 +240,11 @@
# Jump to Second Column
public_class_method def self.col_second
(Curses.cols / 8) + 5
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end
@@ -250,11 +252,11 @@
# Jump to Third Column
public_class_method def self.col_third
((Curses.cols / 8) * 3) + 2
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end
@@ -262,11 +264,11 @@
# Jump to Fourth Column
public_class_method def self.col_fourth
((Curses.cols / 4) * 3) - 3
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end
@@ -325,10 +327,10 @@
end
key_press_event
rescue Interrupt
# Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
+ Cryptum::UI::Exit.gracefully(which_self: self)
rescue StandardError => e
# Produce a Stacktrace for anything else
Curses.close_screen
raise e
end