diff options
author | Rick Bradley <rick@rickbradley.com> | 2007-10-15 23:33:12 -0500 |
---|---|---|
committer | Rick Bradley <rick@rickbradley.com> | 2007-10-15 23:33:12 -0500 |
commit | 099c5469bf8fd6bf1e65be1a8192c14e584e49c3 (patch) | |
tree | 7c66bec5658d87bdf5f5ea13112b6acec29c3110 /lib/puppet | |
parent | b1d62231c587e13ad78fe1bbd292a6c9f1cb99a1 (diff) | |
download | puppet-099c5469bf8fd6bf1e65be1a8192c14e584e49c3.tar.gz puppet-099c5469bf8fd6bf1e65be1a8192c14e584e49c3.tar.xz puppet-099c5469bf8fd6bf1e65be1a8192c14e584e49c3.zip |
Finish front end of delegation to server+protocol helper classes ("handlers").
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/network/http/mongrel.rb | 9 | ||||
-rw-r--r-- | lib/puppet/network/http/mongrel/rest.rb | 4 | ||||
-rw-r--r-- | lib/puppet/network/http/mongrel/xmlrpc.rb | 4 | ||||
-rw-r--r-- | lib/puppet/network/http/webrick.rb | 10 | ||||
-rw-r--r-- | lib/puppet/network/http/webrick/rest.rb | 4 | ||||
-rw-r--r-- | lib/puppet/network/http/webrick/xmlrpc.rb | 4 |
6 files changed, 26 insertions, 9 deletions
diff --git a/lib/puppet/network/http/mongrel.rb b/lib/puppet/network/http/mongrel.rb index 5b14d93c9..3efc465ad 100644 --- a/lib/puppet/network/http/mongrel.rb +++ b/lib/puppet/network/http/mongrel.rb @@ -1,4 +1,6 @@ require 'mongrel' +require 'puppet/network/http/mongrel/rest' +require 'puppet/network/http/mongrel/xmlrpc' class Puppet::Network::HTTP::Mongrel def initialize(args = {}) @@ -44,9 +46,8 @@ class Puppet::Network::HTTP::Mongrel # TODO/FIXME: need a spec which forces delegation to the real class def class_for_protocol(protocol) - Class.new do - def initialize(args = {}) - end - end + return Puppet::Network::HTTP::MongrelREST if protocol.to_sym == :rest + return Puppet::Network::HTTP::MongrelXMLRPC if protocol.to_sym == :xmlrpc + raise ArgumentError, "Unknown protocol [#{protocol}]." end end diff --git a/lib/puppet/network/http/mongrel/rest.rb b/lib/puppet/network/http/mongrel/rest.rb new file mode 100644 index 000000000..6e454c7d9 --- /dev/null +++ b/lib/puppet/network/http/mongrel/rest.rb @@ -0,0 +1,4 @@ +class Puppet::Network::HTTP::MongrelREST + def initialize(args = {}) + end +end diff --git a/lib/puppet/network/http/mongrel/xmlrpc.rb b/lib/puppet/network/http/mongrel/xmlrpc.rb new file mode 100644 index 000000000..92acd4f0e --- /dev/null +++ b/lib/puppet/network/http/mongrel/xmlrpc.rb @@ -0,0 +1,4 @@ +class Puppet::Network::HTTP::MongrelXMLRPC + def initialize(args = {}) + end +end diff --git a/lib/puppet/network/http/webrick.rb b/lib/puppet/network/http/webrick.rb index 474f66e4f..6df7804c6 100644 --- a/lib/puppet/network/http/webrick.rb +++ b/lib/puppet/network/http/webrick.rb @@ -1,5 +1,7 @@ require 'webrick' require 'webrick/https' +require 'puppet/network/http/webrick/rest' +require 'puppet/network/http/webrick/xmlrpc' class Puppet::Network::HTTP::WEBrick def initialize(args = {}) @@ -46,11 +48,9 @@ class Puppet::Network::HTTP::WEBrick end end - # TODO/FIXME: need a spec which forces delegation to the real class def class_for_protocol(protocol) - Class.new do - def initialize(args = {}) - end - end + return Puppet::Network::HTTP::WEBrickREST if protocol.to_sym == :rest + return Puppet::Network::HTTP::WEBrickXMLRPC if protocol.to_sym == :xmlrpc + raise ArgumentError, "Unknown protocol [#{protocol}]." end end diff --git a/lib/puppet/network/http/webrick/rest.rb b/lib/puppet/network/http/webrick/rest.rb new file mode 100644 index 000000000..5e9ccfc45 --- /dev/null +++ b/lib/puppet/network/http/webrick/rest.rb @@ -0,0 +1,4 @@ +class Puppet::Network::HTTP::WEBrickREST + def initialize(args = {}) + end +end
\ No newline at end of file diff --git a/lib/puppet/network/http/webrick/xmlrpc.rb b/lib/puppet/network/http/webrick/xmlrpc.rb new file mode 100644 index 000000000..793708f8a --- /dev/null +++ b/lib/puppet/network/http/webrick/xmlrpc.rb @@ -0,0 +1,4 @@ +class Puppet::Network::HTTP::WEBrickXMLRPC + def initialize(args = {}) + end +end |