Skip to content

Commit

Permalink
1.01
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieb9 committed Jul 3, 2023
1 parent e8b0e4f commit cbf802c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 41 deletions.
3 changes: 2 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Revision history for Hook-Output-Tiny

1.01 UNREL
1.01 2023-07-03
- Deleted AppVeyor test config
- Reworked CI configuration
- Commented out include() and exclude(); they're not ready yet

1.00 2020-12-20
- Completely redesigned stdout() and stderr(). We now auto-generate
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.github/workflows/github_ci_default.yml
Changes
lib/Hook/Output/Tiny.pm
Makefile.PL
Expand Down
84 changes: 44 additions & 40 deletions lib/Hook/Output/Tiny.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,46 +60,50 @@ sub unhook {
open uc $_, '>&', $self->{$_}{handle} or croak($!);
}
}
sub include {
my ($self, $include) = @_;

if (defined $include) {
if (ref $include ne 'ARRAY') {
croak("include() requires an array of regex objects sent in");
}
if (! defined $include->[0]) {
croak("include() requires at least one regex object within the array reference");
}
for (@$include) {
if (ref $_ ne 'REGEX') {
croak("include()'s array reference must only contain regex objects");
}
}
$self->{include} = $include;
}

return $self->{include} // [];
}
sub exclude {
my ($self, $exclude) = @_;

if (defined $exclude) {
if (ref $exclude ne 'ARRAY') {
croak("exclude() requires an array of regex objects sent in");
}
if (! defined $exclude->[0]) {
croak("exclude() requires at least one regex object within the array reference");
}
for (@$exclude) {
if (ref $_ ne 'REGEX') {
croak("exclude()'s array reference must only contain regex objects");
}
}
$self->{exclude} = $exclude;
}

return $self->{exclude} // [];
}
# Commenting out include() and exclude(). They're to be used to filter the
# output. They have no docs nor tests yet.

#sub include {
# my ($self, $include) = @_;
#
# if (defined $include) {
# if (ref $include ne 'ARRAY') {
# croak("include() requires an array of regex objects sent in");
# }
# if (! defined $include->[0]) {
# croak("include() requires at least one regex object within the array reference");
# }
# for (@$include) {
# if (ref $_ ne 'REGEX') {
# croak("include()'s array reference must only contain regex objects");
# }
# }
# $self->{include} = $include;
# }
#
# return $self->{include} // [];
#}
#sub exclude {
# my ($self, $exclude) = @_;
#
# if (defined $exclude) {
# if (ref $exclude ne 'ARRAY') {
# croak("exclude() requires an array of regex objects sent in");
# }
# if (! defined $exclude->[0]) {
# croak("exclude() requires at least one regex object within the array reference");
# }
# for (@$exclude) {
# if (ref $_ ne 'REGEX') {
# croak("exclude()'s array reference must only contain regex objects");
# }
# }
# $self->{exclude} = $exclude;
# }
#
# return $self->{exclude} // [];
#}
sub flush {
my ($self, $handle) = @_;
delete $self->{$_}{data} for _handles($handle);
Expand Down Expand Up @@ -300,7 +304,7 @@ You can find documentation for this module with the perldoc command.
=head1 LICENSE AND COPYRIGHT
Copyright 2016 Steve Bertrand.
Copyright 2023 Steve Bertrand.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
Expand Down

0 comments on commit cbf802c

Please sign in to comment.