OSMLib (osmlib.rubyforge.org) is a Ruby library for reading, exporting and generally handling OSM data. It is a set of ruby modules and classes developed by Jochen Topf and released to the public domain.
See https://github.com/emacsen/osmlib-base for an updated version.
- See OSMLib on Ubuntu for more details
osm to shapefile conversion
Firstly it should be noted that OSMLib's shapefile conversion is rather inefficient, and this is not the conversion utility used by Geofabrik to create their shapefile downloads. See Shapefile page for a list of alternative approaches.
If you want to try using OSMLib, you have to specify which kind of information you're interested in. This is done by a Rulefile in Ruby Syntax. Please make yourself familiar with the OSM Library Documentation for further details. There's also a setup section for export notes into Shapefile.