[Kde-bindings] KDE/kdebindings/ruby/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Wed Feb 4 19:31:39 UTC 2009


SVN commit 921321 by rdale:

* In Ruby 1.9.1 the arity of a block with no arguments is 0, whereas in 
  Ruby 1.8.x it is -1. This meant that blocks passed to QtRuby 
  constructors with no args weren't working with Ruby 1.9.1

CCMAIL: kde-bindings at kde.org


 M  +5 -0      ChangeLog  
 M  +1 -1      src/lib/Qt/qtruby4.rb  


--- trunk/KDE/kdebindings/ruby/qtruby/ChangeLog #921320:921321
@@ -1,3 +1,8 @@
+2009-02-04  Richard Dale  <richard.j.dale at gmail.com>
+	* In Ruby 1.9.1 the arity of a block with no arguments is 0, whereas in 
+	  Ruby 1.8.x it is -1. This meant that blocks passed to QtRuby 
+	  constructors with no args weren't working with Ruby 1.9.1
+
 2009-02-02  Richard Dale  <richard.j.dale at gmail.com>
 	* Set up a RUBY_VERSION macro to use to test for whether QtRuby is being 
 	  built for Ruby 1.9 or not. Add patches from Mr Napalm for building with
--- trunk/KDE/kdebindings/ruby/qtruby/src/lib/Qt/qtruby4.rb #921320:921321
@@ -2535,7 +2535,7 @@
 		# if no args were passed to the block. Or otherwise,
 		# run the block in the context of the arg.
 		def Internal.run_initializer_block(instance, block)
-			if block.arity == -1
+			if block.arity == -1 || block.arity == 0
 				instance.instance_eval(&block)
 			elsif block.arity == 1
 				block.call(instance)



More information about the Kde-bindings mailing list