| 1 | package App::ListOrgHeadlinesFast; | ||
| 2 | |||
| 3 | 1 | ▶ | use 5.010; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use App::FilterOrgByHeadlines; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use Function::Fallback::CoreOrPP qw(clone); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 11 | 1 | our $DATE = '2026-07-22'; # DATE | |
| 12 | 1 | our $DIST = 'App-OrgUtils'; # DIST | |
| 13 | 1 | our $VERSION = '0.489'; # VERSION | |
| 14 | |||
| 15 | 1 | our %SPEC; | |
| 16 | |||
| 17 | 1 | $SPEC{':package'} = { | |
| 18 | v => 1.1, | ||
| 19 | summary => 'List & count Org headlines & todos', | ||
| 20 | }; | ||
| 21 | |||
| 22 | 1 | $SPEC{list_org_headlines} = do { | |
| 23 | 1 | my $meta = clone $App::FilterOrgByHeadlines::SPEC{filter_org_by_headlines}; | |
| 24 | 1 | $meta->{summary} = 'List Org headlines'; | |
| 25 | 1 | delete $meta->{args}{with_content}; | |
| 26 | 1 | delete $meta->{args}{with_preamble}; | |
| 27 | 1 | delete $meta->{args}{return_array}; | |
| 28 | 1 | $meta->{result}{schema} = ['array*', of=>'str*']; | |
| 29 | 1 | $meta; | |
| 30 | }; | ||
| 31 | 0 | ▶ | sub list_org_headlines { |
|
Subroutine
list_org_headlines: not called CC=2 SCAR=17.9
Pod
documented
| |||
| 32 | 0 | my %args = @_; | |
| 33 | |||
| 34 | 0 | my $headlines = App::FilterOrgByHeadlines::filter_org_by_headlines( | |
| 35 | %args, | ||
| 36 | with_content => 0, | ||
| 37 | with_preamble => 0, | ||
| 38 | return_array => 1, | ||
| 39 | ); | ||
| 40 | |||
| 41 | 0 | chomp for @$headlines; | |
| 42 | 0 | $headlines; | |
| 43 | } | ||
| 44 | |||
| 45 | 1 | $SPEC{list_org_todos} = do { | |
| 46 | 1 | my $meta = clone $SPEC{list_org_headlines}; | |
| 47 | 1 | $meta->{summary} = 'List Org todos'; | |
| 48 | 1 | delete $meta->{args}{is_todo}; | |
| 49 | 1 | $meta; | |
| 50 | }; | ||
| 51 | 0 | ▶ | sub list_org_todos { |
|
Subroutine
list_org_todos: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 52 | 0 | my %args = @_; | |
| 53 | |||
| 54 | 0 | list_org_headlines( | |
| 55 | %args, | ||
| 56 | is_todo => 1, | ||
| 57 | ); | ||
| 58 | } | ||
| 59 | |||
| 60 | 1 | $SPEC{count_org_headlines} = do { | |
| 61 | 1 | my $meta = clone $SPEC{list_org_headlines}; | |
| 62 | 1 | $meta->{summary} = 'Count Org headlines'; | |
| 63 | 1 | $meta->{result}{schema} = ['int*']; | |
| 64 | 1 | $meta; | |
| 65 | }; | ||
| 66 | 0 | ▶ | sub count_org_headlines { |
|
Subroutine
count_org_headlines: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 67 | 0 | my %args = @_; | |
| 68 | |||
| 69 | 0 | my $res = list_org_headlines(%args); | |
| 70 | 0 | scalar @$res; | |
| 71 | } | ||
| 72 | |||
| 73 | 1 | $SPEC{count_org_todos} = do { | |
| 74 | 1 | my $meta = clone $SPEC{count_org_headlines}; | |
| 75 | 1 | $meta->{summary} = 'Count Org todos'; | |
| 76 | 1 | delete $meta->{args}{is_todo}; | |
| 77 | 1 | $meta; | |
| 78 | }; | ||
| 79 | 0 | ▶ | sub count_org_todos { |
|
Subroutine
count_org_todos: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 80 | 0 | my %args = @_; | |
| 81 | |||
| 82 | 0 | count_org_headlines( | |
| 83 | %args, | ||
| 84 | is_todo => 1, | ||
| 85 | ); | ||
| 86 | } | ||
| 87 | |||
| 88 | 1 | 1; | |
| 89 | # ABSTRACT: List & count Org headlines & todos | ||
| 90 | |||
| 91 | __END__ | ||