# File lib/pry/pry_class.rb, line 202 def self.view_clip(obj, options = {}) max = options.fetch :max_length, 60 id = options.fetch :id, false if obj.kind_of?(Module) && obj.name.to_s != "" && obj.name.to_s.length <= max obj.name.to_s elsif Pry.main == obj # special-case to support jruby. # fixed as of https://github.com/jruby/jruby/commit/d365ebd309cf9df3dde28f5eb36ea97056e0c039 # we can drop in the future. obj.to_s elsif Pry.config.prompt_safe_objects.any? { |v| v === obj } && obj.inspect.length <= max obj.inspect else id == true ? "#<#{obj.class}:0x%x>" % (obj.object_id << 1) : "#<#{obj.class}>" end rescue RescuableException "unknown" end