[#11569] sprintf: Format specifier tokens aren't checked well enough — Florian Gross <florgro@...>
Hi,
Something seems to be broken for %u with negative bignums:
Hi,
[#11576] Array#delete is destructive, String#delete isn't — Florian Gross <florgro@...>
Hi,
[#11585] Array#values_at bug? — "John Lam (CLR)" <jflam@...>
a =3D [1,2,3,4]
[#11588] Timeout doesn't work correctly under windows when executing complex regexp. — "yuanyi zhang" <zhangyuanyi@...>
To repeat the problem, just execute the below code(I've run it with
Hi,
[#11597] Optimizing Symbol#to_proc — murphy <murphy@...>
Greetings to the list!
[#11600] Bug in Kernel#method objects that call super? — Charles Oliver Nutter <charles.nutter@...>
This seems very wrong to me. Calling through a method object should
[#11609] GetoptLong w/ DSL — TRANS <transfire@...>
Hi--
Hi,
On 7/8/07, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#11611] Import gem to Ruby 1.9 — SASADA Koichi <ko1@...>
Hi,
On Jul 8, 2007, at 00:49, SASADA Koichi wrote:
-----BEGIN PGP SIGNED MESSAGE-----
On 7/17/07, NAKAMURA, Hiroshi <nakahiro@sarion.co.jp> wrote:
On 7/17/07, Ryan Davis <ryand-ruby@zenspider.com> wrote:
On Jul 17, 2007, at 01:26, NAKAMURA, Hiroshi wrote:
-----BEGIN PGP SIGNED MESSAGE-----
On 7/18/07, NAKAMURA, Hiroshi <nakahiro@sarion.co.jp> wrote:
On 7/22/07, Chad Fowler <chad@chadfowler.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
On Jul 24, 2007, at 06:44, NAKAMURA, Hiroshi wrote:
-----BEGIN PGP SIGNED MESSAGE-----
-----BEGIN PGP SIGNED MESSAGE-----
-----BEGIN PGP SIGNED MESSAGE-----
-----BEGIN PGP SIGNED MESSAGE-----
On Sep 30, 2007, at 22:56 , NAKAMURA, Hiroshi wrote:
On Oct 1, 2007, at 09:57 , Eric Hodel wrote:
Hi,
-----BEGIN PGP SIGNED MESSAGE-----
On Oct 13, 2007, at 02:00 , NAKAMURA, Hiroshi wrote:
-----BEGIN PGP SIGNED MESSAGE-----
On Oct 13, 2007, at 08:00 , NAKAMURA, Hiroshi wrote:
-----BEGIN PGP SIGNED MESSAGE-----
On Oct 15, 2007, at 07:14 , NAKAMURA, Hiroshi wrote:
On 10/17/07, Eric Hodel <drbrain@segment7.net> wrote:
Leonard Chin wrote:
On Oct 17, 2007, at 12:28 , Charles Oliver Nutter wrote:
Eric Hodel wrote:
Charles Oliver Nutter wrote:
On Oct 17, 2007, at 14:53 , Charles Oliver Nutter wrote:
Evan Phoenix wrote:
In article <4710890A.3020009@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
In article <4718708D.3050001@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
In article <471A1720.4080606@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
In article <471CAFE0.2070104@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
In article <471D4D1F.5050006@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
In article <471D5665.5040209@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
In article <471FF3B1.3060103@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
In article <47200D74.6020202@sarion.co.jp>,
On Oct 13, 2007, at 01:24 , Yukihiro Matsumoto wrote:
In article <4722FEA4.6040509@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
In article <472532B0.2060600@sarion.co.jp>,
-----BEGIN PGP SIGNED MESSAGE-----
In article <4726C4EF.7060605@sarion.co.jp>,
[#11635] to_str conversions and exceptions — "John Lam (CLR)" <jflam@...>
Silly question of the day:
[#11642] Re: Proposal: runtime-modifying Kernel methods should be keywords — "Marcel Molina Jr." <marcel@...>
On Fri, Jul 13, 2007 at 03:02:06PM +0900, Charles Oliver Nutter wrote:
Calamitas wrote:
I was going to reply to this In a detailed manner, but I'm not. (I
Ryan Davis wrote:
Ryan Davis wrote:
On 18/07/07, Ryan Davis <ryand-ruby@zenspider.com> wrote:
> PS: Incidentally... The comment on the blog entry you gave above
[#11645] Re: Proposal: runtime-modifying Kernel methods should be keywords — Charles Oliver Nutter <charles.nutter@...>
Charles Oliver Nutter wrote:
Hi,
Yukihiro Matsumoto wrote:
Hi,
On Jul 13, 2007, at 2:09 AM, Nobuyoshi Nakada wrote:
James Edward Gray II schrieb:
On Sep 10, 2007, at 11:19 PM, murphy wrote:
[#11648] Re: Proposal: runtime-modifying Kernel methods should be keywords — "John Lam" <jlam@...>
> 3. These methods are exactly the ones that complicate optimizing Ruby in
On 7/13/07, John Lam <jlam@iunknown.com> wrote:
TRANS wrote:
[#11673] Inheritable mixin — TRANS <transfire@...>
Concept for Ruby 2.0...
[#11691] rb_cstr_to_inum use of strtoul as an optimization has unfortunate side effects — Florian Gross <florgro@...>
Hi,
On another note, String#oct allows the base to be changed by a base
Hi,
[#11692] String#rindex(other) doesn't try to convert other via to_str — Florian Gross <florgro@...>
Hi,
[#11739] Re: Proposal: runtime-modifying Kernel methods should be keywords — Brent Roman <brent@...>
Just a follow up to on the idea of disallowing the
Brent Roman wrote:
On 17/07/07, Charles Oliver Nutter <charles.nutter@sun.com> wrote:
[#11754] indentation / emacs woes — Ryan Davis <ryand-ruby@...>
OK. Can someone give me the tweaks I need to make ruby source read
[#11756] threads and heavy io on osx and linux — "ara.t.howard" <Ara.T.Howard@...>
Hung on the 13th run.
[#11795] What libraries to be unbundled? — "NAKAMURA, Hiroshi" <nakahiro@...>
-----BEGIN PGP SIGNED MESSAGE-----
I don't think that json should be unbundled. It is the interchange
On Jul 24, 2007, at 1:39 PM, David Flanagan wrote:
James Edward Gray II wrote:
On 7/24/07, David Flanagan <david@davidflanagan.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
On Oct 1, 2007, at 1:07 AM, NAKAMURA, Hiroshi wrote:
-----BEGIN PGP SIGNED MESSAGE-----
[#11821] Columnize, irb, and ruby-debug — "Rocky Bernstein" <rocky.bernstein@...>
I've been working on/with Kent SIbilev's ruby-debug. The current sources in
[#11826] Rdoc allowing arbitrary HTML — "Robert Dober" <robert.dober@...>
Hi all
[PATCH] XMLRPC::ModRubyServer
Made some changes to the XMLRPC::ModRubyServer class that allows it to be loaded as a RubyHandler by ModRuby and prevent it from being reloaded every time a request is made. This can greatly improve performance when the server takes a while to load, such as when it is establishing database connections or loading lots of libraries. As well, I modified the way that the `XMLRPC::Server.dispatch` method calls the service_hook Proc object so that it also passes the name of the XML-RPC method that is called along with the Proc object associated with the name, and the arguments for the method. Sincerely, Chris Wailes
Attachments (1)
Index: lib/xmlrpc/server.rb
===================================================================
--- lib/xmlrpc/server.rb (revision 12809)
+++ lib/xmlrpc/server.rb (working copy)
@@ -129,9 +129,9 @@
The service-hook is called with a (({Proc})) object and with the parameters for this (({Proc})).
An example:
- server.set_service_hook {|obj, *args|
+ server.set_service_hook {|method_name, method_obj, *args|
begin
- ret = obj.call(*args) # call the original service-method
+ ret = method_obj.call(*args) # call the original service-method
# could convert the return value
resuce
# rescue exceptions
@@ -333,7 +333,7 @@
if @service_hook.nil?
return obj.call(*args)
else
- return @service_hook.call(obj, *args)
+ return @service_hook.call(methodname, obj, *args)
end
end
end
@@ -498,44 +498,91 @@
=begin
= XMLRPC::ModRubyServer
-== Description
-Implements a XML-RPC server, which works with Apache mod_ruby.
+== Synopsis
+ruby_file.rb:
+ def make_server
+ server = XMLRPC::ModRubyServer.new()
-Use it in the same way as CGIServer!
+ server.add_handler("michael.add") do |a,b|
+ a + b
+ end
+ server.add_handler("michael.div") do |a,b|
+ if b == 0
+ raise XMLRPC::FaultException.new(1, "division by zero")
+ else
+ a / b
+ end
+ end
+
+ server.set_default_handler do |name, *args|
+ raise XMLRPC::FaultException.new(-99, "Method #{name} missing" + " or wrong number of parameters!")
+ end
+
+ return server
+ end
+
+ruby.conf:
+#This is your mod_ruby configuration file.
+ LoadModule ruby_module modules/mod_ruby.so
+
+ DirectoryIndex index.rb
+
+ AddType text/html.rb
+ <IfModule mod_ruby.c>
+ RubyRequire apache/ruby-run
+
+ #If your file is at /path/to/your/ruby_file.rb
+ RubyAddPath /path/to/your
+ RubyRequire ruby_file
+
+ # Exec *.rb as ruby scripts.
+ <Files *.rb>
+ SetHandler ruby-object
+ RubyHandler Apache::RubyRun.instance
+ Options +ExecCGI
+ </Files>
+ </IfModule>
+
+ #This location doesn't actually corispond to any file so you can make it any path you want.
+ #This example makes the server address http://example.com/xmlrpcserver
+ <Location /xmlrpcserver>
+ SetHandler ruby-object
+ RubyHandler make_server
+
+ Order allow,deny
+ Allow from all
+ </Location>
+
+== Description
+Implements a XML-RPC server, which works with Apache mod_ruby. By providing the 'handler' method a ModRubyServer object
+can be used as a RubyHandler by mod_ruby. This prevents the server from being instantiated every time a request is made.
== Superclass
((<XMLRPC::BasicServer>))
-=end
+=end
class ModRubyServer < BasicServer
+ def handler(apache_request)
+ @ap = apache_request
- def initialize(*a)
- @ap = Apache::request
- super(*a)
- end
+ header = Hash.new
+ @ap.headers_in.each {|key, value| header[key.capitalize] = value}
- def serve
- catch(:exit_serve) {
- header = {}
- @ap.headers_in.each {|key, value| header[key.capitalize] = value}
+ length = header['Content-length'].to_i
- length = header['Content-length'].to_i
+ http_error(405, "Method Not Allowed") unless @ap.request_method == "POST"
+ http_error(400, "Bad Request") unless parse_content_type(header['Content-type']).first == "text/xml"
+ http_error(411, "Length Required") unless length > 0
- http_error(405, "Method Not Allowed") unless @ap.request_method == "POST"
- http_error(400, "Bad Request") unless parse_content_type(header['Content-type']).first == "text/xml"
- http_error(411, "Length Required") unless length > 0
+ @ap.binmode
+ data = apache_request.read(length)
- # TODO: do we need a call to binmode?
- @ap.binmode
- data = @ap.read(length)
+ http_error(400, "Bad Requiest") if data.nil? or data.size != length
- http_error(400, "Bad Request") if data.nil? or data.size != length
+ http_write(process(data), 200, "Content-type" => "text/xml; charset=utf-8")
- http_write(process(data), 200, "Content-type" => "text/xml; charset=utf-8")
- }
- end
-
-
+ return Apache::OK
+ end
private
def http_error(status, message)