| Filename | /home/leont/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/CPAN/Meta/Feature.pm |
| Statements | Executed 10 statements in 190µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 765µs | 3.58ms | CPAN::Meta::Feature::BEGIN@8 |
| 1 | 1 | 1 | 6µs | 6µs | CPAN::Meta::BEGIN@1 |
| 1 | 1 | 1 | 4µs | 5µs | CPAN::Meta::BEGIN@2 |
| 1 | 1 | 1 | 2µs | 9µs | CPAN::Meta::BEGIN@3 |
| 1 | 1 | 1 | 600ns | 600ns | CPAN::Meta::Feature::__ANON__ (xsub) |
| 0 | 0 | 0 | 0s | 0s | CPAN::Meta::Feature::description |
| 0 | 0 | 0 | 0s | 0s | CPAN::Meta::Feature::identifier |
| 0 | 0 | 0 | 0s | 0s | CPAN::Meta::Feature::new |
| 0 | 0 | 0 | 0s | 0s | CPAN::Meta::Feature::prereqs |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 2 | 20µs | 1 | 6µs | # spent 6µs within CPAN::Meta::BEGIN@1 which was called:
# once (6µs+0s) by CPAN::Meta::BEGIN@57 at line 1 # spent 6µs making 1 call to CPAN::Meta::BEGIN@1 |
| 2 | 2 | 9µs | 2 | 6µs | # spent 5µs (4+1) within CPAN::Meta::BEGIN@2 which was called:
# once (4µs+1µs) by CPAN::Meta::BEGIN@57 at line 2 # spent 5µs making 1 call to CPAN::Meta::BEGIN@2
# spent 1µs making 1 call to strict::import |
| 3 | 2 | 20µs | 2 | 16µs | # spent 9µs (2+7) within CPAN::Meta::BEGIN@3 which was called:
# once (2µs+7µs) by CPAN::Meta::BEGIN@57 at line 3 # spent 9µs making 1 call to CPAN::Meta::BEGIN@3
# spent 7µs making 1 call to warnings::import |
| 4 | package CPAN::Meta::Feature; | ||||
| 5 | |||||
| 6 | 1 | 200ns | our $VERSION = '2.150010'; | ||
| 7 | |||||
| 8 | 2 | 141µs | 2 | 3.58ms | # spent 3.58ms (765µs+2.82) within CPAN::Meta::Feature::BEGIN@8 which was called:
# once (765µs+2.82ms) by CPAN::Meta::BEGIN@57 at line 8 # spent 3.58ms making 1 call to CPAN::Meta::Feature::BEGIN@8
# spent 600ns making 1 call to CPAN::Meta::Feature::__ANON__ |
| 9 | |||||
| 10 | #pod =head1 DESCRIPTION | ||||
| 11 | #pod | ||||
| 12 | #pod A CPAN::Meta::Feature object describes an optional feature offered by a CPAN | ||||
| 13 | #pod distribution and specified in the distribution's F<META.json> (or F<META.yml>) | ||||
| 14 | #pod file. | ||||
| 15 | #pod | ||||
| 16 | #pod For the most part, this class will only be used when operating on the result of | ||||
| 17 | #pod the C<feature> or C<features> methods on a L<CPAN::Meta> object. | ||||
| 18 | #pod | ||||
| 19 | #pod =method new | ||||
| 20 | #pod | ||||
| 21 | #pod my $feature = CPAN::Meta::Feature->new( $identifier => \%spec ); | ||||
| 22 | #pod | ||||
| 23 | #pod This returns a new Feature object. The C<%spec> argument to the constructor | ||||
| 24 | #pod should be the same as the value of the C<optional_feature> entry in the | ||||
| 25 | #pod distmeta. It must contain entries for C<description> and C<prereqs>. | ||||
| 26 | #pod | ||||
| 27 | #pod =cut | ||||
| 28 | |||||
| 29 | sub new { | ||||
| 30 | my ($class, $identifier, $spec) = @_; | ||||
| 31 | |||||
| 32 | my %guts = ( | ||||
| 33 | identifier => $identifier, | ||||
| 34 | description => $spec->{description}, | ||||
| 35 | prereqs => CPAN::Meta::Prereqs->new($spec->{prereqs}), | ||||
| 36 | ); | ||||
| 37 | |||||
| 38 | bless \%guts => $class; | ||||
| 39 | } | ||||
| 40 | |||||
| 41 | #pod =method identifier | ||||
| 42 | #pod | ||||
| 43 | #pod This method returns the feature's identifier. | ||||
| 44 | #pod | ||||
| 45 | #pod =cut | ||||
| 46 | |||||
| 47 | sub identifier { $_[0]{identifier} } | ||||
| 48 | |||||
| 49 | #pod =method description | ||||
| 50 | #pod | ||||
| 51 | #pod This method returns the feature's long description. | ||||
| 52 | #pod | ||||
| 53 | #pod =cut | ||||
| 54 | |||||
| 55 | sub description { $_[0]{description} } | ||||
| 56 | |||||
| 57 | #pod =method prereqs | ||||
| 58 | #pod | ||||
| 59 | #pod This method returns the feature's prerequisites as a L<CPAN::Meta::Prereqs> | ||||
| 60 | #pod object. | ||||
| 61 | #pod | ||||
| 62 | #pod =cut | ||||
| 63 | |||||
| 64 | sub prereqs { $_[0]{prereqs} } | ||||
| 65 | |||||
| 66 | 1 | 1µs | 1; | ||
| 67 | |||||
| 68 | # ABSTRACT: an optional feature provided by a CPAN distribution | ||||
| 69 | |||||
| 70 | =pod | ||||
| 71 | |||||
| 72 | =encoding UTF-8 | ||||
| 73 | |||||
| 74 | =head1 NAME | ||||
| 75 | |||||
| 76 | CPAN::Meta::Feature - an optional feature provided by a CPAN distribution | ||||
| 77 | |||||
| 78 | =head1 VERSION | ||||
| 79 | |||||
| 80 | version 2.150010 | ||||
| 81 | |||||
| 82 | =head1 DESCRIPTION | ||||
| 83 | |||||
| 84 | A CPAN::Meta::Feature object describes an optional feature offered by a CPAN | ||||
| 85 | distribution and specified in the distribution's F<META.json> (or F<META.yml>) | ||||
| 86 | file. | ||||
| 87 | |||||
| 88 | For the most part, this class will only be used when operating on the result of | ||||
| 89 | the C<feature> or C<features> methods on a L<CPAN::Meta> object. | ||||
| 90 | |||||
| 91 | =head1 METHODS | ||||
| 92 | |||||
| 93 | =head2 new | ||||
| 94 | |||||
| 95 | my $feature = CPAN::Meta::Feature->new( $identifier => \%spec ); | ||||
| 96 | |||||
| 97 | This returns a new Feature object. The C<%spec> argument to the constructor | ||||
| 98 | should be the same as the value of the C<optional_feature> entry in the | ||||
| 99 | distmeta. It must contain entries for C<description> and C<prereqs>. | ||||
| 100 | |||||
| 101 | =head2 identifier | ||||
| 102 | |||||
| 103 | This method returns the feature's identifier. | ||||
| 104 | |||||
| 105 | =head2 description | ||||
| 106 | |||||
| 107 | This method returns the feature's long description. | ||||
| 108 | |||||
| 109 | =head2 prereqs | ||||
| 110 | |||||
| 111 | This method returns the feature's prerequisites as a L<CPAN::Meta::Prereqs> | ||||
| 112 | object. | ||||
| 113 | |||||
| 114 | =head1 BUGS | ||||
| 115 | |||||
| 116 | Please report any bugs or feature using the CPAN Request Tracker. | ||||
| 117 | Bugs can be submitted through the web interface at | ||||
| 118 | L<http://rt.cpan.org/Dist/Display.html?Queue=CPAN-Meta> | ||||
| 119 | |||||
| 120 | When submitting a bug or request, please include a test-file or a patch to an | ||||
| 121 | existing test-file that illustrates the bug or desired feature. | ||||
| 122 | |||||
| 123 | =head1 AUTHORS | ||||
| 124 | |||||
| 125 | =over 4 | ||||
| 126 | |||||
| 127 | =item * | ||||
| 128 | |||||
| 129 | David Golden <dagolden@cpan.org> | ||||
| 130 | |||||
| 131 | =item * | ||||
| 132 | |||||
| 133 | Ricardo Signes <rjbs@cpan.org> | ||||
| 134 | |||||
| 135 | =item * | ||||
| 136 | |||||
| 137 | Adam Kennedy <adamk@cpan.org> | ||||
| 138 | |||||
| 139 | =back | ||||
| 140 | |||||
| 141 | =head1 COPYRIGHT AND LICENSE | ||||
| 142 | |||||
| 143 | This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors. | ||||
| 144 | |||||
| 145 | This is free software; you can redistribute it and/or modify it under | ||||
| 146 | the same terms as the Perl 5 programming language system itself. | ||||
| 147 | |||||
| 148 | =cut | ||||
| 149 | |||||
| 150 | __END__ | ||||
# spent 600ns within CPAN::Meta::Feature::__ANON__ which was called:
# once (600ns+0s) by CPAN::Meta::Feature::BEGIN@8 at line 8 |