From: Matt S Trout Date: Mon, 3 Feb 2014 11:13:20 +0000 (+0000) Subject: bind_var_then -> bind_value X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0de441cd75f703bd987450fb0d90c3f57bbfdaf1;p=scpubgit%2FDKit.git bind_var_then -> bind_value --- diff --git a/lib/DX/State.pm b/lib/DX/State.pm index 7ef08c7..9f4bf6b 100644 --- a/lib/DX/State.pm +++ b/lib/DX/State.pm @@ -57,12 +57,11 @@ sub assign_vars { ); } -sub bind_var_then { - my ($self, $var, $value, $then) = @_; +sub bind_value { + my ($self, $var, $value) = @_; my $bound = $var->with_value($value); $self->but( by_id => { %{$self->by_id}, $var->id => $bound }, - next_op => $then ); } diff --git a/t/observe.t b/t/observe.t index 70b70c1..04432ac 100644 --- a/t/observe.t +++ b/t/observe.t @@ -15,7 +15,8 @@ my %paths = %observe_path; my $set_dot_ssh = FromCode->new( code => sub { my ($self, $state) = @_; - $state->bind_var_then($state->scope_var('P'), '/home/me/.ssh', $self->next); + $state->bind_value($state->scope_var('P'), '/home/me/.ssh') + ->then($self->next); } ); @@ -23,7 +24,8 @@ my $path_status = FromCode->new( code => sub { my ($self, $state) = @_; if (my $p = $paths{$state->scope_var('P')->bound_value}) { - return $state->bind_var_then($state->scope_var('PS'), $p, $self->next); + return $state->bind_value($state->scope_var('PS'), $p) + ->then($self->next); } return $state->backtrack; } diff --git a/t/ssh_key.t b/t/ssh_key.t index ef61682..da18596 100644 --- a/t/ssh_key.t +++ b/t/ssh_key.t @@ -28,7 +28,7 @@ sub make_set_bind { die "key unbound" unless $key->is_bound; die "thing bound" if $thing->is_bound; if (my $value = $set->{$key->bound_value}) { - return $state->bind_var_then($thing, $value, $self->next); + return $state->bind_value($thing, $value)->then($self->next); } return $state->backtrack; }