<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -82,7 +82,7 @@ module WillPaginate
     #
     # The Array#paginate API has since then changed, but this still serves as a
     # fine example of WillPaginate::Collection usage.
-    def self.create(page, per_page, total = nil, &amp;block)
+    def self.create(page, per_page, total = nil)
       pager = new(page, per_page, total)
       yield pager
       pager</diff>
      <filename>lib/will_paginate/collection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -61,7 +61,7 @@ module WillPaginate
       #
       # All other options (+conditions+, +order+, ...) are forwarded to +find+
       # and +count+ calls.
-      def paginate(*args, &amp;block)
+      def paginate(*args)
         options = args.pop
         page, per_page, total_entries = wp_parse_options(options)
         finder = (options[:finder] || 'find').to_s
@@ -79,7 +79,7 @@ module WillPaginate
           
           args &lt;&lt; find_options
           # @options_from_last_find = nil
-          pager.replace send(finder, *args, &amp;block)
+          pager.replace(send(finder, *args) { |*a| yield(*a) if block_given? })
           
           # magic counting for user convenience:
           pager.total_entries = wp_count(count_options, args, finder) unless pager.total_entries
@@ -96,7 +96,7 @@ module WillPaginate
       #
       # See {Faking Cursors in ActiveRecord}[http://weblog.jamisbuck.org/2007/4/6/faking-cursors-in-activerecord]
       # where Jamis Buck describes this and a more efficient way for MySQL.
-      def paginated_each(options = {}, &amp;block)
+      def paginated_each(options = {})
         options = { :order =&gt; 'id', :page =&gt; 1 }.merge options
         options[:page] = options[:page].to_i
         options[:total_entries] = 0 # skip the individual count queries
@@ -106,7 +106,7 @@ module WillPaginate
           collection = paginate(options)
           with_exclusive_scope(:find =&gt; {}) do
             # using exclusive scope so that the block is yielded in scope-free context
-            total += collection.each(&amp;block).size
+            total += collection.each { |item| yield item }.size
           end
           options[:page] += 1
         end until collection.size &lt; collection.per_page
@@ -161,10 +161,14 @@ module WillPaginate
 
     protected
       
-      def method_missing_with_paginate(method, *args, &amp;block) #:nodoc:
+      def method_missing_with_paginate(method, *args) #:nodoc:
         # did somebody tried to paginate? if not, let them be
         unless method.to_s.index('paginate') == 0
-          return method_missing_without_paginate(method, *args, &amp;block) 
+          if block_given?
+            return method_missing_without_paginate(method, *args) { |*a| yield(*a) }
+          else
+            return method_missing_without_paginate(method, *args) 
+          end
         end
         
         # paginate finders are really just find_* with limit and offset
@@ -177,7 +181,7 @@ module WillPaginate
         options[:finder] = finder
         args &lt;&lt; options
         
-        paginate(*args, &amp;block)
+        paginate(*args) { |*a| yield(*a) if block_given? }
       end
 
       # Does the not-so-trivial job of finding out the total number of entries</diff>
      <filename>lib/will_paginate/finder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -83,7 +83,7 @@ module WillPaginate
       #
       #   expected_options = { :conditions =&gt; { :colored =&gt; 'red' } }
       #   assert_equal expected_options, Shirt.colored('red').proxy_options
-      def named_scope(name, options = {}, &amp;block)
+      def named_scope(name, options = {})
         name = name.to_sym
         scopes[name] = lambda do |parent_scope, *args|
           Scope.new(parent_scope, case options
@@ -91,7 +91,7 @@ module WillPaginate
               options
             when Proc
               options.call(*args)
-          end, &amp;block)
+          end) { |*a| yield(*a) if block_given? }
         end
         (class &lt;&lt; self; self end).instance_eval do
           define_method name do |*args|
@@ -112,9 +112,9 @@ module WillPaginate
 
       delegate :scopes, :with_scope, :to =&gt; :proxy_scope
 
-      def initialize(proxy_scope, options, &amp;block)
+      def initialize(proxy_scope, options)
         [options[:extend]].flatten.each { |extension| extend extension } if options[:extend]
-        extend Module.new(&amp;block) if block_given?
+        extend Module.new { |*args| yield(*args) } if block_given?
         @proxy_scope, @proxy_options = proxy_scope, options.except(:extend)
       end
 
@@ -152,12 +152,12 @@ module WillPaginate
       end
 
       private
-      def method_missing(method, *args, &amp;block)
+      def method_missing(method, *args)
         if scopes.include?(method)
           scopes[method].call(self, *args)
         else
           with_scope :find =&gt; proxy_options do
-            proxy_scope.send(method, *args, &amp;block)
+            proxy_scope.send(method, *args) { |*a| yield(*a) if block_given? }
           end
         end
       end</diff>
      <filename>lib/will_paginate/named_scope.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 ActiveRecord::Associations::AssociationProxy.class_eval do
   protected
-  def with_scope(*args, &amp;block)
-    @reflection.klass.send :with_scope, *args, &amp;block
+  def with_scope(*args)
+    @reflection.klass.send(:with_scope, *args) { |*a| yield(*a) if block_given? }
   end
 end
 
@@ -10,11 +10,11 @@ end
   klass.class_eval do
     protected
     alias :method_missing_without_scopes :method_missing_without_paginate
-    def method_missing_without_paginate(method, *args, &amp;block)
+    def method_missing_without_paginate(method, *args)
       if @reflection.klass.scopes.include?(method)
-        @reflection.klass.scopes[method].call(self, *args, &amp;block)
+        @reflection.klass.scopes[method].call(self, *args) { |*a| yield(*a) if block_given? }
       else
-        method_missing_without_scopes(method, *args, &amp;block)
+        method_missing_without_scopes(method, *args) { |*a| yield(*a) if block_given? }
       end
     end
   end
@@ -23,14 +23,14 @@ end
 # Rails 1.2.6
 ActiveRecord::Associations::HasAndBelongsToManyAssociation.class_eval do
   protected
-  def method_missing(method, *args, &amp;block)
+  def method_missing(method, *args)
     if @target.respond_to?(method) || (!@reflection.klass.respond_to?(method) &amp;&amp; Class.respond_to?(method))
       super
     elsif @reflection.klass.scopes.include?(method)
       @reflection.klass.scopes[method].call(self, *args)
     else
       @reflection.klass.with_scope(:find =&gt; { :conditions =&gt; @finder_sql, :joins =&gt; @join_sql, :readonly =&gt; false }) do
-        @reflection.klass.send(method, *args, &amp;block)
+        @reflection.klass.send(method, *args) { |*a| yield(*a) if block_given? }
       end
     end
   end</diff>
      <filename>lib/will_paginate/named_scope_patch.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>62b9f6c2114ea96a4b93be7bed766b7dc274a275</id>
    </parent>
  </parents>
  <author>
    <name>Darrick Wiebe</name>
    <email>dw@darrick-wiebes-macbook-pro.local</email>
  </author>
  <url>http://github.com/mislav/will_paginate/commit/029964fe99a94c0c3f621df79f90a8eb36deac54</url>
  <id>029964fe99a94c0c3f621df79f90a8eb36deac54</id>
  <committed-date>2009-02-09T12:08:44-08:00</committed-date>
  <authored-date>2009-02-09T12:04:14-08:00</authored-date>
  <message>Removed all unnecessary &amp;block variables since they cause serious memory damage and lots of subsequent gc runs.</message>
  <tree>ac13ce59446036b7c09428acf696ffc456609b46</tree>
  <committer>
    <name>Darrick Wiebe</name>
    <email>dw@darrick-wiebes-macbook-pro.local</email>
  </committer>
</commit>
