lib/arql/repl.rb in arql-0.1.32 vs lib/arql/repl.rb in arql-0.1.33

- old
+ new

@@ -5,11 +5,11 @@ module Arql class Repl def initialize Pry.config.prompt = Pry::Prompt.new("", "", prompt) - main_object.pry + Pry.start end def main_object return @main if @main @main = Object.new @@ -27,10 +27,14 @@ def prompt [proc do |obj, nest_level, _| if obj == main_object && nest_level == 0 nest_level_prompt = '' else - nest_level_prompt = "(#{obj}:#{nest_level})" + nest_level_prompt = if nest_level.zero? + "(#{obj})" + else + "(#{obj}:#{nest_level})" + end end "%s#{Rainbow('@').green}%s#{nest_level_prompt} %s " % [Rainbow('ARQL').red, Rainbow(App.prompt).yellow, Rainbow('❯').green] end] end end