mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
16 lines
224 B
Ruby
16 lines
224 B
Ruby
![]() |
class String
|
||
|
def undent
|
||
|
gsub /^.{#{slice(/^ +/).length}}/, ''
|
||
|
end
|
||
|
end
|
||
|
|
||
|
if __FILE__ == $0
|
||
|
undented = <<-EOS.undent
|
||
|
hi
|
||
|
....my friend over
|
||
|
there
|
||
|
EOS
|
||
|
|
||
|
assert undented == "hi\nmy friend over\nthere\n"
|
||
|
end
|