marshal a Ruby object as Ruby code
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README
amarshal-pretty.rb
amarshal.rb
rubyexpression.rb
tst-marshal.rb
tst-pretty.rb
tst.rb

README

= amarshal - marshal a Ruby object as Ruby code

AMarshal is a library for marshaling a Ruby object as a Ruby code. It can
marshal objects which have cyclic reference.

== Author
Tanaka Akira <akr@fsij.org>

== Home Page
http://www.a-k-r.org/amarshal/

== Usage

AMarshal is similar to Marshal.

  % ruby -ramarshal -e 'AMarshal.dump([1,2,3], STDOUT)'
  v = []
  v[0] = Array.allocate()
  v[0] << 1
  v[0] << 2
  v[0] << 3
  v[0]

Highly experimental pretty printing version also exists:

  % ruby -ramarshal-pretty -e '
    o = [1,2]
    o << [[3], [[4]], [[[o]]]]
    o = [5, o, [[[o]]], o]
    AMarshal.dump_pretty(o, STDOUT)'
  v = []
  v[0] = Array.allocate
  v[0] << 1
  v[0] << 2
  v[0] << [[3], [[4]], [[[v[0]]]]]
  [5, v[0], [[[v[0]]]], v[0]]

== Requirements

* ruby 1.8.0 (2003-04-10) (older version doesn't work.)

== Download

* latest release: http://www.a-k-r.org/amarshal/amarshal-0.4.tar.gz

* development version: https://github.com/akr/amarshal