-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor configuration to prevent shared state between parent and child classes #298
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Replaced direct attribute accessors with `ActiveSupport::Configurable` for better flexibility and centralized configurations. - Refactored methods to use `config_accessor`, streamlining configuration access and default value assignment. - Corrected `predicate_methods_enabled` usage across various files to align with the new configuration structure. - Fixed error messages in test examples for consistency and accuracy in `undefined method` references.
- Replaced `Setup` class with a `Configurable` module for modularization and better maintainability. - Standardized configuration access by replacing direct calls with `config` in context, action, and result classes. - Centralized default values and option helpers in `Configurable` to ensure consistency and reduce duplication. - Removed method_missing references to outdated configuration structure. - Introduced `include Configurable` in DSL for seamless integration with configuration setups.
- Updated method signatures in `Factory` to remove unnecessary `singleton` references for exception classes. - Standardized type annotations for `input_exception_class`, `internal_exception_class`, `output_exception_class`, `failure_class`, and `result_class`. - Ensured return types clarify relationships with exception instances, improving code readability and maintainability.
- Reduced the length of comment dividers to maintain consistency with style guidelines. - Updated all section separators in `Configurable` to use shorter divider lines. - Ensured changes improve readability without affecting functionality.
- Moved default values for `collection_mode_class_names` and `hash_mode_class_names` to private class methods, reducing redundancy and improving encapsulation. - Updated references to use direct method calls instead of `config` for default values, simplifying access patterns. - Removed obsolete `config_accessor` declarations for unused default values, streamlining configuration management. - Ensured existing functionality remains intact while improving maintainability and readability.
- Moved default input, internal, and output option helpers to private class methods for improved encapsulation and reduced redundancy. - Replaced `config_accessor` declarations with direct method references, streamlining default helpers configuration. - Improved maintainability and readability without altering existing behavior.
- Introduced a `Config` class to centralize configuration attributes. - Replaced `config_accessor` with `Config` instance methods, reducing redundancy and improving maintainability. - Added `dup_for_inheritance` to `Config` for cleaner inheritance handling. - Simplified collection duplication using `initialize_dup` in related classes. - Improved encapsulation by moving default value handling to private class methods.
- Updated error strings in `Wrong::Must::Example1`, `Example2`, and `Example5` to clarify that the issue is with an undefined local variable or method. - Adjusted messages for Ruby versions >= 3.4.0 to ensure consistency and precision. - Aimed to enhance debugging clarity and developer experience.
- Replaced short variable names like `c` with more descriptive names like `config` for clarity. - Improved method chaining readability with consistent indentation. - Added `rubocop:disable` comment for `dup_for_inheritance` to suppress method size warnings. - Refined default helpers, ensuring cleaner and more consistent formatting. - Streamlined configuration setup process without altering functionality.
- Reordered methods in `Factory` for logical grouping and clarity. - Rearranged `Configurable` attributes with descriptive comments for easier navigation. - Updated attribute order in `Config` to maintain consistency and encapsulation. - Enhanced default configuration setup by aligning comments and structuring related attributes logically. - Ensured no changes to functionality while improving maintainability.
- Unified error messages in `Example1`, `Example2`, and `Example5` to clarify undefined local variable or method issues. - Replaced outdated regex patterns with precise and consistent string error messages. - Ensured alignment of messages across Ruby versions for better debugging clarity.
- Standardized error messages in `Example1`, `Example2`, and `Example5` specs. - Adjusted undefined method error phrasing for consistency across Ruby versions. - Improved debugging clarity by aligning error strings with the latest message format.
- Added Ruby version-specific error handling for versions >= 3.3.0 in `Example1`, `Example2`, and `Example5`. - Improved clarity and precision of error messages for undefined local variables or methods across all specs. - Aligned message formatting for better debugging and consistent developer experience.
- Introduced `@servactory_service_info` attribute in `Workspace` class for actor tracking. - Removed redundant aliases (`inp`, `int`, `out`) for inputs, internals, and outputs, improving clarity. - Refactored attribute and method order for better organization. - Updated private methods to streamline internal handling and encapsulation.
- Added `Config` class to define and manage configuration attributes in `Servactory::Configuration`. - Introduced `Configurable` module to provide configuration functionality via `@config` and default value handling. - Centralized and encapsulated default configuration, improving maintainability and organization.
- Added `initialize_dup` methods across multiple `Collection` classes to streamline duplication handling. - Updated `Factory` class to use `Config` instead of `Setup` for configuration attributes. - Made various method type adjustments to allow optional or flexible input types. - Improved maintainability and consistency across the configuration setup.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.