Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here’s the second round.
Fix bad class method definitions
Good explanation is in the Ruby Style Guide.
Move colored_text to core_ext subdir and rename to colored_string
There's a good convention to put monkey-patching of core classes into
core_ext
subdirectory, to be very clear what's going on.Remove unnecessary monkey-patching of String
Monkey-patching should be used very cautiously and sparingly, especially in the case of core classes. When you monkey-patch some class (e.g. add some method to it), it doesn’t change it only in the current context (file), but globally!
Fix camelCase method names
This is strong Ruby convention.
Remove unreasonable includes to main
I’m not sure if you actually know what
include
does. There’s a good explanation on StackOverflow. When you include some class/module on the top-level (i.e. not inside another class/module), then you include it into the top-level object calledmain
. This is not scoped to the current file, it’s global! This is useful only for DSLs, in the most of other cases it’s inappropriate and messy.