-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
51 lines (34 loc) · 1.24 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
= XMLRPC::RackServer
This gem extends the Ruby standard library XML-RPC server to be Rack
compatible.
== Installation
If bundler is used, just include the relevant line to Gemfile:
gem 'xmlrpc-rack_server'
or in other projects:
require 'rubygems'
require 'xmlrpc-rack_server'
== Usage
Use the XML-RPC server as a normal Rack server, extended by the functionality
of the Ruby standard library XML-RPC server.
The Ruby standard library XML-RPC component documentation can be found at:
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/xmlrpc/rdoc/index.html and the Rack
documentation at: http://rack.rubyforge.org/doc/
== Examples
This creates a simple XML-RPC ping server running on Rack:
class Ping
def self.call(env)
server = XMLRPC::RackServer.new
server.add_introspection
server.add_handler('weblogUpdates', self.new)
server.call(env)
end
def ping(title, url)
# Do whatever with title and url
{:flerror => false, :message => 'Thanks for the ping.'}
end
end
If Ruby on Rails framework is used the Rack server can be mounted on routes.rb:
Rails.application.routes.draw do |map|
mount Ping => '/ping'
end
Copyright (c) 2010-2011 Nikolaos Anastopoulos, released under the MIT license