lib/fat_table/patches.rb in fat_table-0.2.8 vs lib/fat_table/patches.rb in fat_table-0.2.9
- old
+ new
@@ -17,12 +17,12 @@
end
unless ''.respond_to?(:match?)
# Add String#match? to pre-2.4 ruby
class String
- def match?(re)
- self =~ re
+ def match?(regexp)
+ self =~ regexp
end
end
end
unless //.respond_to?(:match?)
@@ -33,9 +33,10 @@
end
end
end
unless ''.respond_to?(:strip_heredoc)
+ # Patch String to provide heredocs with whitespace stripped
class String
def strip_heredoc
indent = chomp.scan(/^\s*/).min.size
gsub(/^\s{#{indent}}/, '')
end