Skip to content

Commit

Permalink
update to latest activexml
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Dec 14, 2012
1 parent 0b23e0e commit a38e59e
Show file tree
Hide file tree
Showing 16 changed files with 810 additions and 1,273 deletions.
2 changes: 1 addition & 1 deletion app/models/appdata.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Appdata < ActiveXML::Base
class Appdata

def self.get dist="factory"
data = Hash.new
Expand Down
2 changes: 1 addition & 1 deletion app/models/attribute.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
class Attribute < ActiveXML::Base
class Attribute < ActiveXML::Node
end
2 changes: 0 additions & 2 deletions app/models/package.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/models/pattern.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class Pattern < ActiveXML::Base
class Pattern < ActiveXML::Node
#namespace "http://novell.com/package/metadata/suse/pattern"
end
2 changes: 0 additions & 2 deletions app/models/project.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/models/published.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
class Published < ActiveXML::Base
class Published < ActiveXML::Node
end
2 changes: 1 addition & 1 deletion app/models/seeker.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'digest/md5'

class Seeker < ActiveXML::Base
class Seeker < ActiveXML::Node

def self.prepare_result(query, baseproject=nil, project=nil, exclude_filter=nil, exclude_debug=false)
cache_key = query
Expand Down
34 changes: 16 additions & 18 deletions config/initializers/activexml.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
require "activexml/activexml"

ActiveXML::Base.config do |conf|
conf.setup_transport do |map|
map.default_server :rest, CONFIG['api_host']
map.connect :published, 'rest:///published/:project/:repository/:arch/:name?:view'
map.connect :seeker, 'rest:///search?match=:match',
:project => 'rest:///search/project/id?match=:match',
:package => 'rest:///search/package/id?match=:match',
:pattern => 'rest:///search/published/pattern/id?match=:match',
:binary => 'rest:///search/published/binary/id?match=:match'
map.connect :appdata, 'rest:///build/:prj/:repo/:arch/:pkgname/:appdata'
map.connect :attribute, 'rest:///source/:prj/_attribute/:attribute'
end
conf.transport_for( :published ).set_additional_header( "X-Username", CONFIG['api_username'])
unless CONFIG['api_password'].blank?
conf.transport_for( :published ).login CONFIG['api_username'], CONFIG['api_password']
end
conf.transport_for( :published ).set_additional_header( "User-Agent", "software.o.o" )
end
api = URI(CONFIG['api_host'])
map = ActiveXML::setup_transport(api.scheme, api.hostname, api.port)

map.connect :published, 'rest:///published/:project/:repository/:arch/:name?:view'
map.connect :seeker, 'rest:///search?match=:match',
:project => 'rest:///search/project/id?match=:match',
:package => 'rest:///search/package/id?match=:match',
:pattern => 'rest:///search/published/pattern/id?match=:match',
:binary => 'rest:///search/published/binary/id?match=:match'
#map.connect :appdata, 'rest:///build/:prj/:repo/:arch/:pkgname/:appdata'
map.connect :attribute, 'rest:///source/:prj/_attribute/:attribute'
map.set_additional_header( "X-Username", CONFIG['api_username'])
map.login CONFIG['api_username'], CONFIG['api_password']
map.set_additional_header( "User-Agent", "software.o.o" )
map.map.set_additional_header("X-opensuse_data", CONFIG['opensuse_cookie']) if CONFIG['opensuse_cookie']

3 changes: 3 additions & 0 deletions config/options.yml → config/options.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ api_password: test
#use_static: software.o.o

order_mails_to: promodvds@opensuse.org

#opensuse_cookie:

2 changes: 0 additions & 2 deletions lib/activexml/activexml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
gem 'activesupport'
end

require File.join(File.dirname(__FILE__), 'config')
require File.join(File.dirname(__FILE__), 'node')
require File.join(File.dirname(__FILE__), 'base')
require File.join(File.dirname(__FILE__), 'transport')
require File.join(File.dirname(__FILE__), 'matcher')
192 changes: 0 additions & 192 deletions lib/activexml/base.rb

This file was deleted.

Loading

0 comments on commit a38e59e

Please sign in to comment.