line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Search::Typesense::Version; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
35
|
use Moo; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
28
|
|
4
|
4
|
|
|
4
|
|
1724
|
use Carp qw(croak); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
333
|
|
5
|
4
|
|
|
|
|
32
|
use Search::Typesense::Types qw( |
6
|
|
|
|
|
|
|
NonEmptyStr |
7
|
|
|
|
|
|
|
PositiveOrZeroInt |
8
|
4
|
|
|
4
|
|
30
|
); |
|
4
|
|
|
|
|
11
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has version_string => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
isa => NonEmptyStr, |
15
|
|
|
|
|
|
|
required => 1, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has [qw/major minor patch/] => ( |
19
|
|
|
|
|
|
|
is => 'rwp', |
20
|
|
|
|
|
|
|
isa => PositiveOrZeroInt, |
21
|
|
|
|
|
|
|
init_arg => undef, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub BUILD { |
25
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
26
|
0
|
|
|
|
|
|
my $version = $self->version_string; |
27
|
0
|
0
|
|
|
|
|
unless ( $version =~ /^\d+\.\d+\.\d+$/a ) { |
28
|
0
|
|
|
|
|
|
croak("Invalid version string: $version"); |
29
|
|
|
|
|
|
|
} |
30
|
0
|
|
|
|
|
|
my @version = split /\./ => $version; |
31
|
0
|
|
|
|
|
|
$self->_set_major( $version[0] ); |
32
|
0
|
|
|
|
|
|
$self->_set_minor( $version[1] ); |
33
|
0
|
|
|
|
|
|
$self->_set_patch( $version[2] ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Search::Typesense::Version - Version object for the Typesense server |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Do not use directly. This is returned by the C<typesense_version> method from |
47
|
|
|
|
|
|
|
L<Search::Typesense>. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 METHODS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 C<version_string> |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $version = $typesense->typesense_version; |
54
|
|
|
|
|
|
|
my $version_string = $version->version_string; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Returns the semantic version string, such as C<0.19.0>. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 C<major> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $version = $typesense->typesense_version; |
61
|
|
|
|
|
|
|
my $major = $version->major; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Returns the major version number. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 C<minor> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
my $version = $typesense->typesense_version; |
68
|
|
|
|
|
|
|
my $minor = $version->minor; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Returns the minor version number. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 C<path> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
my $version = $typesense->typesense_version; |
75
|
|
|
|
|
|
|
my $patch = $version->patch; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Returns the patch version number. |
78
|
|
|
|
|
|
|
|