Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A DataMapper adapter for features.opensuse.org
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
script
tasks
test
.gitignore
ChangeLog
Gemfile
MIT-LICENSE
README.rdoc
Rakefile
dm-keeper-adapter.gemspec

README.rdoc

dm-keeper-adapter

A DataMapper adapter for features.opensuse.org

Usage

This adapter allows easy access to the openSUSE feature database using DataMapper. It supports features, relationtrees, productlines, and products.

features.opensuse.org is the web frontend, the database server provides an xquery API at keeper.novell.com/sxkeeper, which is used by this adapter - hence the name.

Install

Install it with

gem install dm-keeper-adapter

Code

require 'rubygems'
require 'dm-core'
require 'dm-keeper-adapter'

DataMapper::Logger.new($stdout, :debug)

# Retrieves credentials from ~/.oscrc if exists
# Otherwise add user:pass@ before keeper.novell.com 
keeper = DataMapper.setup(:default, :adapter => 'keeper', :url  => 'https://keeper.novell.com/sxkeeper')

require 'keeper/feature'
DataMapper.finalize

# Get feature by ID
f = Feature.get(311545)

# Finding features (see http://datamapper.org/docs/find.html)

# Get feature by title (assuming there's only one)
f = Feature.first(:title => "Feature title")

# Get all features matching a title string
features = Feature.all(:title.like => "foobar")

TODO

Real DataMapper queries mapped to XPath

License

MIT

Author

Klaus Kämpf <kkaempf@suse.com>

Something went wrong with that request. Please try again.