Actions
Feature #23143
openAdd tool for easy evaluation of options
Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Description
We need easier way to add custom option sources and validations.
In both the ordering matters so we need to be able to specify where the operation should happen.
Example of block that should add option source resolving custom option right after resulution
of decumented options and doing some validation after all sources are done
class MyCommand evaluate_options do add_source(:after => :id_params, :source => CustomIdParams(self, :required_params => :object_id)) add_source(:at => :start) { |defined_options, result| result.merge('option' => 'value') } add_validation(:at => :end) do any(:option_a, :option_b).required end end build_options end
Actions