Last active
December 16, 2015 04:49
-
-
Save cstorey/5380150 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'hamster/hash' | |
original = Hamster.hash :foo => 42 | |
dumped = Marshal.dump(original) | |
undumped = Marshal.load(dumped) | |
STDERR.puts undumped[:foo] | |
STDOUT.puts dumped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Current results: | |
: cez@Ceri-no-Mac-mini; ruby dump.rb|ruby load.rb | |
42 | |
From load: | |
: cez@Ceri-no-Mac-mini; | |
Expected results: | |
: cez@Ceri-no-Mac-mini; ruby dump.rb|ruby load.rb | |
42 | |
From load: | |
42 | |
: cez@Ceri-no-Mac-mini; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'hamster/hash' | |
undumped = Marshal.load(STDIN) | |
STDERR.puts "From load: "; | |
STDERR.puts undumped[:foo] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment