Skip to content
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

Alternative line numbering and comment fix. #1

Merged
merged 2 commits into from Jan 12, 2012

Conversation

KL-7
Copy link
Contributor

@KL-7 KL-7 commented Jan 12, 2012

Added alternative version for line numbering per file. It might have issues with multi-byte encoding as ARGF#pos returns position in bytes. To work properly in that cases String#bytesize can be used instead of regular String#size.

In addition fixed comment for removing consecutive blank lines. I was thinking for a while how that can remove consecutive duplicate lines and finally realized that you speaking about blank lines.

JoshCheek added a commit that referenced this pull request Jan 12, 2012
Alternative line numbering and comment fix.
@JoshCheek JoshCheek merged commit d51fd94 into JoshCheek:master Jan 12, 2012
@JoshCheek
Copy link
Owner

Nice! Thank you, I was so frustrated by that one! Also didn't know $< was ARGF. Sorry you have to dl my entire play dir to get that, I'm not smart enough to figure out submodules >.<

@KL-7
Copy link
Contributor Author

KL-7 commented Jan 12, 2012

Looks like Github has an option for forking the project and editing the file online. But I decided against it as I was afraid it'd send pull request instantly.

Anyway, thank you for such a great collection. I think I'll dig in some other stuff from that repo later.

P.S. Shorter solution (without regexps) for trimming trailing spaces: ruby -lpe '$_.rstrip!'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants