<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>autotest/discover.rb</filename>
    </added>
    <added>
      <filename>autotest/rspec_test.rb</filename>
    </added>
    <added>
      <filename>examples/node.rb</filename>
    </added>
    <added>
      <filename>test/method_missing.mkd</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -40,7 +40,7 @@ module ContextR # :nodoc:
       if stack.size == 1
         stack.pop.call(*arguments, &amp;block)
       else
-        stack.pop.__send__(method_name, *arguments) do | action, *rest_args |
+        stack.pop.__send__(method_name, *arguments) do |action, *rest_args|
           case action
           when :receiver
             receiver
@@ -51,6 +51,7 @@ module ContextR # :nodoc:
           when :block_given?
             !block.nil?
           when :next
+            rest_args.shift if method_name != :method_missing
             call_methods_stack(stack, receiver, method_name, rest_args, block)
           else 
             raise ArgumentError, &quot;Use only :receiver, :block, :block_given?, &quot; +</diff>
      <filename>lib/contextr/class_methods.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,7 @@ module ContextR
     
     instance_methods.each { |m| hide(m) }
 
-    def method_missing(method_name, *rest_args)
+    def method_missing(*rest_args)
       if block_given?
         yield(:next, *rest_args)
       else</diff>
      <filename>lib/contextr/inner_class.rb</filename>
    </modified>
    <modified>
      <diff>@@ -101,7 +101,7 @@ Now let's compute Fib(100) again. Of course with caching enabled
     example do
       timeout_raised = false
       begin
-        Timeout::timeout(0.05) do
+        Timeout::timeout(0.1) do
           ContextR::with_layer :cache do
             result_of(Fibonacci.compute(100)) == 354_224_848_179_261_915_075
           end</diff>
      <filename>test/layer_state.mkd</filename>
    </modified>
    <modified>
      <diff>@@ -9,10 +9,10 @@ class Fixnum
     return 'th' if (10..19).include?(self % 100)
     # others
     case self % 10
-    when 1: return 'st'
-    when 2: return 'nd'
-    when 3: return 'rd'
-    else    return 'th'
+    when 1 then return 'st'
+    when 2 then return 'nd'
+    when 3 then return 'rd'
+    else        return 'th'
     end
   end
 end</diff>
      <filename>test/lib/literate_maruku_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ that are used internally in ContextR. Extending them would simply result in
 endless stacks.
 
 In custom classes, i.e. classes defined by your code, every method may be 
-extended. There are only 4 exceptions and one corner case.
+extended. There are only 4 exceptions.
 
 First the exceptions. You may never extend
 
@@ -13,54 +13,9 @@ First the exceptions. You may never extend
 * `__clone__`
 * `extend`
 
-The first shall not be redefined in any case. That is why this triggers a 
+The first shall not be redefined anyway. That is why it triggers a 
 warning. The latter is used by ContextR. This currently cannot be circumvented.
 
-`method_missing`
-----------------
-
-`method_missing` is the corner case. It is used in ContextR as well, and its
-redefinition is difficult, but since the functionality of method missing is 
-one of the core ingredients of cleanly designed Ruby programs, it is still 
-possible to extend it with context-dependent behaviour. There is one simple
-limitation. Do not use `super` to call the next layer, but use `yield(:next)` 
-instead.
-
-The following code will show the right usage.
-
-    class MethodMissingExample
-      def method_missing(*a)
-        &quot;base&quot;
-      end
-
-      in_layer :one do
-        def method_missing(*a)
-          &quot;pre_one &quot; + yield(:next, *a)
-        end
-      end
-      in_layer :two do
-        def method_missing(*a)
-          yield(:next, *a) + &quot; post_two&quot;
-        end
-      end
-    end
-
-    example do
-      instance = MethodMissingExample.new
-      result_of(instance.any_method) == &quot;base&quot;
-
-      ContextR::with_layer :one do
-        result_of(instance.any_method) == &quot;pre_one base&quot;
-      end
-      ContextR::with_layer :two do
-        result_of(instance.any_method) == &quot;base post_two&quot;
-      end
-
-      ContextR::with_layer :one, :two do
-        result_of(instance.any_method) == &quot;pre_one base post_two&quot;
-      end
-    end
-
 Accessing `self`
 ----------------
 </diff>
      <filename>test/restrictions.mkd</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@
 require File.dirname(__FILE__) + &quot;/test_helper.rb&quot;
 
 %w(class_side dynamic_scope dynamics hello_world introduction
-   layer_state meta_api ordering restrictions).each do |test|
+   layer_state meta_api method_missing ordering restrictions).each do |test|
   test_class(&quot;test_#{test}&quot;.camelcase.to_sym)
   LiterateMarukuTest.load(test)
 end</diff>
      <filename>test/test_contextr.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c8ce85281c9b397cc5e35c8ac342c8e420cda34c</id>
    </parent>
  </parents>
  <author>
    <name>schmidt</name>
    <email>schmidt@b232672f-569e-4225-9534-19f781cde581</email>
  </author>
  <url>http://github.com/schmidt/contextr/commit/6ef36a275f2ff13e8f67d48558704bedaf6a9f0e</url>
  <id>6ef36a275f2ff13e8f67d48558704bedaf6a9f0e</id>
  <committed-date>2008-01-08T06:04:50-08:00</committed-date>
  <authored-date>2008-01-08T06:04:50-08:00</authored-date>
  <message> * method_missing - works much better now
 * added example from Hirschfeld paper
 * added autotest folder - now runs specs and tests in parallel
 * literate_maruku_test is now 1.9 aware


git-svn-id: svn+ssh://rubyforge.org/var/svn/contextr/trunk@86 b232672f-569e-4225-9534-19f781cde581</message>
  <tree>58a1d4f5abac29e9aa93ae037fafc0d76303253f</tree>
  <committer>
    <name>schmidt</name>
    <email>schmidt@b232672f-569e-4225-9534-19f781cde581</email>
  </committer>
</commit>
