Skip to content

Commit

Permalink
Merge pull request #2 from manwar/minor-improvements
Browse files Browse the repository at this point in the history
- Updated how we checked mandatory parameters slightly.
  • Loading branch information
stevieb9 committed Feb 12, 2018
2 parents 1948959 + 08b5aba commit 0593450
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/Github/Backup.pm
Expand Up @@ -60,10 +60,9 @@ sub BUILD {
$self->token($ENV{GITHUB_TOKEN}) if $ENV{GITHUB_TOKEN};
}

for ($self->api_user, $self->token, $self->dir){
if (! $_){
croak "When instantiating an object, the 'api_user', 'token' and " .
"'dir' parameters are mandatory...\n";
for my $key (qw/api_user token dir/){
if (! $self->{$key}){
croak "ERROR: Missing mandatory parameter [$key].\n";
}
}

Expand Down Expand Up @@ -316,4 +315,3 @@ under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See L<http://dev.perl.org/licenses/> for more information.

0 comments on commit 0593450

Please sign in to comment.