Skip to content

Instantly share code, notes, and snippets.

@NakedMoleRatScientist
Created December 19, 2013 16:46
Show Gist options
  • Save NakedMoleRatScientist/8042351 to your computer and use it in GitHub Desktop.
Save NakedMoleRatScientist/8042351 to your computer and use it in GitHub Desktop.
#Example line:
#{:name=>"-", :info=>{"name"=>"-", "downloads"=>5117, "version"=>"1", "version_downloads"=>5117, "platform"=>"ruby", "authors"=>"Ace Johnson", "info"=>"1", "licenses"=>nil, "project_uri"=>"http://rubygems.org/gems/-", "gem_uri"=>"http://rubygems.org/gems/--1.gem", "homepage_uri"=>nil, "wiki_uri"=>nil, "documentation_uri"=>nil, "mailing_list_uri"=>nil, "source_code_uri"=>nil, "bug_tracker_uri"=>nil, "dependencies"=>{"development"=>[], "runtime"=>[]}}, :versions=>[{"authors"=>"Ace Johnson", "built_at"=>"2010-04-10T07:00:00Z", "description"=>"1", "downloads_count"=>5117, "number"=>"1", "summary"=>"ace is the highest card", "platform"=>"ruby", "prerelease"=>false, "licenses"=>nil, "requirements"=>nil}], :dependencies=>[{:name=>"-", :number=>"1", :platform=>"ruby", :dependencies=>[]}]}
require "rubygems"
require "json"
file = File.open("test-data","r")
file.each_line do |l|
Marshal::load(l.strip())
end
#Error
#code/convert-to-json.rb:6:in `load': incompatible marshal file format (can't be read) (TypeError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment