Skip to content

Instantly share code, notes, and snippets.

@nevyn
Created July 14, 2010 15:40
Show Gist options
  • Save nevyn/475589 to your computer and use it in GitHub Desktop.
Save nevyn/475589 to your computer and use it in GitHub Desktop.
#!/usr/bin/env macruby
Dir["*.plist"].each { |f|
d = NSDictionary.dictionaryWithContentsOfFile(f)
cr = d["description"]
cr.writeToFile(f+".crash", atomically:false)
}
# Could probably use ARGF too
@ashebanow
Copy link

Yea, its pretty cool. FWIW, I prefer using Hash to NSDictionary, since you get all the Ruby goodness on top of the NSDictionary api:

    plist = Hash.dictionaryWithContentsOfFile("info.plist")

@robrix
Copy link

robrix commented Jul 16, 2010

I hope they ship MacRuby with 10.7 “Ceiling Cat”. It’s brilliant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment