-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Add Ruby Language #139
Add Ruby Language #139
Conversation
β¦rtion and traversal
β¦rtion and traversal
β Deploy Preview for quicksnip ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thank you for your contributions! π After reviewing the provided snippets, hereβs the feedback:
- Please read our Contributing Guidelines carefully, some snippets doesn't follow our guidelines because the usage section is either missing the title or improperly formatted. Here the right example:
def example_function_call()
...
end
# Usage:
example_function_call()
some snippet have # Usage
without colon or # Example Usage
, consistency will help to make QuickSnip a better repo.
- The following snippets do not align with the scope of QuickSnip and should be removed:
singly-linked-list
doubly-linked-list
binary-tree
QuickSnip focuses on self-contained functions that solve specific problems or perform distinct tasks. Full classes, like the ones provided, are outside the scope of what we accept. These implementations are fundamental data structures that are widely available in tutorials and documentation, which doesnβt add significant value as standalone snippets.
-
Changes for
truncate-string
:- The parameter order (
max_length, str
) is unconventional. Typically, the string being operated on is the first parameter, followed by additional options. Please change it tostr, max_length
for better readability and consistency. - Add a guard clause to handle cases where
max_length
is less than 3, as this would result in a negative index forstr[0, max_length - 3]
.
- The parameter order (
-
Improvements for
camel-case-to-snake-case
:- You could add support for
PascalCase
easily. Currently, the implementation leaves a leading underscore if the string starts with an uppercase letter. - Suggested fix:
str.gsub(/([A-Z])/, '_\1').sub(/^_/, '').downcase
- You could add support for
If you have any questions or need clarification, feel free to leave a comment on your PR.
snippets/ruby/string-manipulation/transform-camel-case-to-snake-case.md
Outdated
Show resolved
Hide resolved
β¦pet to transform from sc to pc
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.
Little naming issue, but appart from that it looks good
snippets/ruby/string-manipulation/transform-from-snake-case-to-pascal-case.md
Outdated
Show resolved
Hide resolved
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.
Great work
Description
Add the Ruby programming language and a bunch of categories and snippets
Type of Change
Checklist
Screenshots (Optional)
Click to view screenshots