<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -124,7 +124,9 @@ class ::Array
       replace shuffle
     end
   end
+end
 
+module ::Enumerable
   # This method is an advanced version of #join
   # allowing fine control of separators:
   #
@@ -139,12 +141,14 @@ class ::Array
   # git-rev: c8b7395255b977d3c7de268ff563e3c5bc7f1441
   # file: lib/core/facets/array/conjoin.rb
   def conjoin(*args, &amp;block)
-    return first.to_s if size &lt; 2
+    num = count - 1
+
+    return first.to_s if num &lt; 1
 
     sep = []
 
     if block_given?
-      (size - 1).times do |i|
+      num.times do |i|
         sep &lt;&lt; yield(i, *slice(i, 2))
       end
     else
@@ -152,7 +156,7 @@ class ::Array
       separator = args.shift || &quot;&quot;
       options[-1] = args.shift unless args.empty?
 
-      sep = [separator] * (size - 1)
+      sep = [separator] * num
 
       if options.key?(:last)
         options[-1] = options.delete(:last)</diff>
      <filename>lib/rbot/core/utils/extends.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>561f183fb8c91867bade293c340a90a87a3b8c84</id>
    </parent>
  </parents>
  <author>
    <name>Giuseppe Bilotta</name>
    <email>giuseppe.bilotta@gmail.com</email>
  </author>
  <url>http://github.com/jsn/rbot/commit/74d7d02ed07740e50c3f87da9ecedf13397729ea</url>
  <id>74d7d02ed07740e50c3f87da9ecedf13397729ea</id>
  <committed-date>2009-06-29T15:41:58-07:00</committed-date>
  <authored-date>2009-06-29T15:41:58-07:00</authored-date>
  <message>extends: bring conjoin to Enumerable

Put #conjoin() in the Enumerable module, so that it can be shared by all
enumerables (e.g. ranges). Since #size() is not necessarily present, its
use is replaced by #count(), the result of which is cached because
it can be slow on objects missing #size().</message>
  <tree>997bcef26d27af87cf4181f843fec84511fc389a</tree>
  <committer>
    <name>Giuseppe Bilotta</name>
    <email>giuseppe.bilotta@gmail.com</email>
  </committer>
</commit>
