Commit | Line | Data |
---|---|---|
9d759b64 | 1 | package DX::Role::SimpleAction; |
2 | ||
3 | use DX::Role; | |
4 | ||
3e465d5d | 5 | with 'DX::Role::Action'; |
6 | ||
0498469a | 7 | has target_path => (is => 'ro', required => 1); |
9d759b64 | 8 | |
0498469a | 9 | has _updates => (is => 'lazy'); |
9d759b64 | 10 | |
0498469a | 11 | requires '_build__updates'; |
12 | ||
13 | sub dry_run { | |
9d759b64 | 14 | my ($self, $hyp) = @_; |
0498469a | 15 | my ($scope, @events) = $hyp->scope->apply_updates($self->_updates); |
9d759b64 | 16 | return ( |
17 | $hyp->but( | |
18 | scope => $scope, | |
19 | actions => [ @{$hyp->actions}, $self ], | |
e442aff8 | 20 | action_applications => [ @{$hyp->action_applications}, $self ], |
9d759b64 | 21 | ), |
22 | @events | |
23 | ); | |
24 | } | |
25 | ||
26 | sub run { shift->updates } | |
27 | ||
28 | 1; |