awesome-print / awesome_print

Pretty print your Ruby objects with style -- in full color and with proper indentation
http://github.com/michaeldv/awesome_print
MIT License
4.08k stars 454 forks source link

V2: uninitialized constant AwesomePrint::Formatters::SetFormatter::Set #351

Open sshaw opened 5 years ago

sshaw commented 5 years ago

2.0.0.pre2:

~ >ruby -rawesome_print -e'ap({:a => 1})'
/Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatters/set_formatter.rb:10:in `formattable?': uninitialized constant AwesomePrint::Formatters::SetFormatter::Set (NameError)
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatter.rb:49:in `block in format'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatter.rb:44:in `each'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatter.rb:44:in `format'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/inspector.rb:118:in `unnested'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/inspector.rb:76:in `awesome'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatters/hash_formatter.rb:96:in `pre_ruby19_syntax'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatters/hash_formatter.rb:56:in `block (2 levels) in printable_hash'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/indentator.rb:13:in `indent'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/inspector.rb:65:in `increase_indentation'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatters/base_formatter.rb:80:in `indented'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatters/hash_formatter.rb:52:in `block in printable_hash'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatters/hash_formatter.rb:51:in `map!'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatters/hash_formatter.rb:51:in `printable_hash'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatters/hash_formatter.rb:40:in `multiline_hash'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatters/hash_formatter.rb:23:in `format'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/formatter.rb:41:in `format'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/inspector.rb:118:in `unnested'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/inspector.rb:76:in `awesome'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/core_ext/kernel.rb:5:in `ai'
    from /Users/sshaw/.rvm/gems/ruby-2.3.7/gems/awesome_print-2.0.0.pre2/lib/awesome_print/core_ext/kernel.rb:15:in `ap'
    from -e:1:in `<main>'
sshaw commented 5 years ago

Looks like set_formatter.rb needs to require "set".

imajes commented 5 years ago

huh that's interesting. what ruby version? I thought set is automatically required.

sshaw commented 5 years ago

ruby-2.3.7.

Nothing in stdlib (https://ruby-doc.org/stdlib-2.6/) is automatically required.