Sha256: 16ef1e728757d1e1497d41e94cd385d3e1fa5e6a35ae9fc5addb452e792280ab

Contents?: true

Size: 395 Bytes

Versions: 11

Compression:

Stored size: 395 Bytes

Contents

module BetterErrors
  module REPL
    class Basic
      def initialize(binding)
        @binding = binding
      end
    
      def send_input(str)
        [execute(str), ">>"]
      end
    
    private
      def execute(str)
        "=> #{@binding.eval(str).inspect}\n"
      rescue Exception => e
        "!! #{e.inspect rescue e.class.to_s rescue "Exception"}\n"
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
better_errors-0.9.0 lib/better_errors/repl/basic.rb
better_errors-0.8.0 lib/better_errors/repl/basic.rb
better_errors-0.7.2 lib/better_errors/repl/basic.rb
better_errors-0.7.0 lib/better_errors/repl/basic.rb
better_errors-0.6.0 lib/better_errors/repl/basic.rb
better_errors-0.5.0 lib/better_errors/repl/basic.rb
better_errors-0.3.2 lib/better_errors/repl/basic.rb
better_errors-0.3.0 lib/better_errors/repl/basic.rb
better_errors-0.2.0 lib/better_errors/repl/basic.rb
better_errors-0.1.1 lib/better_errors/repl/basic.rb
better_errors-0.1.0 lib/better_errors/repl/basic.rb