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

Will the new Hash syntax be supported? #126

Closed dolzenko closed 8 years ago

dolzenko commented 11 years ago

Subject. Sorry if already discussed. I think it could be optional too (probably only trigger if all keys in a hash are Symbols)

chee commented 10 years ago

+1

cheshire137 commented 10 years ago

+1

waldyr commented 8 years ago

After almost two years it is implemented now on https://github.com/awesome-print/awesome_print/commit/239c990a1325f403f93112ff872e31c21f6c8784

NullVoxPopuli commented 7 years ago

I was looking for how to print the non hash-rocket hashes, and.... am I doing it right?

> ap({a: :b}, { new_hash_syntax: true}) 
{
    :a => :b
}

that's printing the old way, where I'd expect it to print

{
  a: :b
}

Using:

$ irb
irb(main):001:0> require 'awesome_print'
=> true
irb(main):002:0> AwesomePrint.version
=> "1.8.0"
waldyr commented 7 years ago

@NullVoxPopuli try

ap({a: :b}, ruby19_syntax: true)
tanduong commented 6 years ago

This is not working!

> ap({a: 1}, ruby19_syntax: true)
{
  :a => 1
}
tanduong commented 6 years ago

Oh, it works with version 1.8!