App-Relate-Complex

 view release on metacpan or  search on metacpan

relate_complex  view on Meta::CPAN

=head1 DESCRIPTION

The mnemonic is that B<relate_complex> makes the file system a little
more relational and a little less hierarchical.

Essentially this script is the equivalent of

      locate primary_term | egrep term2 | egrep term3 [....| termN]

Though by default relate_complex also automatically screens out
some "uninteresting" files (emacs backups, CVS/RCS
repositories, etc.).

An important performance hint: you can speed up relate_complex
tremendously by using a relatively unique first term.
For example, if you're on a unix box, you don't want to
start with something like "lib" which is going to match a
huge number of files in the locate database. You'll find
that "relate_complex gdk lib" is much faster than "relate_complex lib
gdk".

relate_complex  view on Meta::CPAN

   relate_complex my_site index -htm$

will screen out files ending in "htm" (but not "html").

This script has the extremely useful feature of automatically
omitting uninteresting files, but it's guaranteed that you'll
be confused by this some day, so don't say I didn't warn you.
As of this writing, by default files are ignored that match
these patterns:

      '~$';      # emacs backups
      '/\#';     # emacs autosaves
      ',v$';     # cvs/rcs repository files
      '/CVS$'
      '/CVS/'
      '/RCS$'
      '\.elc$';  # compiled elisp

This default filter is named ":skipdull", and can be modified by
editing your personal copy of it in ~/.list-filter/filters.yaml.

relate_complex  view on Meta::CPAN


=head2 dwim upcarets

The use of a leading "^" achor in a pattern is allowed, but is
silently transformed into a boundary match "\b".  Otherwise "^"
wouldn't be very useful (consider that with full paths *all*
listings match "^/") So instead we DWIM and turn "^" into a
beginning-of-name match.  An embedded or trailing "^" is left
alone.  Ditto for a "^" in front of a slash: if you ask for
'^/home/bin', maybe that's really what you want (as opposed to,
say '/tmp/backup/home/bin').

=head2 alternate filters

You can always determine which filters are available with the
"-L" option:

   relate_complex -L

By convention, the filters defined in the List::Filter::Library::*
modules are named with a leading colon.

t/dat/tree/subdir/#baaad.txt#  view on Meta::CPAN

Wednesday February 28, 2007  11:36 PM
This is a test file. 
The goal is to make sure there's 
some emacs backup files around and 
so on.

t/dat/tree/subdir/baaad.txt  view on Meta::CPAN

Wednesday February 28, 2007  11:36 PM
This is a test file. 
The goal is to make sure there's 
some emacs backup files around and 
so on.

t/dat/tree2/WHATDIS  view on Meta::CPAN

~/End/Cave/Relate/Wall/List-Filter/lib/List/Filter/App/t/dat/slocate2

My intention is to make tree2 indefinitely extensible, by making some 
informal notes about what the existing tests expect to see there, 
so that later extensions won't impact already existing tests. 

For test #7 (all numbers approximate):

    my $test_name = "Testing relate method using the :skipdull filter";

*.txt files with "doom" or "shadow" in the title, plus backups and autosaves, 
and RCS version control.

t/dat/tree2/test7/essays/the_voice_of_doom_rides_again.txt  view on Meta::CPAN

Sunday May 27, 2007   1:20 AM

Stub, test file. 

Adding to it: letting emacs create a backup file.

t/dat/tree2/test7/reviews/#the_bishops_jaegers-thorne_smith#  view on Meta::CPAN

Sunday May 27, 2007   1:20 AM

Stub, test file. 

This is a file with much text added. 
So that after it is manually saved (right now)
it will have an authentic, emacs generated backup file.
abcdefghijklmnopqrstuvwxyz
wuhn tewh thuree foah fahv sex sevhun ate nahn tehn
ah...abcdefghijklmnopqrstuvwxyz
wuhn tewh thuree foah fahv sex sevhun ate nahn tehn
ah...abcdefghijklmnopqrstuvwxyz
wuhn tewh thuree foah fahv sex sevhun ate nahn tehn
ah...abcdefghijklmnopqrstuvwxyz
wuhn tewh thuree foah fahv sex sevhun ate nahn tehn
ah...abcdefghijklmnopqrstuvwxyz
wuhn tewh thuree foah fahv sex sevhun ate nahn tehn

t/tmp/stash-test4/.list-filter/filters.yaml  view on Meta::CPAN

---
doom_filter:
  description: 'The usual file filtering - skips "old", "bak", emacs backups, etc'
  search_terms:
    - '~$'
    - /\#
    - ',v$'
    - \.elc$
    - \bold
    - \bOld
    - \bOLD
    - bak$
    - Bak$



( run in 1.724 second using v1.01-cache-2.11-cpan-49f99fa48dc )