lib/cryptum.rb in cryptum-0.0.315 vs lib/cryptum.rb in cryptum-0.0.316
- old
+ new
@@ -59,71 +59,10 @@
public_class_method def self.flat_arrow
'_'
end
- # Deserialize Cryptum Bot Conf
- public_class_method def self.read_bot_conf(opts = {})
- option_choice = opts[:option_choice]
-
- bot_conf_file = "#{option_choice.repo_root}/etc/bot_confs/#{option_choice.symbol}_bot_conf.yaml"
- unless File.exist?(bot_conf_file)
- FileUtils.cp(
- "#{option_choice.repo_root}/etc/bot_confs/BOT_CONF.TEMPLATE",
- bot_conf_file
- )
- end
-
- YAML.load_file(
- bot_conf_file,
- symbolize_names: true
- )
- rescue Errno::ENOENT, NoMethodError => e
- File.open('/tmp/cryptum-errors.txt', 'a') do |f|
- f.puts Time.now.strftime('%Y-%m-%d %H:%M:%S.%N %z')
- f.puts "Module: #{self}"
- f.puts "#{e}\n\n\n"
- end
-
- retry
- rescue Interrupt
- # Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
- rescue StandardError => e
- # Produce a Stacktrace for anything else
- Curses.close_screen
- raise e
- end
-
- # Update Key/Value Pair in Bot Conf and Serialize to YAML File
- public_class_method def self.update_bot_conf_key(opts = {})
- option_choice = opts[:option_choice]
- bot_conf = opts[:bot_conf]
- key = opts[:key].to_s.to_sym
- value = opts[:value]
-
- bot_conf_file = "#{option_choice.repo_root}/etc/bot_confs/#{option_choice.symbol}_bot_conf.yaml"
-
- bot_conf[key] = value
- File.write(bot_conf_file, bot_conf.to_yaml)
- rescue Errno::ENOENT, NoMethodError => e
- File.open('/tmp/cryptum-errors.txt', 'a') do |f|
- f.puts Time.now.strftime('%Y-%m-%d %H:%M:%S.%N %z')
- f.puts "Module: #{self}"
- f.puts "#{e}\n\n\n"
- end
-
- retry
- rescue Interrupt
- # Exit Gracefully if CTRL+C is Pressed During Session
- Cryptum.exit_gracefully(which_self: self)
- rescue StandardError => e
- # Produce a Stacktrace for anything else
- Curses.close_screen
- raise e
- end
-
- # Update Key/Value Pair in Bot Conf and Serialize to YAML File
+ # Add Commas to Large Numbers to Make it Easier to Read
public_class_method def self.beautify_large_number(opts = {})
value = opts[:value].to_s
split_str_num = value.split('.')
whole_num = split_str_num.first