-
Notifications
You must be signed in to change notification settings - Fork 168
Add Ruby workflow for embedded ruby code #707
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
base: main
Are you sure you want to change the base?
Conversation
9761448 to
084e221
Compare
- ruby 2.6: add ignore for Style/ArgumentsForwarding
0371ded to
3c2adbf
Compare
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.
Pull request overview
This PR adds a comprehensive Ruby testing infrastructure to validate embedded Ruby code execution across multiple Ruby versions (2.6 through head) and operating systems. The workflow addresses a known compatibility issue where Ruby versions > 3.4 no longer include the ostruct gem in the default gemset.
Key Changes:
- Added GitHub Actions workflow to test Ruby code against versions 2.6 through head
- Created RSpec test suite with specs for ERBRenderer initialization and rendering
- Modernized erb_renderer.rb with style improvements and safer Ruby patterns
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/ruby.yml | Defines CI workflow to run specs across Ruby 2.6-head and ubuntu/macos |
| templatescompiler/erbrenderer/Gemfile | Adds test dependencies (rspec, standardrb, rake) |
| templatescompiler/erbrenderer/Rakefile | Configures rake tasks for running specs and linting |
| templatescompiler/erbrenderer/.gitignore | Excludes Gemfile.lock from version control |
| templatescompiler/erbrenderer/spec/spec_helper.rb | Sets up RSpec test environment and load paths |
| templatescompiler/erbrenderer/spec/erb_renderer_spec.rb | Adds test coverage for ERBRenderer initialization and template rendering |
| templatescompiler/erbrenderer/erb_renderer.rb | Applies style improvements, modernizes Ruby patterns (alias_method, File.write, JSON.load_file) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| source "https://rubygems.org" | ||
|
|
||
| group :test do | ||
| gem "rake" | ||
| gem "rspec" | ||
| gem "standardrb" | ||
| end |
Copilot
AI
Dec 18, 2025
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.
The Gemfile does not include the 'ostruct' gem, which is required by erb_renderer.rb. According to the PR description, the code will not pass against Ruby > 3.4 because ostruct is no longer part of the default gemset. To ensure compatibility with Ruby > 3.4, add 'gem "ostruct"' to the Gemfile.
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.
This Gemfile is intended only for testing, and can not require gems for "production" execution of the embedded ruby code so this omission is expected, and intentional.
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.
@rkoster - would you care to resolve this for the robot, or shall I?
3c2adbf to
816b026
Compare
This PR adds a workflow to test the execution of the embedded ruby code against Rubies >= 2.6
The spec will not pass against Ruby > 3.4 because the
ostructgem required by the code is no longer part of the default gemset.NOTE: the
bosh-clicurrently relies on whicheverrubyexecutable is found in its$PATHwhen invoked, and does not have the capacity to install gems.