backports 1.6.3 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|