-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Separate Taski.env from Taski.args #125
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
Conversation
- Add args: and workers: parameters to Task.new for instance-based execution - Add args parameter to TaskWrapper to store args for later use - Make Taski.with_args private and use send for internal calls - Add mock_args helper to TestHelper for testing args-dependent code - Add tests for Task.new(args:).run pattern Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Separate system-managed execution environment information from user-defined
arguments:
- Add Taski::Env class to hold root_task, started_at, working_directory
- Add Taski.env, start_env, reset_env!, with_env methods
- Remove system attributes from Taski::Args (now holds only user options)
- Update call sites to use Taski.env for system info, Taski.args for user options
- Add mock_env helper in TestHelper for testing
This provides cleaner separation of concerns:
- Taski.args: User-defined options passed via run(args: {...})
- Taski.env: System-managed execution environment information
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update test_args.rb to use Taski.env for system attributes: - working_directory, started_at, root_task now accessed via Taski.env - Rename test methods to reflect env usage - Update assertions to check both args and env are cleared after execution Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update documentation to reflect the separation of Args and Env: - README.md: Document Taski.args for user options, Taski.env for system info - examples/args_demo.rb: Update example to use Taski.env for system attributes - examples/README.md: Update API reference Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WalkthroughThis PR separates runtime environment metadata from user-defined arguments in Taski. It introduces a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Taski::Envclass to hold system-managed execution environment info (root_task,started_at,working_directory)Taski::Args(now holds only user-defined options)mock_envhelper inTestHelperfor testingMotivation
Previously,
Taski.argscontained both user-defined options and system-managed execution information. This separation provides cleaner API:Taski.args- User-defined options passed viarun(args: {...})Taski.env- System-managed execution environment informationAPI Changes
Before:
After:
Test plan
Taski.envfor system attributes🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.