Skip to content

Commit

Permalink
delete environment support added
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Aug 15, 2012
1 parent 0d199b6 commit ba9fd95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Pantry/App/Command/delete.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sub command_type {
}

sub valid_types {
return qw/node role/
return qw/node role environment/
}

sub options {
Expand All @@ -40,6 +40,11 @@ sub _delete_role {
$self->_delete_obj($opt, "role", $name);
}

sub _delete_environment {
my ($self, $opt, $name) = @_;
$self->_delete_obj($opt, "environment", $name);
}

sub _delete_obj {
my ($self, $opt, $type, $name) = @_;

Expand Down
6 changes: 6 additions & 0 deletions t/app/delete.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ my @cases = (
name => 'web',
new => sub { my ($p,$n) = @_; $p->role($n) },
},
{
label => "environment",
type => "environment",
name => 'test',
new => sub { my ($p,$n) = @_; $p->environment($n) },
},
);

local $ENV{PERL_MM_USE_DEFAULT} = 1;
Expand Down

0 comments on commit ba9fd95

Please sign in to comment.