Project

xbel

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby API for XBEL based on Nokogiri.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

xbel

Introduces XBEL decorators for Nokogiri.

Features

  • generates IDs for bookmarks and folders
  • decorates a Nokogiri::XML::Node, all Nokogiri methods are available
  • Ruby 1.8 and 1.9 compatible

Installation

gem install xbel

Using

require 'rubygems'
require 'xbel'

Reading

XBEL.open('test/wikipedia.xbel')[:test_1_1].bookmarks.
map do |bookmark|
  link_to bookmark.title, bookmark.href
end

Note: See http://github.com/boof/habel to read *.haml into XBEL...

Writing

xbel = XBEL.new
xbel.build_folder 'XBEL' do |folder|
  bm = folder.build_bookmark "boof's xbel", 'http://github.com/boof/xbel'
  # nodes receive IDs and can be accessed via the :[] method
  bm == xbel[bm.id]
end
File.open('my.xbel', 'w') { |file| file << xbel }

Note: You can use all Nokogiri::XML::Node methods.

Patches/Pull Requests:

  1. Fork the project.
  2. Make your feature addition or bug fix.
  3. Add tests for it. This is important so I don't break it in a future version unintentionally.
  4. Commit, do not mess with rakefile, version, or history.
  5. Send me a pull request.

Copyright

Copyright (c) 2009-2010 Florian Aßmann. See LICENSE for details.