-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String#indent not working according to demo 🐛 #179
Comments
That one took me a bit to figure out. There was a major transition in these methods starting in mid 2012 and culminating in Jan 2014. In short, it went something like this:
It was point No. 1 that actually caused that demo to go afoul. def tab(n)
gsub(/^ */, ' ' * n)
end I don't recall why I got rid of that altogether now. Guess I thought that was too simple to require a method. Perhaps it would make sense to reintroduce this definition as a new method, or perhaps as a different option of In any case, the |
P.S. Here's the difference between margin with and without a = " abc\n xyz"
a.margin(2)
=> " abc\n xyz"
a.margin(2, :lead=>true)
=> " abc\nxyz"
a.margin(4)
=> " abc\n xyz"
a.margin(4, :lead=>true)
=> " abc\n xyz" |
Unless there are any objections I will close this. |
String#tab is an alias for String#indent. But there are separate tests and demos maintained for both. The tab demo states
Unlike #tabto, #tab indents all lines equally regardless of prior indention.
. Followed by:The text was updated successfully, but these errors were encountered: