changeset 3128:f78d6ad0fb0f

Updated #271: Updated runner to pass second argument, too
author unexist
date Tue, 15 Nov 2011 21:41:24 +0100
parents 8cd783e45037
children 5a7abf89bf8d
files data/subtler/runner.rb
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/data/subtler/runner.rb	Tue Nov 15 21:40:51 2011 +0100
+++ b/data/subtler/runner.rb	Tue Nov 15 21:41:24 2011 +0100
@@ -193,11 +193,11 @@
             # Check singleton and instance methods
             if (@group.singleton_methods << :new).include?(@action)
               obj   = @group
-              arg   = arg1
+              args  = [ arg1, arg2 ].compact
               arity = obj.method(@action).arity
             elsif @group.instance_methods.include?(@action)
               obj   = @group.send(:find, arg1)
-              arg   = arg2
+              args  = [ arg2 ]
               arity = @group.instance_method(@action).arity
             end
 
@@ -208,16 +208,16 @@
                 if obj.is_a?(Array)
                   obj.each do |o|
                     p '%s:' % o if 1 < obj.size
-                    handle_result(o.send(@action, arg))
+                    handle_result(o.send(@action, *args))
                   end
                 else
-                  handle_result(obj.send(@action, arg))
+                  handle_result(obj.send(@action, *args))
                 end
               when -1
                 if [ Subtlext::Sublet, Subtlext::Tag,
-                    Subtlext::View ].include?(@group)
+                    Subtlext::View, Subtlext::Gravity ].include?(@group)
                   # Create new object
-                  ret = obj.send(@action, arg)
+                  ret = obj.send(@action, *args)
                   ret.save
 
                   handle_result(ret)