Skip to content

dmacvicar/feta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feta

Introduction

Library to access FATE

Note: The API is still a draft. Be careful.

Features

  • Simple queries by actor, roles.

  • For SUSE’s FATE server, you can use the web url and it will use the right keeper server and take your .oscrc credentials.

More will be coming, the focus is on providing an easy API. You can always get anything else by just doing xpath queries.

Example (API)

Client API

client = Feta::Client.new("https://user:password@keeper.host.com")
query = Feta::Query.new.only_actor("me@mail.com").only_product("openSUSE-11.4")
features = client.search(query)

query = Feta::Query.new.with_id("1234")
features = client.search(query)

ActiveRecord-like API

Feta.client = Feta::Client.new("https://user:password@keeper.host.com")
Feta::Feature.query.only_actor("me@mail.com").only_product("openSUSE-11.4").each do |feature|
   # .. do something with feature
end

Extending Feta

Feta will look in the following places for plugins:

  • lib/feta/plugins in the gem path

  • $HOME/.local/share/feta/plugins

A plugin is a class under Feta::Plugins, only one hook is available for now:

class Feta::Plugins::MyPlugin

  def to_s
    self.class.to_s
  end

  def order
    # load always last
    (1.0/0)
  end

  def initialize_hook(url, logger, headers)
    # modify the url, add headers or configure the logger
  end
end

SUSE plugin

One plugin is included which takes the credentials from .oscrc if using the SUSE internal keeper server.

Roadmap

  • Change query methods to make them more similar to the Bicho library

  • Add more data to the Feature class

  • Allow to search by an arbitrary xpath expression

Authors

  • Duncan Mac-Vicar P. <dmacvicar@suse.de>

License

Copyright © 2011 SUSE LINUX Products GmbH.

Feta is licensed under the MIT license. See MIT-LICENSE for details.