Montag, 27. April 2015

Now meta_info is running

I cannot work with vim on Android. It is running, but not my philosophy. Therefore I cannot use perltags.
So I started a simple meta_info system for Perl classes and methods using my CPAN modules Report::Porf, PQL::Cache and Scalar::Validation.
Calling meta_scan.pl creates a PQL::Cache and dumps it into a file,
meta_info.pl reads the dumped Cache in less than a second and then you can query classes and methods by

c Porf (Lists all classes containing "Porf" in namespace or classname)
m new (same for methods)
mc Porf get_.* (All getters from all classes containing Porf)

you can use regexes like possible in PQL::Cache, and thats a lot of possibilities.

See following session with highlighted commands:

# Load from file .../perl_meta_dump.pl.dump
# 1167 class infos loaded.
# 10384 method infos loaded.
? c Path
command c Path
# select classes matching names by 'Path'
# 2 classes found

*=====+========================+==========*
|  ID |        fullname        | line_nbr |
*-----+------------------------+----------*
| 609 | ExtUtils::InstallPaths | 1        |
| 686 | File::Path             | 1        |
*=====+========================+==========*
? mc File::Path
command mc File::Path
# select methods of classes 'File::Path'
# 1 classes found.
# select methods with matching names by '.*'

*======+============+==========+=============*
|  ID  |    class   | line_nbr |     name    |
*------+------------+----------+-------------*
| 5414 | File::Path | 36       | _carp       |
| 5415 | File::Path | 41       | _croak      |
| 5416 | File::Path | 46       | _error      |
| 5421 | File::Path | 169      | _is_subdir  |
| 5419 | File::Path | 117      | _mkpath     |
| 5423 | File::Path | 257      | _rmtree     |
| 5424 | File::Path | 441      | _slash_lc   |
| 5417 | File::Path | 61       | make_path   |
| 5418 | File::Path | 66       | mkpath      |
| 5420 | File::Path | 164      | remove_tree |
| 5422 | File::Path | 187      | rmtree      |
*======+============+==========+=============*
? h
command h
[  1] c Path
[  2] mc Path

? qq
command qq

# Goodbye!

Keine Kommentare:

Kommentar veröffentlichen