Project

General

Profile

pp.patch

Patches the pp_hash method to emit "foo: " syntax for Symbol Hash keys - postmodern (Hal Brodigan), 01/24/2014 02:11 AM

View differences:

lib/pp.rb (working copy)
272 272
      group(1, '{', '}') {
273 273
        seplist(obj, nil, :each_pair) {|k, v|
274 274
          group {
275
            pp k
276
            text '=>'
275
            if Symbol === k && k =~ /\A\w+\z/
276
              text "#{k}: "
277
            else
278
              pp k
279
              text '=>'
280
            end
277 281
            group(1) {
278 282
              breakable ''
279 283
              pp v