-
Notifications
You must be signed in to change notification settings - Fork 34
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
Improve code samples #15
Conversation
Fix some bugs and make minor improvements.
Use iterators or "loop" instead of "for" and "while" loops, consistently use double quotes, drop unnecessary "then" etc.
Introduce some variables and methods, simplify file slurping and random position generation, drop some comments etc.
* win.addstr(my_str) | ||
* # or even | ||
* win << "\nORLY" | ||
* win << "\nOH REALLY?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not that easy to understand for non-native speakers... had to look it up...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it's a good change
I like these improvements. You could also swap the |
I only split the assignments in the basic example, not in the more elaborate ones. ok? I essentially never use ARGF, so I'm not sure about it; but do feel free to change as you like :) |
(Travis CI seems to be broken since a couple of builds...) |
Travis seems to be missing a library now, I'll check it later and merge I'll look at switching to ARGF then. Thanks for your work! |
@drbrain This PR is almost a year old, and you essentially already approved. Could you please merge? PS. The last commit certainly is not to blame for the failing CI. |
@stomar I've merged your pull request. Thanks for your contribution! |
@shugo Thanks! And nice to see this is still maintained and improved. |
Major revision of code samples:
All samples tested with Ruby 2.2.