aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/string.rb
AgeCommit message (Collapse)Author
2015-12-03add String#strip_prefixXu Cheng
2015-08-28tweak String#undent so that only leading whitespace up to the first ↵William Woodruff
indentation level is gsubbed, change test_undent to reflect change and add test_undent_nested to test new behavior
2015-08-03Core files style updates.BrewTestBot
Closes Homebrew/homebrew#42354. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-19Remove backports for Ruby 1.8.6Jack Nagel
refs. Homebrew/linuxbrew#438, mistydemeo/tigerbrew#327, mistydemeo/tigerbrew#334
2014-09-28Make inreplace errors fatalJack Nagel
Closes Homebrew/homebrew#32649. Closes Homebrew/homebrew#32703.
2014-09-27Intercept calls to sub! in inreplace blocksJack Nagel
2014-09-26Clean up inreplace regexpsJack Nagel
- use literal syntax - escape interpolated variables - remove intermediate variables - remove unnecessary capture
2014-05-02Fix for String#undentBaptiste Fontaine
Without it, String#undent would fail on unindented strings, e.g.: "foo".undent NoMethodError: undefined method `length' for nil:NilClass` Closes Homebrew/homebrew#28873. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2014-03-27extend/string: backport #rpartitionMisty De Meo
2013-07-19Add String#end_with?Jack Nagel
I'm tired of not remembering if start_with?/end_with? are portable, so just add them both if they're not defined.
2013-07-19Fix String#start_with? implementationJack Nagel
It is supposed to accept a variable number of prefixes, and also to check if they are convertible to strings. This matches behavior documented in RubySpec.
2013-02-15Remove redundant returnJack Nagel
2013-02-15Make this more idiomaticJack Nagel
2012-08-29Record HEAD SHA and date of installs in receiptMax Howell
2012-08-14Improve libiconv diagnostic and suggestionMax Howell
This is coming up a lot at the moment, so here is an attempt to be more helpful.
2012-02-25inreplace: also warn on plain gsub! usageAdam Vandenberg
2012-02-25inreplace: warn if no substitutions were madeJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-07-27Coerce flags to an array in `remove_make_var!`Trevor Wennblom
This is needed for Ruby 1.9.x compatibility, but we still don't support running Homebrew with anything other than a system provided 1.8.[67]. Fixes Homebrew/homebrew#6546 Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-06-19back-port start_with? from 1.8.7Adam Vandenberg
This allows its use in Leopard, which has Ruby 1.8.6.
2011-03-12Move string extensionsAdam Vandenberg
2010-10-30fix warnings: ambiguous first argJamie Macey
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2010-10-17extract undent test to test caseMichael Morgan
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2010-03-07String.undent for prettier HEREDOCsMax Howell