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

Add Ruby Language #139

Merged
merged 20 commits into from
Jan 4, 2025
Merged

Add Ruby Language #139

merged 20 commits into from
Jan 4, 2025

Conversation

ACR1209
Copy link
Contributor

@ACR1209 ACR1209 commented Jan 2, 2025

Description

Add the Ruby programming language and a bunch of categories and snippets

Type of Change

  • ✨ New snippet
  • πŸ›  Improvement to an existing snippet
  • 🐞 Bug fix
  • πŸ“– Documentation update
  • πŸ”§ Other (please describe): New language and new category

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Screenshots (Optional)

Click to view screenshots

Copy link

netlify bot commented Jan 2, 2025

βœ… Deploy Preview for quicksnip ready!

Name Link
πŸ”¨ Latest commit 461ae2d
πŸ” Latest deploy log https://app.netlify.com/sites/quicksnip/deploys/6776fe10f5b3ac0008c8538e
😎 Deploy Preview https://deploy-preview-139--quicksnip.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@majvax majvax left a 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:

  1. 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.

  1. 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.

  1. 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 to str, 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 for str[0, max_length - 3].
  2. 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

If you have any questions or need clarification, feel free to leave a comment on your PR.

@majvax majvax added update needed Code needs to be updated. Snippets and removed update needed Code needs to be updated. labels Jan 3, 2025
@ACR1209 ACR1209 requested a review from majvax January 3, 2025 23:55
Copy link
Collaborator

@Mathys-Gasnier Mathys-Gasnier left a 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

@ACR1209 ACR1209 requested a review from Mathys-Gasnier January 4, 2025 19:04
Copy link
Collaborator

@Mathys-Gasnier Mathys-Gasnier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work

@Mathys-Gasnier Mathys-Gasnier merged commit 9105c2a into technoph1le:main Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants