I’ve just released my very first library, plist. Well, it’s not really mine as such. Here’s the deal:

A few months ago, I started to write a property list generator. I had done a gem search and come up dry, but didn’t think to check RubyForge. Long story short, there was already a plist gem, part of the NARF project. Emails were sent and it came to be that Patrick May, author of NARF, and I would combine our efforts under the plist project I had registered at RubyForge. And so it was.

I just posted and announced the first major release since the merge, 3.0.0. This is effectively the existing NARF plist code, with its generation code replaced with mine. There are other changes, but that’s the big one.

This is the first time I’ve worked on a project with a developer that I didn’t know personally, and it’s been a big learning experience. I’d bet Patrick would agree, as would anyone who read our emails. But it’s been good, and we now have a product to show for it.

Most importantly to me, though, is that I can finally quit using “BUT PLIST IS B0RKED” as an excuse and get back to Harmonize…

Read on for the announcement I sent to ruby-talk just now…

plist 3.0.0 released!

Introduction

Plist is a library to manipulate Property List files, also known as plists. It can parse plist files into native Ruby data structures as well as generating new plist files from your Ruby objects.

Plist was originally part of the NARF project, until some idiot (me) came along and accidentally released a gem of the same name. A few apologetic emails later, plist was moved out of NARF into its own project on RubyForge. NARF’s developer, Patrick May, and I have joined forces and will be maintaining the project together from here on.

Release Notes

There are a couple of very important notes about plist 3.0.0:

  • The library is no longer compatible with Ruby 1.6.x. It was decided that ship had sailed.
  • The top-level Plist class is now a module, so subclasses of Plist will no longer work.
  • version 3.0.0 sports brand new plist generation code. Code that was written around the old 2.x generation code will likely break.

Apologies for not formally deprecating this code before it changed. It all just happened so fast! Bugs found in the 2.x branch will be fixed if there is demand for it.

Other fun tidbits about the release can be found in the CHANGELOG file, in the repository or in the rdoc.

Installation

$ sudo gem install plist

Usage

There is a lot more detail in the USAGE document in the rdoc, but here’s a taste:

Parsing

1
2

  result = Plist::parse_xml( '/path/to/your.plist' )

Generation

1
2
3
4
5
6
7
8
9
10
11
12

  hash = {
    :some_key => 'value',
    :array    => [ 1, 2, 3, 4 ],
    :obj      => MyVerySpecialCustomObject.new
  }

  hash.to_plist           # these two are
  Plist::Emit.dump(hash)  # equivalent!

  hash.save_plist( '/path/to/your.plist' )              # these two are
  Plist::Emit.save_plist( hash, '/path/to/your.plist' ) # equivalent too!

New Infrastructure!

Merging our libraries also meant merging our infrastructure. Plist is now hosted entirely at RubyForge.

  • Project page: http://rubyforge.org/projects/plist/
  • Rdoc: http://plist.rubyforge.org
  • Subversion: svn://rubyforge.org/var/svn/plist
  • Mailing lists
    • plist-commits@rubyforge.org—svn notifications
    • plist-devel@rubyforge.org—development discussion

Conclusion

While I can’t really say there are Big Plans™ in store for plist in the future, Patrick and I are both using the library in production code, so we’re not going anywhere. We’re both very open to ideas and suggestions, so if you’re using plist and want it to do something it doesn’t, just let us know. Join our mailing list (see above!) and say hi. Let us know you care.

Cheers.

Sorry, comments are closed for this article.