diff options
Diffstat (limited to 'controllers/interfaces')
-rw-r--r-- | controllers/interfaces/eval.rb | 6 | ||||
-rw-r--r-- | controllers/interfaces/repl.rb | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/controllers/interfaces/eval.rb b/controllers/interfaces/eval.rb index 6cb12b4..af519ab 100644 --- a/controllers/interfaces/eval.rb +++ b/controllers/interfaces/eval.rb @@ -21,14 +21,16 @@ module NanoBot end def self.build_prefix(cartridge) - eval_interface = Logic::Helpers::Hash.fetch(cartridge, %i[interfaces eval]) + eval_interface = Logic::Helpers::Hash.fetch(cartridge, %i[interfaces eval]) return nil if eval_interface.nil? + eval_interface[:prefix] end def self.build_postfix(cartridge) - eval_interface = Logic::Helpers::Hash.fetch(cartridge, %i[interfaces eval]) + eval_interface = Logic::Helpers::Hash.fetch(cartridge, %i[interfaces eval]) return "\n" if eval_interface.nil? || !eval_interface.key?(:postfix) # default + eval_interface[:postfix] end end diff --git a/controllers/interfaces/repl.rb b/controllers/interfaces/repl.rb index 5477c33..9415674 100644 --- a/controllers/interfaces/repl.rb +++ b/controllers/interfaces/repl.rb @@ -40,14 +40,16 @@ module NanoBot end def self.build_prefix(cartridge) - repl = Logic::Helpers::Hash.fetch(cartridge, %i[interfaces repl]) + repl = Logic::Helpers::Hash.fetch(cartridge, %i[interfaces repl]) return "\n" if repl.nil? || !repl.key?(:prefix) # default + repl[:prefix] end def self.build_postfix(cartridge) - repl = Logic::Helpers::Hash.fetch(cartridge, %i[interfaces repl]) + repl = Logic::Helpers::Hash.fetch(cartridge, %i[interfaces repl]) return "\n" if repl.nil? || !repl.key?(:postfix) # default + repl[:postfix] end @@ -63,9 +65,9 @@ module NanoBot end end elsif prompt.is_a?(String) - result = prompt + result = prompt else - result = '🤖' + Rainbow('> ').blue + result = "🤖#{Rainbow('> ').blue}" end result |