mini_racer is a Ruby gem with a CRuby C/C++ extension around V8 and a separate
TruffleRuby implementation. Keep changes focused and preserve behavior across
supported Ruby versions and platforms.
bundle install
bundle exec rake compile
bundle exec rake test
bundle exec rake lintRun focused tests while iterating, for example:
bundle exec ruby -Itest test/mini_racer_test.rb
bundle exec ruby -Itest test/single_threaded_test.rbFormat changed Ruby files with bundle exec stree write <files>. CI runs
bundle exec rake lint, which checks Syntax Tree formatting and RuboCop lint.
After native changes, always recompile before testing.
- Follow nearby Ruby and native code style; avoid unrelated refactors.
- Add or update tests for behavior changes. Use isolated subprocesses for platform-global, fork, crash, or process-shutdown behavior.
- Preserve the distinction between default-platform and
:single_threadedV8 lifecycle paths, especially around threads, locks, callbacks, and forks. - Do not edit generated files under
tmp/or compiled extension artifacts. - Before finishing, run relevant focused tests,
bundle exec rake lint,bundle exec rake test, andgit diff --check.