Blame SOURCES/rubygem-treetop-1.4.14-Avoid-collision-with-ActiveSupport-4.0.patch

299994
From 4ebd34c62342e04fb8c4452b20f48d6f8cb66c40 Mon Sep 17 00:00:00 2001
299994
From: Clifford Heath <clifford.heath@gmail.com>
299994
Date: Fri, 14 Jun 2013 11:45:53 +1000
299994
Subject: [PATCH] Inlined the String#indent method to avoid collision with
299994
 ActiveSupport 4.0
299994
299994
---
299994
 lib/treetop/ruby_extensions/string.rb | 20 ++++++++------------
299994
 1 file changed, 8 insertions(+), 12 deletions(-)
299994
299994
diff --git a/lib/treetop/ruby_extensions/string.rb b/lib/treetop/ruby_extensions/string.rb
299994
index 9ea5dbf..15c1a41 100644
299994
--- a/lib/treetop/ruby_extensions/string.rb
299994
+++ b/lib/treetop/ruby_extensions/string.rb
299994
@@ -22,23 +22,19 @@ def blank?
299994
   # The following methods are lifted from Facets 2.0.2
299994
   def tabto(n)
299994
     if self =~ /^( *)\S/
299994
-      indent(n - $1.length)
299994
-    else
299994
-      self
299994
-    end
299994
-  end
299994
-
299994
-  unless method_defined?(:indent)
299994
-    def indent(n)
299994
-      if n >= 0
299994
-        gsub(/^/, ' ' * n)
299994
+      # Inlined due to collision with ActiveSupport 4.0: indent(n - $1.length)
299994
+      m = n - $1.length
299994
+      if m >= 0
299994
+        gsub(/^/, ' ' * m)
299994
       else
299994
-        gsub(/^ {0,#{-n}}/, "")
299994
+        gsub(/^ {0,#{-m}}/, "")
299994
       end
299994
+    else
299994
+      self
299994
     end
299994
   end
299994
 
299994
   def treetop_camelize
299994
     to_s.gsub(/\/(.?)/){ "::" + $1.upcase }.gsub(/(^|_)(.)/){ $2.upcase }
299994
   end
299994
-end
299994
\ No newline at end of file
299994
+end
299994
-- 
299994
1.8.1.6