Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix _before(), _after()
  • Loading branch information
rsrchboy committed Feb 16, 2010
1 parent 88d7999 commit ac2bd64
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/RPM/Spec.pm
Expand Up @@ -161,8 +161,9 @@ has _changelog => (

sub _build__changelog { [ _after('%changelog', shift->content) ] }

sub _before { my $sep = shift; $_ = pop while $_ && !/^$sep/; @_ }
sub _after { my $sep = shift; $_ = shift while $_ && !/^$sep/; @_ }
sub _before { my $sep = shift @_; my @l; do { return @l if /^$sep/; push @l, $_ } for @_ }
sub _after { reverse _before(shift, reverse @_) }


__PACKAGE__->meta->make_immutable;

Expand Down

0 comments on commit ac2bd64

Please sign in to comment.