Skip to content

Conversation

@sergii
Copy link
Collaborator

@sergii sergii commented Dec 3, 2024

Summary of Changes

This pull request introduces several enhancements to the scalar_ruby gem:

  1. Rails installer addition:

    • A new Rails installer has been implemented to facilitate seamless integration of the scalar_ruby gem into Rails applications. By run bin/rails generate scalar:install you can easily setup scalar_ruby into your Rails application.
  2. CI pipeline optimization:

    • A bin/check script has been added to streamline the continuous integration process.
    • The GitHub Actions workflow has been updated to utilize this script, ensuring consistency between local development and CI environments.
    • Enabled parallelism (--jobs 4 --retry 3) in the bundle install command, which made the dependency installation process approximately 29.41% faster.
  3. GitHub Workflow Improvements:

    • Updated the GitHub workflow file to include meaningful job names, making it easier to understand the purpose of each job at a glance.
    • Job names now reflect the Ruby version being tested, for example: Ruby 3.0, Ruby 3.1, etc., instead of generic or less descriptive names.
    • This improves readability in the CI results and provides clear context when reviewing logs or debugging issues.
  4. Gemfile dependencies adjustment:

    • Moved appropriate Gemfile dependencies to the proper environment (development) to ensure the gem's dependencies are well-organized and loaded only when necessary.
  5. Ruby versions requirement updated:

    • The required Ruby version has been updated from >= 2.5 to >= 3.0, < 3.4.
    • This change aligns with the testing matrix in the CI workflow and ensures compatibility with newer language features and improvements.

👨‍💻 Bonus for developers:

  1. Pre-Commit Hook Support:
    • With the introduction of bin/check, developers can now integrate a Git pre-commit hook to ensure code quality and consistency before committing changes.
    • The bin/check script consolidates key checks, including linting, testing, and security audits, making it an ideal tool for local validation.
    • To set up the pre-commit hook:
      1. Create a .git/hooks/pre-commit script:
        #!/bin/sh
        echo "Running pre-commit checks..."
        bin/check || { echo "Pre-commit checks failed! Aborting commit."; exit 1; }
      2. Make the script executable:
        chmod +x .git/hooks/pre-commit
    • Once set up, every git commit will run the bin/check script to validate your code, ensures that all required checks are performed locally before committing code and reducing the risk of introducing issues into the repository.

  1. The Sinatra and Grape generators are still in WIP.
  2. Also, to check changes in README.md, here the Visual updates for REDME.md

@sergii sergii requested a review from dmytroshevchuk December 4, 2024 00:36
@sergii sergii self-assigned this Dec 4, 2024
@sergii sergii added the enhancement New feature or request label Dec 4, 2024
@fthobe
Copy link

fthobe commented Feb 1, 2025

@dmytroshevchuk Can this be merged? I think it's a great addition.

@dmytroshevchuk
Copy link
Owner

@fthobe hey! sorry, I didn't have time to address this earlier. I'll merge this and release a new version of the gem shortly.

Thank you for keeping an eye on it, I really appreciate that!

@fthobe
Copy link

fthobe commented Feb 10, 2025

Most credit goes to @sergii who actually made this happen ;)

@dmytroshevchuk dmytroshevchuk merged commit 763b134 into dmytroshevchuk:main Feb 10, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants