X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FZeal.pm;h=2ea9ad7515d6f24546d66f128c367fd0a7a788d4;hb=dded0d050e77c06af7afdd61f910bfe40db1de0f;hp=1fd78bdaa12abd4a7e7b89625cfa2ad06f9fde2d;hpb=6fbbe9022d22110ddb00f884d78b11508cfe874a;p=zeal.git diff --git a/lib/Zeal.pm b/lib/Zeal.pm index 1fd78bd..2ea9ad7 100644 --- a/lib/Zeal.pm +++ b/lib/Zeal.pm @@ -5,7 +5,7 @@ use strict; use warnings; use re '/s'; -our $VERSION = '0.000_001'; +our $VERSION = '0.001001'; use File::Spec::Functions qw/catfile/; @@ -41,12 +41,13 @@ sub add { sub sets { my ($self, $family) = @_; return map { @$_ } values %{$self->{sets}} unless $family; + die "No docsets in family '$family'\n" unless $self->{sets}{$family}; @{$self->{sets}{$family}} } sub query { my ($self, $query, $family) = @_; - ($family, $query) = split /:/, $query, 2 if !$family && $query =~ /:/; + ($family, $query) = split /:/, $query, 2 if !$family && $query =~ /^\w+:[^:]/; my @res = map { $_->query($query) } $self->sets($family); wantarray ? @res : $res[0] } @@ -120,7 +121,7 @@ Marius Gavrilescu, Emarius@ieval.roE =head1 COPYRIGHT AND LICENSE -Copyright (C) 2014 by Marius Gavrilescu +Copyright (C) 2014-2015 by Marius Gavrilescu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.1 or,