# Data::Dumper Request

**URL:** <https://www.ruby-forum.com/t/data-dumper-request/192769>\
**Category:** Ruby\
**Created:** [August 5, 2010, 10:08am UTC](https://www.ruby-forum.com/t/data-dumper-request/192769 "2010-08-05T10:08:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brentmc79](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@brentmc79](https://www.ruby-forum.com/u/brentmc79)\
**Post date:** [August 5, 2010, 10:08am UTC](https://www.ruby-forum.com/t/data-dumper-request/192769/1 "2010-08-05T10:08:15Z")

</div>

Hiya

I know we can use JSON, YAML, Marshal etc for representation of the  
data.

Personally I find the above solutions clunky.

I would do the job if I could (Still learning Ruby), but im hoping with  
the spirit of open source and communities, I would like to plead with  
community for someone to please release a gem like perls Data::Dumper.

Hope someone would be so kind as to give me request some thought.

Kind Regards  
Brent C.

---

<div class="post-metadata">

**Author:** ![brentmc79](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@brentmc79](https://www.ruby-forum.com/u/brentmc79)\
**Post date:** [August 5, 2010, 5:14pm UTC](https://www.ruby-forum.com/t/data-dumper-request/192769/2 "2010-08-05T17:14:21Z")

</div>

Brent C. wrote:

> Hiya
> 
> I know we can use JSON, YAML, Marshal etc for representation of the  
> data.
> 
> Personally I find the above solutions clunky.
> 
> I would do the job if I could (Still learning Ruby), but im hoping with  
> the spirit of open source and communities, I would like to plead with  
> community for someone to please release a gem like perls Data::Dumper.

you can try

> > print a.inspect

or

> > p a # same thing

or

> > require ‘pp’  
> > pp a

Do these scratch your itch?  
-r

---

<div class="post-metadata">

**Author:** ![brentmc79](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@brentmc79](https://www.ruby-forum.com/u/brentmc79)\
**Post date:** [August 6, 2010, 4:30am UTC](https://www.ruby-forum.com/t/data-dumper-request/192769/3 "2010-08-06T04:30:46Z")

</div>

On 8/5/10, Brent C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hope someone would be so kind as to give me request some thought.  
> I wrote a gem called Ron (note capitalization; if you use lowercase  
> spelling, you’ll get something else) which serializes ruby data  
> structures as ruby code which can be eval’d to get back the original  
> data. Seems to be exactly what you’re asking for.

There’s also amarshal, which serializes ruby data as ruby code that  
reconstructs it, but it’s not as declarative (it emits a series of  
statements which reconstruct the object, instead of a single  
expression) and therefore (IMNSHO) not as pretty.

---

<div class="post-metadata">

**Author:** ![brentmc79](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@brentmc79](https://www.ruby-forum.com/u/brentmc79)\
**Post date:** [August 8, 2010, 9:23am UTC](https://www.ruby-forum.com/t/data-dumper-request/192769/4 "2010-08-08T09:23:16Z")

</div>

On Thursday, August 05, 2010 03:07:39 am Brent C. wrote:

> Hiya
> 
> I know we can use JSON, YAML, Marshal etc for representation of the data.
> 
> Personally I find the above solutions clunky.

How so?

I mainly used Dumper in Perl for two reasons:

- I wasn’t aware of easy options for JSON/YAML/etc for storing data.
- I wanted to see what was actually going on in my objects.

So I’m curious, because I prefer the above solutions to something  
executable  
for the purposes of data storage and transfer – the only place I’d  
prefer  
this is when #inspect isn’t doing a good enough job for investigating  
stuff in  
irb.
