marcandre-backports 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/backports/string.rb +7 -7
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/backports/string.rb
CHANGED
@@ -68,13 +68,13 @@ class String
|
|
68
68
|
|
69
69
|
make_block_optional :each_byte, :each, :each_line, :test_on => "abc"
|
70
70
|
|
71
|
-
unless ("abc".gsub(/./) rescue false)
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
end
|
71
|
+
# unless ("abc".gsub(/./) rescue false)
|
72
|
+
# def gsub_with_optional_block(*arg, &block)
|
73
|
+
# return to_enum(:gsub_with_optional_block, *arg, &block) unless block_given? || arg.size > 1
|
74
|
+
# gsub_without_optional_block(*arg, &block)
|
75
|
+
# end
|
76
|
+
# alias_method_chain :gsub, :optional_block
|
77
|
+
# end
|
78
78
|
|
79
79
|
# Standard in ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html]
|
80
80
|
unless method_defined? :each_char
|