afunai/ya2yaml — pull request #2 by camertron (2012-07-10 07:46:57+00:00)
Title: Adding an option to dump symbols in a more natural format

The current ya2yaml dump of a Ruby symbol looks like this:

`:batman.ya2yaml`
```
--- !ruby/symbol batman
```

While this works, it's a little hard on the eyes. Symbols as hash keys are even worse:

`{ :batman => "dark knight" }.ya2yaml`
```
---
? !ruby/symbol batman
: "dark knight"
```

The Ruby YAML parser knows how to deal with symbols natively using the colon syntax, so why not output them that way? This pull request adds an option to `#ya2yaml` called `:use_natural_symbols` that emits symbols prefixed by the more familiar colon:

`{ :batman => "dark knight" }.ya2yaml`
```
```