ack-2.22/0000755000175000017500000000000013217305510010642 5ustar andyandyack-2.22/ExtensionGroup.pm0000644000175000017500000000162013066014025014170 0ustar andyandypackage App::Ack::Filter::ExtensionGroup; =head1 NAME App::Ack::Filter::ExtensionGroup =head1 DESCRIPTION The App::Ack::Filter::ExtensionGroup class optimizes multiple ::Extension calls into one container. See App::Ack::Filter::IsGroup for details. =cut use strict; use warnings; use base 'App::Ack::Filter'; sub new { my ( $class ) = @_; return bless { data => {}, }, $class; } sub add { my ( $self, $filter ) = @_; foreach my $ext (@{$filter->{extensions}}) { $self->{data}->{lc $ext} = 1; } return; } sub filter { my ( $self, $resource ) = @_; if ($resource->name =~ /[.]([^.]*)$/) { return exists $self->{'data'}->{lc $1}; } return 0; } sub inspect { my ( $self ) = @_; return ref($self) . " - $self"; } sub to_string { my ( $self ) = @_; return join(' ', map { ".$_" } sort keys %{$self->{data}}); } 1; ack-2.22/README.md0000644000175000017500000000257713216123637012143 0ustar andyandy# Build status of dev branch * Linux [![Build Status](https://travis-ci.org/beyondgrep/ack2.png?branch=dev)](https://travis-ci.org/beyondgrep/ack2) * Windows [![Build Status](https://ci.appveyor.com/api/projects/status/github/beyondgrep/ack2)](https://ci.appveyor.com/project/petdance/ack2) * [CPAN Testers](http://cpantesters.org/distro/A/ack.html) # ack 2 ack is a code-searching tool, similar to grep but optimized for programmers searching large trees of source code. It runs in pure Perl, is highly portable, and runs on any platform that runs Perl. ack is written and maintained by Andy Lester (andy@petdance.com). * Project home page: https://beyondgrep.com/ * Code home page: https://github.com/beyondgrep/ack2 * Issue tracker: https://github.com/beyondgrep/ack2/issues * Mailing list for announcements: https://groups.google.com/d/forum/ack-announcements * Mailing list for users: https://groups.google.com/d/forum/ack-users * Mailing list for developers: https://groups.google.com/d/forum/ack-dev # Building ack requires Perl 5.8.8 or higher. Perl 5.8.8 was released January 2006. # Required perl Makefile.PL make make test sudo make install # for a system-wide installation (recommended) # - or - make ack-standalone cp ack-standalone ~/bin/ack2 # for a personal installation # Development [Developer's Guide](DEVELOPERS.md) [Design Guide](DESIGN.md) ack-2.22/ConfigFinder.pm0000644000175000017500000000770113066014025013542 0ustar andyandypackage App::Ack::ConfigFinder; =head1 NAME App::Ack::ConfigFinder =head1 DESCRIPTION A module that contains the logic for locating the various configuration files. =head1 LOCATING CONFIG FILES First, ack looks for a global ackrc. =over =item On Windows, this is `ackrc` in either COMMON_APPDATA or APPDATA. If `ackrc` is present in both directories, ack uses both files in that order. =item On a non-Windows OS, this is `/etc/ackrc`. =back Then, ack looks for a user-specific ackrc if the HOME environment variable is set. This is either F<$HOME/.ackrc> or F<$HOME/_ackrc>. Then, ack looks for a project-specific ackrc file. ack searches up the directory hierarchy for the first `.ackrc` or `_ackrc` file. If this is one of the ackrc files found in the previous steps, it is not loaded again. It is a fatal error if a directory contains both F<.ackrc> and F<_ackrc>. After ack loads the options from the found ackrc files, ack looks at the C environment variable. Finally, ack takes settings from the command line. =cut use strict; use warnings; use App::Ack (); use App::Ack::ConfigDefault; use Cwd 3.00 (); use File::Spec 3.00; use if ($^O eq 'MSWin32'), 'Win32'; =head1 METHODS =head2 new Creates a new config finder. =cut sub new { my ( $class ) = @_; return bless {}, $class; } sub _remove_redundancies { my @configs = @_; my %seen; foreach my $config (@configs) { my $key = $config->{path}; if ( not $App::Ack::is_windows ) { # On Unix, uniquify on inode. my ($dev, $inode) = (stat $key)[0, 1]; $key = "$dev:$inode" if defined $dev; } undef $config if $seen{$key}++; } return grep { defined } @configs; } sub _check_for_ackrc { return unless defined $_[0]; my @files = grep { -f } map { File::Spec->catfile(@_, $_) } qw(.ackrc _ackrc); die File::Spec->catdir(@_) . " contains both .ackrc and _ackrc.\n" . "Please remove one of those files.\n" if @files > 1; return wantarray ? @files : $files[0]; } # end _check_for_ackrc =head2 $finder->find_config_files Locates config files, and returns a list of them. =cut sub find_config_files { my @config_files; if ( $App::Ack::is_windows ) { push @config_files, map { +{ path => File::Spec->catfile($_, 'ackrc') } } ( Win32::GetFolderPath(Win32::CSIDL_COMMON_APPDATA()), Win32::GetFolderPath(Win32::CSIDL_APPDATA()), ); } else { push @config_files, { path => '/etc/ackrc' }; } if ( $ENV{'ACKRC'} && -f $ENV{'ACKRC'} ) { push @config_files, { path => $ENV{'ACKRC'} }; } else { push @config_files, map { +{ path => $_ } } _check_for_ackrc($ENV{'HOME'}); } my $cwd = Cwd::getcwd(); return () unless defined $cwd; # XXX This should go through some untainted cwd-fetching function, and not get untainted brute-force like this. $cwd =~ /(.+)/; $cwd = $1; my @dirs = File::Spec->splitdir( $cwd ); while(@dirs) { my $ackrc = _check_for_ackrc(@dirs); if(defined $ackrc) { push @config_files, { project => 1, path => $ackrc }; last; } pop @dirs; } # We only test for existence here, so if the file is deleted out from under us, this will fail later. return _remove_redundancies( @config_files ); } =head2 read_rcfile Reads the contents of the .ackrc file and returns the arguments. =cut sub read_rcfile { my $file = shift; return unless defined $file && -e $file; my @lines; open( my $fh, '<', $file ) or App::Ack::die( "Unable to read $file: $!" ); while ( my $line = <$fh> ) { chomp $line; $line =~ s/^\s+//; $line =~ s/\s+$//; next if $line eq ''; next if $line =~ /^\s*#/; push( @lines, $line ); } close $fh or App::Ack::die( "Unable to close $file: $!" ); return @lines; } 1; ack-2.22/MANIFEST0000644000175000017500000001103413217305510011772 0ustar andyandyChanges CONTRIBUTING.md LICENSE.md MANIFEST README.md Makefile.PL ack Ack.pm Collection.pm ConfigDefault.pm ConfigFinder.pm ConfigLoader.pm Default.pm Extension.pm ExtensionGroup.pm Filter.pm FirstLineMatch.pm Inverse.pm Is.pm IsGroup.pm IsPath.pm IsPathGroup.pm Match.pm MatchGroup.pm Resource.pm Resources.pm record-options squash test-pager t/FilterTest.pm t/Util.pm t/00-load.t t/ack-1.t t/ack-color.t t/ack-column.t t/ack-create-ackrc.t t/ack-c.t t/ack-dump.t t/ack-files-from.t t/ack-filetypes.t t/ack-f.t t/ack-group.t t/ack-g.t t/ack-help.t t/ack-help-types.t t/ack-h.t t/ack-ignore-dir.t t/ack-ignore-file.t t/ack-interactive.t t/ack-invalid-ackrc.t t/ack-i.t t/ack-known-types.t t/ack-k.t t/ack-line.t t/ack-match.t t/ack-m.t t/ack-named-pipes.t t/ack-n.t t/ack-o.t t/ack-output.t t/ack-pager.t t/ack-passthru.t t/ack-print0.t t/ack-removed-options.t t/ack-show-types.t t/ack-s.t t/ack-type-del.t t/ack-type.t t/ack-v.t t/ack-w.t t/ack-x.t t/anchored.t t/asp-net-ext.t t/bad-ackrc-opt.t t/basic.t t/command-line-files.t t/config-backwards-compat.t t/config-finder.t t/config-loader.t t/context.t t/default-filter.t t/exit-code.t t/ext-filter.t t/file-permission.t t/filetypes.t t/filter.t t/firstlinematch-filter.t t/highlighting.t t/illegal-regex.t t/incomplete-last-line.t t/inverted-file-filter.t t/is-filter.t t/issue244.t t/issue276.t t/issue491.t t/issue522.t t/issue562.t t/issue571.t t/longopts.t t/lua-shebang.t t/match-filter.t t/mutex-options.t t/noackrc.t t/noenv.t t/process-substitution.t t/resource-iterator.t t/r-lang-ext.t t/runtests.pl t/zero.t t/etc/buttonhook.xml.xxx t/etc/shebang.empty.xxx t/etc/shebang.foobar.xxx t/etc/shebang.php.xxx t/etc/shebang.pl.xxx t/etc/shebang.py.xxx t/etc/shebang.rb.xxx t/etc/shebang.sh.xxx t/lib/00-coverage.t t/lib/Ack.t t/lib/Collection.t t/lib/ConfigDefault.t t/lib/ConfigFinder.t t/lib/ConfigLoader.t t/lib/Default.t t/lib/Extension.t t/lib/ExtensionGroup.t t/lib/Filter.t t/lib/FirstLineMatch.t t/lib/Inverse.t t/lib/Is.t t/lib/IsGroup.t t/lib/IsPath.t t/lib/IsPathGroup.t t/lib/Match.t t/lib/MatchGroup.t t/lib/Resource.t t/lib/Resources.t t/home/.ackrc t/swamp/#emacs-workfile.pl# t/swamp/0 t/swamp/CMakeLists.txt t/swamp/Makefile t/swamp/Makefile.PL t/swamp/MasterPage.master t/swamp/Rakefile t/swamp/Sample.ascx t/swamp/Sample.asmx t/swamp/blib/ignore.pir t/swamp/blib/ignore.pm t/swamp/blib/ignore.pod t/swamp/c-header.h t/swamp/c-source.c t/swamp/crystallography-weenies.f t/swamp/example.R t/swamp/file.bar t/swamp/file.foo t/swamp/fresh.css t/swamp/fresh.css.min t/swamp/fresh.min.css t/swamp/groceries/CVS/fruit t/swamp/groceries/CVS/junk t/swamp/groceries/CVS/meat t/swamp/groceries/RCS/fruit t/swamp/groceries/RCS/junk t/swamp/groceries/RCS/meat t/swamp/groceries/another_subdir/CVS/fruit t/swamp/groceries/another_subdir/CVS/junk t/swamp/groceries/another_subdir/CVS/meat t/swamp/groceries/another_subdir/RCS/fruit t/swamp/groceries/another_subdir/RCS/junk t/swamp/groceries/another_subdir/RCS/meat t/swamp/groceries/another_subdir/fruit t/swamp/groceries/another_subdir/junk t/swamp/groceries/another_subdir/meat t/swamp/groceries/dir.d/CVS/fruit t/swamp/groceries/dir.d/CVS/junk t/swamp/groceries/dir.d/CVS/meat t/swamp/groceries/dir.d/fruit t/swamp/groceries/dir.d/junk t/swamp/groceries/dir.d/meat t/swamp/groceries/dir.d/RCS/fruit t/swamp/groceries/dir.d/RCS/junk t/swamp/groceries/dir.d/RCS/meat t/swamp/groceries/fruit t/swamp/groceries/junk t/swamp/groceries/meat t/swamp/groceries/subdir/fruit t/swamp/groceries/subdir/junk t/swamp/groceries/subdir/meat t/swamp/html.htm t/swamp/html.html t/swamp/incomplete-last-line.txt t/swamp/javascript.js t/swamp/lua-shebang-test t/swamp/minified.js.min t/swamp/minified.min.js t/swamp/moose-andy.jpg t/swamp/not-an-#emacs-workfile# t/swamp/notaMakefile t/swamp/notaRakefile t/swamp/notes.md t/swamp/options-crlf.pl t/swamp/options.pl t/swamp/options.pl.bak t/swamp/parrot.pir t/swamp/perl-test.t t/swamp/perl-without-extension t/swamp/perl.cgi t/swamp/perl.handler.pod t/swamp/perl.pl t/swamp/perl.pm t/swamp/perl.pod t/swamp/perl.tar.gz t/swamp/perltoot.jpg t/swamp/pipe-stress-freaks.F t/swamp/sample.asp t/swamp/sample.aspx t/swamp/sample.rake t/swamp/service.svc t/swamp/solution8.tar t/swamp/stuff.cmake t/swamp/swamp/ignoreme.txt t/text/amontillado.txt t/text/bill-of-rights.txt t/text/constitution.txt t/text/gettysburg.txt t/text/number.txt t/text/numbered-text.txt t/text/ozymandias.txt t/text/raven.txt xt/man.t xt/pod.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) ack-2.22/Extension.pm0000644000175000017500000000203313066014025013152 0ustar andyandypackage App::Ack::Filter::Extension; =head1 NAME App::Ack::Filter::Extension =head1 DESCRIPTION Implements filters based on extensions. =cut use strict; use warnings; use base 'App::Ack::Filter'; use App::Ack::Filter (); use App::Ack::Filter::ExtensionGroup (); sub new { my ( $class, @extensions ) = @_; my $exts = join('|', map { "\Q$_\E"} @extensions); my $re = qr/[.](?:$exts)$/i; return bless { extensions => \@extensions, regex => $re, groupname => 'ExtensionGroup', }, $class; } sub create_group { return App::Ack::Filter::ExtensionGroup->new(); } sub filter { my ( $self, $resource ) = @_; my $re = $self->{'regex'}; return $resource->name =~ /$re/; } sub inspect { my ( $self ) = @_; my $re = $self->{'regex'}; return ref($self) . " - $re"; } sub to_string { my ( $self ) = @_; my $exts = $self->{'extensions'}; return join(' ', map { ".$_" } @{$exts}); } BEGIN { App::Ack::Filter->register_filter(ext => __PACKAGE__); } 1; ack-2.22/test-pager0000755000175000017500000000032212726365114012652 0ustar andyandy#!/usr/bin/env perl use strict; use warnings; use Getopt::Long; my $skip; GetOptions( 'skip=i' => \$skip, ); while (<>) { if ( defined $skip && $. % $skip == 0 ) { next; } print; } ack-2.22/Resource.pm0000644000175000017500000001044413216123637013001 0ustar andyandypackage App::Ack::Resource; use App::Ack; use warnings; use strict; use overload '""' => 'name'; =head1 NAME App::Ack::Resource =head1 DESCRIPTION Abstracts a file from the filesystem. =head1 METHODS =head2 new( $filename ) Opens the file specified by I<$filename> and returns a filehandle and a flag that says whether it could be binary. If there's a failure, it throws a warning and returns an empty list. =cut sub new { my $class = shift; my $filename = shift; my $self = bless { filename => $filename, fh => undef, opened => 0, }, $class; if ( $self->{filename} eq '-' ) { $self->{fh} = *STDIN; $self->{opened} = 1; } return $self; } =head2 $res->name() Returns the name of the resource. =cut sub name { return $_[0]->{filename}; } =head2 $res->basename() Returns the basename (the last component the path) of the resource. =cut sub basename { my ( $self ) = @_; # XXX Definedness? Pre-populate the slot with an undef? unless ( exists $self->{basename} ) { $self->{basename} = (File::Spec->splitpath($self->name))[2]; } return $self->{basename}; } =head2 $res->open() Opens a filehandle for reading this resource and returns it, or returns undef if the operation fails (the error is in C<$!>). Instead of calling C, C<$res-Eclose> should be called. =cut sub open { my ( $self ) = @_; if ( !$self->{opened} ) { if ( open $self->{fh}, '<', $self->{filename} ) { $self->{opened} = 1; } else { $self->{fh} = undef; } } return $self->{fh}; } =head2 $res->needs_line_scan( \%opts ) Tells if the file needs a line-by-line scan. This is a big optimization because if you can tell from the outset that the pattern is not found in the resource at all, then there's no need to do the line-by-line iteration. Slurp up an entire file up to 100K, see if there are any matches in it, and if so, let us know so we can iterate over it directly. If it's bigger than 100K or the match is inverted, we have to do the line-by-line, too. =cut sub needs_line_scan { my $self = shift; my $opt = shift; return 1 if $opt->{v}; my $size = -s $self->{fh}; if ( $size == 0 ) { return 0; } elsif ( $size > 100_000 ) { return 1; } my $buffer; my $rc = sysread( $self->{fh}, $buffer, $size ); if ( !defined($rc) && $App::Ack::report_bad_filenames ) { App::Ack::warn( "$self->{filename}: $!" ); return 1; } return 0 unless $rc && ( $rc == $size ); return $buffer =~ /$opt->{regex}/m; } =head2 $res->reset() Resets the resource back to the beginning. This is only called if C is true, but not always if C is true. =cut sub reset { my $self = shift; # Return if we haven't opened the file yet. if ( !defined($self->{fh}) ) { return; } if ( !seek( $self->{fh}, 0, 0 ) && $App::Ack::report_bad_filenames ) { App::Ack::warn( "$self->{filename}: $!" ); } return; } =head2 $res->close() Close the file. =cut sub close { my $self = shift; # Return if we haven't opened the file yet. if ( !defined($self->{fh}) ) { return; } if ( !close($self->{fh}) && $App::Ack::report_bad_filenames ) { App::Ack::warn( $self->name() . ": $!" ); } $self->{opened} = 0; return; } =head2 $res->clone() Clones this resource. =cut sub clone { my ( $self ) = @_; return __PACKAGE__->new($self->name); } =head2 $res->firstliney() Returns the first line of a file (or first 250 characters, whichever comes first). =cut sub firstliney { my ( $self ) = @_; if ( !exists $self->{firstliney} ) { my $fh = $self->open(); if ( !$fh ) { if ( $App::Ack::report_bad_filenames ) { App::Ack::warn( $self->name . ': ' . $! ); } return ''; } my $buffer = ''; my $rc = sysread( $fh, $buffer, 250 ); unless($rc) { # XXX handle this better? $buffer = ''; } $buffer =~ s/[\r\n].*//s; $self->{firstliney} = $buffer; $self->reset; $self->close; } return $self->{firstliney}; } 1; ack-2.22/Makefile.PL0000644000175000017500000001317013213402177012621 0ustar andyandypackage main; require 5.008008; use strict; use warnings; use ExtUtils::MakeMaker; my $debug_mode = (grep { $_ eq '--debug' } @ARGV) ? '--debug' : ''; my %parms = ( NAME => 'ack', AUTHOR => 'Andy Lester ', ABSTRACT => 'A grep-like program for searching source code', VERSION_FROM => 'Ack.pm', PM => { 'Ack.pm' => '$(INST_LIBDIR)/App/Ack.pm', 'Resource.pm' => '$(INST_LIBDIR)/App/Ack/Resource.pm', 'Resources.pm' => '$(INST_LIBDIR)/App/Ack/Resources.pm', 'ConfigDefault.pm' => '$(INST_LIBDIR)/App/Ack/ConfigDefault.pm', 'ConfigFinder.pm' => '$(INST_LIBDIR)/App/Ack/ConfigFinder.pm', 'ConfigLoader.pm' => '$(INST_LIBDIR)/App/Ack/ConfigLoader.pm', 'Filter.pm' => '$(INST_LIBDIR)/App/Ack/Filter.pm', 'Extension.pm' => '$(INST_LIBDIR)/App/Ack/Filter/Extension.pm', 'FirstLineMatch.pm' => '$(INST_LIBDIR)/App/Ack/Filter/FirstLineMatch.pm', 'Is.pm' => '$(INST_LIBDIR)/App/Ack/Filter/Is.pm', 'Match.pm' => '$(INST_LIBDIR)/App/Ack/Filter/Match.pm', 'Default.pm' => '$(INST_LIBDIR)/App/Ack/Filter/Default.pm', 'Inverse.pm' => '$(INST_LIBDIR)/App/Ack/Filter/Inverse.pm', 'Collection.pm' => '$(INST_LIBDIR)/App/Ack/Filter/Collection.pm', 'IsGroup.pm' => '$(INST_LIBDIR)/App/Ack/Filter/IsGroup.pm', 'ExtensionGroup.pm' => '$(INST_LIBDIR)/App/Ack/Filter/ExtensionGroup.pm', 'MatchGroup.pm' => '$(INST_LIBDIR)/App/Ack/Filter/MatchGroup.pm', 'IsPath.pm' => '$(INST_LIBDIR)/App/Ack/Filter/IsPath.pm', 'IsPathGroup.pm' => '$(INST_LIBDIR)/App/Ack/Filter/IsPathGroup.pm', }, EXE_FILES => [ 'ack' ], PREREQ_PM => { 'Carp' => '1.04', 'Cwd' => '3.00', 'Errno' => 0, 'File::Basename' => '1.00015', 'File::Next' => '1.16', 'File::Spec' => '3.00', 'File::Temp' => '0.19', # For newdir() 'Getopt::Long' => '2.38', 'Pod::Usage' => '1.26', 'Term::ANSIColor' => '1.10', 'Test::Harness' => '2.50', # Something reasonably newish 'Test::More' => '0.98', # For subtest() 'Text::ParseWords' => '3.1', ( $^O eq 'MSWin32' ? ('Win32::ShellQuote' => '0.002001') : () ), }, MAN3PODS => {}, # no need for man pages for any of the .pm files dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'ack-2* nytprof* stderr.log stdout.log completion.*' }, ); if ( $ExtUtils::MakeMaker::VERSION =~ /^\d\.\d\d$/ and $ExtUtils::MakeMaker::VERSION > 6.30 ) { $parms{LICENSE} = 'artistic_2'; } if ( $ExtUtils::MakeMaker::VERSION ge '6.46' ) { $parms{META_MERGE} = { resources => { homepage => 'https://beyondgrep.com/', bugtracker => 'https://github.com/beyondgrep/ack2', license => 'http://www.perlfoundation.org/artistic_license_2_0', repository => 'git://github.com/beyondgrep/ack2.git', MailingList => 'https://groups.google.com/group/ack-users', } }; } if ( $ExtUtils::MakeMaker::VERSION ge '6.48' ) { $parms{MIN_PERL_VERSION} = 5.008008; } WriteMakefile( %parms ); package MY; # suppress EU::MM test rule sub MY::test { return ''; } sub MY::postamble { my $postamble = sprintf(<<'MAKE_FRAG', $debug_mode); ACK = ack ALL_PM = \ Ack.pm \ Resource.pm Resources.pm \ ConfigDefault.pm ConfigFinder.pm ConfigLoader.pm \ Filter.pm Extension.pm FirstLineMatch.pm Is.pm Match.pm Default.pm Inverse.pm Collection.pm IsGroup.pm ExtensionGroup.pm MatchGroup.pm IsPath.pm IsPathGroup.pm TEST_VERBOSE=0 TEST_FILES=t/*.t t/lib/*.t TEST_XT_FILES=xt/*.t .PHONY: tags critic tags: ctags -f tags --recurse --totals \ --exclude=blib \ --exclude=.git \ --exclude='*~' \ --exclude=ack-standalone \ --languages=Perl --langmap=Perl:+.t \ critic: perlcritic -1 -q -profile perlcriticrc $(ACK) $(ALL_PM) t/*.t t/lib/*.t xt/*.t ack-standalone : $(ACK) $(ALL_PM) squash Makefile $(PERL) squash $(ACK) $(ALL_PM) File::Next %s > ack-standalone $(FIXIN) ack-standalone -$(NOECHO) $(CHMOD) $(PERM_RWX) ack-standalone $(PERL) -c ack-standalone bininst : $(ACK) $(CP) $(ACK) ~/bin/ack2 $(CP) ackrc ~/.ack2rc test: test_classic test_standalone fulltest: test_classic test_standalone test_xt test_classic: all $(FULLPERLRUN) t/runtests.pl 0 $(TEST_VERBOSE) "$(INST_LIB)" "$(INST_ARCHLIB)" $(TEST_FILES) test_standalone: all ack-standalone $(FULLPERLRUN) t/runtests.pl 1 $(TEST_VERBOSE) "$(INST_LIB)" "$(INST_ARCHLIB)" $(TEST_FILES) test_xt: all $(FULLPERLRUN) t/runtests.pl 0 $(TEST_VERBOSE) "$(INST_LIB)" "$(INST_ARCHLIB)" $(TEST_XT_FILES) PROF_ARGS = -Mblib blib/script/ack foo ~/parrot nytprof: all $(PERL) -d:NYTProf $(PROF_ARGS) >> /dev/null 2>&1 nytprofhtml TIMER_ARGS=foo ~/parrot > /dev/null time-ack196: time $(PERL) ./garage/ack196 --noenv $(TIMER_ARGS) time-ack202: time $(PERL) ./garage/ack202 --noenv $(TIMER_ARGS) time-ack20301: time $(PERL) ./garage/ack20301 --noenv $(TIMER_ARGS) time-ack20302: time $(PERL) ./garage/ack20302 --noenv $(TIMER_ARGS) time-head: ack-standalone time $(PERL) ./ack-standalone --noenv $(TIMER_ARGS) timings: ack-standalone ./dev/timings.pl completion.bash: pm_to_blib ./dev/generate-completion-scripts.pl completion.bash completion.zsh: pm_to_blib ./dev/generate-completion-scripts.pl completion.zsh MAKE_FRAG return $postamble; } 1; ack-2.22/META.json0000664000175000017500000000345313217305510012272 0ustar andyandy{ "abstract" : "A grep-like program for searching source code", "author" : [ "Andy Lester " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "ack", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Carp" : "1.04", "Cwd" : "3.00", "Errno" : "0", "File::Basename" : "1.00015", "File::Next" : "1.16", "File::Spec" : "3.00", "File::Temp" : "0.19", "Getopt::Long" : "2.38", "Pod::Usage" : "1.26", "Term::ANSIColor" : "1.10", "Test::Harness" : "2.50", "Test::More" : "0.98", "Text::ParseWords" : "3.1", "perl" : "5.008008" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/beyondgrep/ack2" }, "homepage" : "https://beyondgrep.com/", "license" : [ "http://www.perlfoundation.org/artistic_license_2_0" ], "repository" : { "type" : "git", "url" : "git://github.com/beyondgrep/ack2.git" }, "x_MailingList" : "https://groups.google.com/group/ack-users" }, "version" : "2.22", "x_serialization_backend" : "JSON::PP version 2.27400_02" } ack-2.22/record-options0000755000175000017500000000103112726365114013544 0ustar andyandy#!/usr/bin/env perl use strict; use warnings; use App::Ack::ConfigLoader (); use Getopt::Long; my $option_coverage_file = 'opts.coverage'; my @extra_options = ( 'type-add=s', 'type-set=s', 'dump', ); my $fh; open $fh, '>>', $option_coverage_file or die $!; my $arg_spec = App::Ack::ConfigLoader::get_arg_spec({}, undef); foreach my $k (keys %{$arg_spec}, @extra_options) { $arg_spec->{$k} = sub { print { $fh } "$k\n"; }; } Getopt::Long::Configure('pass_through'); GetOptions(%{$arg_spec}); close $fh; ack-2.22/IsPathGroup.pm0000644000175000017500000000144213066014025013406 0ustar andyandypackage App::Ack::Filter::IsPathGroup; =head1 NAME App::Ack::Filter::IsPathGroup =head1 DESCRIPTION The App::Ack::Filter::IsPathGroup class optimizes multiple ::IsPath calls into one container. See App::Ack::Filter::IsGroup for details. =cut use strict; use warnings; use base 'App::Ack::Filter'; sub new { my ( $class ) = @_; return bless { data => {}, }, $class; } sub add { my ( $self, $filter ) = @_; $self->{data}->{ $filter->{filename} } = 1; return; } sub filter { my ( $self, $resource ) = @_; my $data = $self->{'data'}; return exists $data->{$resource->name}; } sub inspect { my ( $self ) = @_; return ref($self) . " - $self"; } sub to_string { my ( $self ) = @_; return join(' ', keys %{$self->{data}}); } 1; ack-2.22/xt/0000755000175000017500000000000013217305507011303 5ustar andyandyack-2.22/xt/man.t0000644000175000017500000000532613067372344012257 0ustar andyandy#!perl use strict; use warnings; use lib 't'; use Test::More; use Util; sub strip_special_chars { my ( $s ) = @_; $s =~ s/.[\b]//g; $s =~ s/\e\[?.*?[\@-~]//g; return $s; } { my $man_options; sub _populate_man_options { my ( $man_output, undef ) = run_ack_with_stderr( '--man' ); my $in_options_section; my @option_lines; foreach my $line ( @{$man_output} ) { $line = strip_special_chars($line); if ( $line =~ /^OPTIONS/ ) { $in_options_section = 1; } elsif ( $in_options_section ) { if ( $line =~ /^\S/ ) { $in_options_section = 0; last; } else { push @option_lines, $line; } } } my $min_indent; foreach my $line ( @option_lines ) { if ( my ( $indent ) = $line =~ /^(\s+)/ ) { $indent =~ s/\t/ /; $indent = length($indent); if ( !defined($min_indent) || $indent < $min_indent ) { $min_indent = $indent; } } } $man_options = []; foreach my $line ( @option_lines ) { if ( $line =~ /^(\s+)/ ) { my $indent_str = $1; $indent_str =~ s/\t/ /; my $indent = length($indent_str); next unless $indent == $min_indent; my @options; while ( $line =~ /(-[^\s=,]+)/g ) { my $option = $1; chop $option if $option =~ /\[$/; if ( $option =~ s/^--\[no\]/--/ ) { my $negated_option = $option; substr $negated_option, 2, 0, 'no'; push @{$man_options}, $negated_option; } push @{$man_options}, $option; } } } return; } sub get_man_options { _populate_man_options() unless $man_options; return @{ $man_options }; } } sub check_for_option_in_man_output { my ( $expected_option ) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; my @options = get_man_options(); my $found; foreach my $option ( @options ) { if ( $option eq $expected_option ) { $found = 1; last; } } return ok( $found, "Option '$expected_option' found in --man output" ); } my @options = get_options(); plan tests => scalar(@options); prep_environment(); foreach my $option ( @options ) { check_for_option_in_man_output( $option ); } ack-2.22/xt/pod.t0000644000175000017500000000034513067373130012254 0ustar andyandy#!perl -Tw use warnings; use strict; use Test::More; if ( eval 'use Test::Pod 1.14; 1;' ) { ## no critic (ProhibitStringyEval) all_pod_files_ok(); } else { plan skip_all => 'Test::Pod 1.14 required for testing POD'; } ack-2.22/Match.pm0000644000175000017500000000172013066014025012234 0ustar andyandypackage App::Ack::Filter::Match; use strict; use warnings; use base 'App::Ack::Filter'; use File::Spec 3.00; use App::Ack::Filter::MatchGroup (); =head1 NAME App::Ack::Filter::Match =head1 DESCRIPTION Implements filtering resources by their filename (regular expression). =cut sub new { my ( $class, $re ) = @_; $re =~ s{^/|/$}{}g; # XXX validate? $re = qr/$re/i; return bless { regex => $re, groupname => 'MatchGroup', }, $class; } sub create_group { return App::Ack::Filter::MatchGroup->new; } sub filter { my ( $self, $resource ) = @_; my $re = $self->{'regex'}; return $resource->basename =~ /$re/; } sub inspect { my ( $self ) = @_; my $re = $self->{'regex'}; print ref($self) . " - $re"; return; } sub to_string { my ( $self ) = @_; my $re = $self->{'regex'}; return "filename matches $re"; } BEGIN { App::Ack::Filter->register_filter(match => __PACKAGE__); } 1; ack-2.22/LICENSE.md0000644000175000017500000002165612726365114012272 0ustar andyandyack is released under the [Artistic License 2.0][1]. [1]: http://www.perlfoundation.org/artistic_license_2_0 Artistic License 2.0 ==================== Copyright (c) 2000-2006, The Perl Foundation. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble -------- This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software. You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement. Definitions ----------- "Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package. "Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures. "You" and "your" means any person who would like to copy, distribute, or modify the Package. "Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version. "Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization. "Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees. "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder. "Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder. "Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future. "Source" form means the source code, documentation source, and configuration files for the Package. "Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form. Permission for Use and Modification Without Distribution -------------------------------------------------------- (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. Permissions for Redistribution of the Standard Version ------------------------------------------------------ (2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package. (3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License. Distribution of Modified Versions of the Package as Source (4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following: (a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version. (b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version. (c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under (i) the Original License or (ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed. Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source ---------------------------------------------------------------------------------------------- (5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license. (6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. Aggregating or Linking the Package ---------------------------------- (7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation. (8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. Items That are Not Considered Part of a Modified Version -------------------------------------------------------- (9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license. General Provisions ------------------ (10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. (11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. (12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. (13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. (14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ack-2.22/ConfigDefault.pm0000644000175000017500000002062213216123637013723 0ustar andyandypackage App::Ack::ConfigDefault; use warnings; use strict; use App::Ack (); =head1 NAME App::Ack::ConfigDefault =head1 DESCRIPTION A module that contains the default configuration for ack. =cut sub options { return split( /\n/, _options_block() ); } sub options_clean { return grep { /./ && !/^#/ } options(); } sub _options_block { my $lines = <<'HERE'; # This is the default ackrc for ack version ==VERSION==. # There are four different ways to match # # is: Match the filename exactly # # ext: Match the extension of the filename exactly # # match: Match the filename against a Perl regular expression # # firstlinematch: Match the first 250 characters of the first line # of text against a Perl regular expression. This is only for # the --type-add option. ### Directories to ignore # Bazaar # http://bazaar.canonical.com/ --ignore-directory=is:.bzr # Codeville # http://freecode.com/projects/codeville --ignore-directory=is:.cdv # Interface Builder (Xcode) # http://en.wikipedia.org/wiki/Interface_Builder --ignore-directory=is:~.dep --ignore-directory=is:~.dot --ignore-directory=is:~.nib --ignore-directory=is:~.plst # Git # http://git-scm.com/ --ignore-directory=is:.git # When using submodules, .git is a file. --ignore-file=is:.git # Mercurial # http://mercurial.selenic.com/ --ignore-directory=is:.hg # quilt # http://directory.fsf.org/wiki/Quilt --ignore-directory=is:.pc # Subversion # http://subversion.tigris.org/ --ignore-directory=is:.svn # Monotone # http://www.monotone.ca/ --ignore-directory=is:_MTN # CVS # http://savannah.nongnu.org/projects/cvs --ignore-directory=is:CVS # RCS # http://www.gnu.org/software/rcs/ --ignore-directory=is:RCS # SCCS # http://en.wikipedia.org/wiki/Source_Code_Control_System --ignore-directory=is:SCCS # darcs # http://darcs.net/ --ignore-directory=is:_darcs # Vault/Fortress --ignore-directory=is:_sgbak # autoconf # http://www.gnu.org/software/autoconf/ --ignore-directory=is:autom4te.cache # Perl module building --ignore-directory=is:blib --ignore-directory=is:_build # Perl Devel::Cover module's output directory # https://metacpan.org/release/Devel-Cover --ignore-directory=is:cover_db # Node modules created by npm --ignore-directory=is:node_modules # CMake cache # http://www.cmake.org/ --ignore-directory=is:CMakeFiles # Eclipse workspace folder # http://eclipse.org/ --ignore-directory=is:.metadata # Cabal (Haskell) sandboxes # http://www.haskell.org/cabal/users-guide/installing-packages.html --ignore-directory=is:.cabal-sandbox ### Files to ignore # Backup files --ignore-file=ext:bak --ignore-file=match:/~$/ # Emacs swap files --ignore-file=match:/^#.+#$/ # vi/vim swap files http://vim.org/ --ignore-file=match:/[._].*\.swp$/ # core dumps --ignore-file=match:/core\.\d+$/ # minified Javascript --ignore-file=match:/[.-]min[.]js$/ --ignore-file=match:/[.]js[.]min$/ # minified CSS --ignore-file=match:/[.]min[.]css$/ --ignore-file=match:/[.]css[.]min$/ # JS and CSS source maps --ignore-file=match:/[.]js[.]map$/ --ignore-file=match:/[.]css[.]map$/ # PDFs, because they pass Perl's -T detection --ignore-file=ext:pdf # Common graphics, just as an optimization --ignore-file=ext:gif,jpg,jpeg,png ### Filetypes defined # Perl # http://perl.org/ --type-add=perl:ext:pl,pm,pod,t,psgi --type-add=perl:firstlinematch:/^#!.*\bperl/ # Perl tests --type-add=perltest:ext:t # Makefiles # http://www.gnu.org/s/make/ --type-add=make:ext:mk --type-add=make:ext:mak --type-add=make:is:makefile --type-add=make:is:Makefile --type-add=make:is:Makefile.Debug --type-add=make:is:Makefile.Release # Rakefiles # http://rake.rubyforge.org/ --type-add=rake:is:Rakefile # CMake # http://www.cmake.org/ --type-add=cmake:is:CMakeLists.txt --type-add=cmake:ext:cmake # Actionscript --type-add=actionscript:ext:as,mxml # Ada # http://www.adaic.org/ --type-add=ada:ext:ada,adb,ads # ASP # http://msdn.microsoft.com/en-us/library/aa286483.aspx --type-add=asp:ext:asp # ASP.Net # http://www.asp.net/ --type-add=aspx:ext:master,ascx,asmx,aspx,svc # Assembly --type-add=asm:ext:asm,s # Batch --type-add=batch:ext:bat,cmd # ColdFusion # http://en.wikipedia.org/wiki/ColdFusion --type-add=cfmx:ext:cfc,cfm,cfml # Clojure # http://clojure.org/ --type-add=clojure:ext:clj,cljs,edn,cljc # C # .xs are Perl C files --type-add=cc:ext:c,h,xs # C header files --type-add=hh:ext:h # CoffeeScript # http://coffeescript.org/ --type-add=coffeescript:ext:coffee # C++ --type-add=cpp:ext:cpp,cc,cxx,m,hpp,hh,h,hxx # C++ header files --type-add=hpp:ext:hpp,hh,h,hxx # C# --type-add=csharp:ext:cs # CSS # http://www.w3.org/Style/CSS/ --type-add=css:ext:css # Dart # http://www.dartlang.org/ --type-add=dart:ext:dart # Delphi # http://en.wikipedia.org/wiki/Embarcadero_Delphi --type-add=delphi:ext:pas,int,dfm,nfm,dof,dpk,dproj,groupproj,bdsgroup,bdsproj # Elixir # http://elixir-lang.org/ --type-add=elixir:ext:ex,exs # Emacs Lisp # http://www.gnu.org/software/emacs --type-add=elisp:ext:el # Erlang # http://www.erlang.org/ --type-add=erlang:ext:erl,hrl # Fortran # http://en.wikipedia.org/wiki/Fortran --type-add=fortran:ext:f,f77,f90,f95,f03,for,ftn,fpp # Go # http://golang.org/ --type-add=go:ext:go # Groovy # http://groovy.codehaus.org/ --type-add=groovy:ext:groovy,gtmpl,gpp,grunit,gradle # GSP # http://groovy.codehaus.org/GSP --type-add=gsp:ext:gsp # Haskell # http://www.haskell.org/ --type-add=haskell:ext:hs,lhs # HTML --type-add=html:ext:htm,html,xhtml # Jade # http://jade-lang.com/ --type-add=jade:ext:jade # Java # http://www.oracle.com/technetwork/java/index.html --type-add=java:ext:java,properties # JavaScript --type-add=js:ext:js # JSP # http://www.oracle.com/technetwork/java/javaee/jsp/index.html --type-add=jsp:ext:jsp,jspx,jspf,jhtm,jhtml # JSON # http://www.json.org/ --type-add=json:ext:json # Kotlin # https://kotlinlang.org/ --type-add=kotlin:ext:kt,kts # Less # http://www.lesscss.org/ --type-add=less:ext:less # Common Lisp # http://common-lisp.net/ --type-add=lisp:ext:lisp,lsp # Lua # http://www.lua.org/ --type-add=lua:ext:lua --type-add=lua:firstlinematch:/^#!.*\blua(jit)?/ # Objective-C --type-add=objc:ext:m,h # Objective-C++ --type-add=objcpp:ext:mm,h # OCaml # http://caml.inria.fr/ --type-add=ocaml:ext:ml,mli,mll,mly # Matlab # http://en.wikipedia.org/wiki/MATLAB --type-add=matlab:ext:m # Parrot # http://www.parrot.org/ --type-add=parrot:ext:pir,pasm,pmc,ops,pod,pg,tg # PHP # http://www.php.net/ --type-add=php:ext:php,phpt,php3,php4,php5,phtml --type-add=php:firstlinematch:/^#!.*\bphp/ # Plone # http://plone.org/ --type-add=plone:ext:pt,cpt,metadata,cpy,py # Python # http://www.python.org/ --type-add=python:ext:py --type-add=python:firstlinematch:/^#!.*\bpython/ # R # http://www.r-project.org/ --type-add=rr:ext:R # reStructured Text # http://docutils.sourceforge.net/rst.html --type-add=rst:ext:rst # Ruby # http://www.ruby-lang.org/ --type-add=ruby:ext:rb,rhtml,rjs,rxml,erb,rake,spec --type-add=ruby:is:Rakefile --type-add=ruby:firstlinematch:/^#!.*\bruby/ # Rust # http://www.rust-lang.org/ --type-add=rust:ext:rs # Sass # http://sass-lang.com --type-add=sass:ext:sass,scss # Scala # http://www.scala-lang.org/ --type-add=scala:ext:scala # Scheme # http://groups.csail.mit.edu/mac/projects/scheme/ --type-add=scheme:ext:scm,ss # Shell --type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish --type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/ # Smalltalk # http://www.smalltalk.org/ --type-add=smalltalk:ext:st # Smarty # http://www.smarty.net/ --type-add=smarty:ext:tpl # SQL # http://www.iso.org/iso/catalogue_detail.htm?csnumber=45498 --type-add=sql:ext:sql,ctl # Stylus # http://learnboost.github.io/stylus/ --type-add=stylus:ext:styl # Swift # https://developer.apple.com/swift/ --type-add=swift:ext:swift --type-add=swift:firstlinematch:/^#!.*\bswift/ # Tcl # http://www.tcl.tk/ --type-add=tcl:ext:tcl,itcl,itk # LaTeX # http://www.latex-project.org/ --type-add=tex:ext:tex,cls,sty # Template Toolkit (Perl) # http://template-toolkit.org/ --type-add=tt:ext:tt,tt2,ttml # Visual Basic --type-add=vb:ext:bas,cls,frm,ctl,vb,resx # Verilog --type-add=verilog:ext:v,vh,sv # VHDL # http://www.eda.org/twiki/bin/view.cgi/P1076/WebHome --type-add=vhdl:ext:vhd,vhdl # Vim # http://www.vim.org/ --type-add=vim:ext:vim # XML # http://www.w3.org/TR/REC-xml/ --type-add=xml:ext:xml,dtd,xsd,xsl,xslt,ent,wsdl --type-add=xml:firstlinematch:/<[?]xml/ # YAML # http://yaml.org/ --type-add=yaml:ext:yaml,yml HERE $lines =~ s/==VERSION==/$App::Ack::VERSION/sm; return $lines; } 1; ack-2.22/Default.pm0000644000175000017500000000065313066014025012570 0ustar andyandypackage App::Ack::Filter::Default; =head1 NAME App::Ack::Filter::Default =head1 DESCRIPTION The class that implements the filter that ack uses by default if you don't specify any filters on the command line. =cut use strict; use warnings; use base 'App::Ack::Filter'; sub new { my ( $class ) = @_; return bless {}, $class; } sub filter { my ( $self, $resource ) = @_; return -T $resource->name; } 1; ack-2.22/t/0000755000175000017500000000000013217305507011113 5ustar andyandyack-2.22/t/ack-column.t0000644000175000017500000000323313213402177013327 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 4; use lib 't'; use Util; prep_environment(); my $raven = reslash( 't/text/raven.txt' ); my @base_args = qw( nevermore -w -i --with-filename --noenv ); WITH_COLUMNS: { my @expected = line_split( <<'HERE' ); 55:23: Quoth the Raven, "Nevermore." 62:24: With such name as "Nevermore." 69:26: Then the bird said, "Nevermore." 76:18: Of 'Never -- nevermore.' 83:24: Meant in croaking "Nevermore." 90:26: She shall press, ah, nevermore! 97:23: Quoth the Raven, "Nevermore." 104:23: Quoth the Raven, "Nevermore." 111:23: Quoth the Raven, "Nevermore." 118:23: Quoth the Raven, "Nevermore." 125:22: Shall be lifted--nevermore! HERE @expected = map { "${raven}:$_" } @expected; my @files = ( $raven ); my @args = ( @base_args, '--column' ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Checking column numbers' ); } WITHOUT_COLUMNS: { my @expected = line_split( <<'HERE' ); 55: Quoth the Raven, "Nevermore." 62: With such name as "Nevermore." 69: Then the bird said, "Nevermore." 76: Of 'Never -- nevermore.' 83: Meant in croaking "Nevermore." 90: She shall press, ah, nevermore! 97: Quoth the Raven, "Nevermore." 104: Quoth the Raven, "Nevermore." 111: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." 125: Shall be lifted--nevermore! HERE @expected = map { "${raven}:$_" } @expected; my @files = ( $raven ); my @args = ( @base_args, '--no-column' ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Checking without column numbers' ); } ack-2.22/t/00-load.t0000644000175000017500000000117413215640706012440 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 1; use App::Ack; use App::Ack::Resource; use App::Ack::ConfigDefault; use App::Ack::ConfigFinder; use App::Ack::ConfigLoader; use File::Next; use Test::Harness; use Getopt::Long; use Pod::Usage; use File::Spec; my @modules = qw( File::Next File::Spec Getopt::Long Pod::Usage Test::Harness Test::More ); pass( 'All modules loaded' ); diag( "Testing ack version $App::Ack::VERSION under Perl $], $^X" ); for my $module ( @modules ) { no strict 'refs'; my $ver = ${$module . '::VERSION'}; diag( "Using $module $ver" ); } done_testing(); ack-2.22/t/ack-group.t0000644000175000017500000000554613216123637013203 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 12; use lib 't'; use Util; prep_environment(); my ($bill_, $const, $getty) = map { reslash( "t/text/$_" ) } qw( bill-of-rights.txt constitution.txt gettysburg.txt ); my @TEXT_FILES = sort map { untaint($_) } glob( 't/text/*.txt' ); NO_GROUPING: { my @expected = line_split( <<"HERE" ); $bill_:4:or prohibiting the free exercise thereof; or abridging the freedom of $bill_:10:A well regulated Militia, being necessary to the security of a free State, $const:32:Number of free Persons, including those bound to Service for a Term $getty:23:shall have a new birth of freedom -- and that government of the people, HERE my @cases = ( [qw( --nogroup --nocolor free )], [qw( --nobreak --noheading --nocolor free )], ); for my $args ( @cases ) { my @results = run_ack( @{$args}, @TEXT_FILES ); lists_match( \@results, \@expected, 'No grouping' ); } } STANDARD_GROUPING: { my @expected = line_split( <<"HERE" ); $bill_ 4:or prohibiting the free exercise thereof; or abridging the freedom of 10:A well regulated Militia, being necessary to the security of a free State, $const 32:Number of free Persons, including those bound to Service for a Term $getty 23:shall have a new birth of freedom -- and that government of the people, HERE my @cases = ( [qw( --group --nocolor free )], [qw( --heading --break --nocolor free )], ); for my $args ( @cases ) { my @results = run_ack( @{$args}, @TEXT_FILES ); lists_match( \@results, \@expected, 'Standard grouping' ); } } HEADING_NO_BREAK: { my @expected = line_split( <<"HERE" ); $bill_ 4:or prohibiting the free exercise thereof; or abridging the freedom of 10:A well regulated Militia, being necessary to the security of a free State, $const 32:Number of free Persons, including those bound to Service for a Term $getty 23:shall have a new birth of freedom -- and that government of the people, HERE my @arg_sets = ( [qw( --heading --nobreak --nocolor free )], ); for my $set ( @arg_sets ) { my @results = run_ack( @{$set}, @TEXT_FILES ); lists_match( \@results, \@expected, 'Standard grouping' ); } } BREAK_NO_HEADING: { my @expected = line_split( <<"HERE" ); $bill_:4:or prohibiting the free exercise thereof; or abridging the freedom of $bill_:10:A well regulated Militia, being necessary to the security of a free State, $const:32:Number of free Persons, including those bound to Service for a Term $getty:23:shall have a new birth of freedom -- and that government of the people, HERE my @arg_sets = ( [qw( --break --noheading --nocolor free )], ); for my $set ( @arg_sets ) { my @results = run_ack( @{$set}, @TEXT_FILES ); lists_match( \@results, \@expected, 'No grouping' ); } } done_testing(); exit 0; ack-2.22/t/match-filter.t0000644000175000017500000000050213213376747013666 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use FilterTest; use Test::More tests => 1; use App::Ack::Filter::Match; filter_test( [ match => '/^.akefile/' ], [ 't/swamp/Makefile', 't/swamp/Makefile.PL', 't/swamp/Rakefile', ], 'only files matching /^.akefile/ should be matched', ); ack-2.22/t/ack-type.t0000644000175000017500000000627313216123637013026 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Cwd (); use Test::More tests => 16; use Util; prep_environment(); my @SWAMP = qw( t/swamp ); TEST_TYPE: { my @expected = line_split( <<'HERE' ); t/swamp/0:1:#!/usr/bin/perl -w t/swamp/Makefile.PL:1:#!perl -T t/swamp/options-crlf.pl:1:#!/usr/bin/env perl t/swamp/options.pl:1:#!/usr/bin/env perl t/swamp/perl-test.t:1:#!perl -T t/swamp/perl-without-extension:1:#!/usr/bin/perl -w t/swamp/perl.cgi:1:#!perl -T t/swamp/perl.pl:1:#!perl -T t/swamp/perl.pm:1:#!perl -T HERE foreach my $line ( @expected ) { $line =~ s/^(.*?)(?=:)/reslash( $1 )/ge; } my @args = qw( --type=perl --nogroup --noheading --nocolor ); my @files = @SWAMP; my $target = 'perl'; my @results = run_ack( @args, $target, @files ); sets_match( \@results, \@expected, 'TEST_TYPE' ); } TEST_NOTYPE: { my @expected = line_split( <<'HERE' ); t/swamp/c-header.h:1:/* perl.h t/swamp/Makefile:1:# This Makefile is for the ack extension to perl. HERE foreach my $line ( @expected ) { $line =~ s/^(.*?)(?=:)/reslash( $1 )/ge; } my @args = qw( --type=noperl --nogroup --noheading --nocolor ); my @files = @SWAMP; my $target = 'perl'; my @results = run_ack( @args, $target, @files ); sets_match( \@results, \@expected, 'TEST_NOTYPE' ); } TEST_UNKNOWN_TYPE: { my @args = qw( --ignore-ack-defaults --type-add=perl:ext:pl --type=foo --nogroup --noheading --nocolor ); my @files = @SWAMP; my $target = 'perl'; my ( $stdout, $stderr ) = run_ack_with_stderr( @args, $target, @files ); is_empty_array( $stdout, 'Should have no lines back' ); first_line_like( $stderr, qr/Unknown type 'foo'/ ); } TEST_NOTYPES: { my @args = qw( --ignore-ack-defaults --type=perl --nogroup --noheading --nocolor ); my @files = @SWAMP; my $target = 'perl'; my ( $stdout, $stderr ) = run_ack_with_stderr( @args, $target, @files ); is_empty_array( $stdout, 'Should have no lines back' ); first_line_like( $stderr, qr/Unknown type 'perl'/ ); } TEST_NOTYPE_OVERRIDE: { my @expected = ( reslash('t/swamp/html.htm') . ':2:Boring test file ', reslash('t/swamp/html.html') . ':2:Boring test file ', ); my @lines = run_ack( '--nohtml', '--html', '--sort-files', '', @SWAMP ); is_deeply( \@lines, \@expected ); } TEST_TYPE_OVERRIDE: { my @lines = run_ack( '--html', '--nohtml', '<title>', @SWAMP ); is_empty_array( \@lines ); } TEST_NOTYPE_ACKRC_CMD_LINE_OVERRIDE: { my $ackrc = <<'HERE'; --nohtml HERE my @expected = ( reslash('t/swamp/html.htm') . ':2:<html><head><title>Boring test file ', reslash('t/swamp/html.html') . ':2:Boring test file ', ); my @lines = run_ack('--html', '--sort-files', '', @SWAMP, { ackrc => \$ackrc, }); is_deeply( \@lines, \@expected ); } TEST_TYPE_ACKRC_CMD_LINE_OVERRIDE: { my $ackrc = <<'HERE'; --html HERE my @expected; my @lines = run_ack('--nohtml', '<title>', @SWAMP, { ackrc => \$ackrc, }); is_deeply( \@lines, \@expected ); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/basic.t����������������������������������������������������������������������������������0000644�0001750�0001750�00000003211�13216123637�012357� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use Util; use Test::More tests => 12; prep_environment(); NO_SWITCHES_ONE_FILE: { my @expected = line_split( <<'HERE' ); use strict; HERE my @files = qw( t/swamp/options.pl ); my @args = qw( strict ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Looking for strict in one file' ); } NO_SWITCHES_MULTIPLE_FILES: { my $target_file = reslash( 't/swamp/options.pl' ); my @expected = line_split( <<"HERE" ); $target_file:2:use strict; HERE my @files = qw( t/swamp/options.pl t/swamp/pipe-stress-freaks.F ); my @args = qw( strict ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Looking for strict in multiple files' ); } WITH_SWITCHES_ONE_FILE: { my $target_file = reslash( 't/swamp/options.pl' ); for my $opt ( qw( -H --with-filename ) ) { my @expected = line_split( <<"HERE" ); $target_file:2:use strict; HERE my @files = qw( t/swamp/options.pl ); my @args = ( $opt, qw( strict ) ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, "Looking for strict in one file with $opt" ); } } WITH_SWITCHES_MULTIPLE_FILES: { for my $opt ( qw( -h --no-filename ) ) { my @expected = line_split( <<"HERE" ); use strict; HERE my @files = qw( t/swamp/options.pl t/swamp/crystallography-weenies.f ); my @args = ( $opt, qw( strict ) ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, "Looking for strict in multiple files with $opt" ); } } done_testing(); exit 0; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-v.t����������������������������������������������������������������������������������0000644�0001750�0001750�00000002616�13213376747�012320� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 5; use lib 't'; use Util; prep_environment(); NORMAL_CASE: { my @expected = ( '# The Cask of Amontillado, by Edgar Allen Poe' ); my @args = qw( -v x -h -m1 ); my @files = qw( t/text/amontillado.txt ); ack_lists_match( [ @args, @files ], \@expected, 'First line of a file that does not contain "x".' ); } DASH_L: { my @expected = qw( t/text/amontillado.txt t/text/bill-of-rights.txt t/text/constitution.txt t/text/gettysburg.txt t/text/number.txt t/text/numbered-text.txt t/text/ozymandias.txt t/text/raven.txt ); my @args = qw( free -i -v -l --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'No free' ); ack_sets_match( [ '.*', '-l', '-v', 't/text' ], [], '-l -v with .* (which matches any line) should have no results' ); } DASH_C: { my @expected = qw( t/text/amontillado.txt:206 t/text/bill-of-rights.txt:45 t/text/constitution.txt:259 t/text/gettysburg.txt:15 t/text/number.txt:1 t/text/numbered-text.txt:20 t/text/ozymandias.txt:9 t/text/raven.txt:77 ); my @args = qw( the -i -w -v -c --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'Non-the counts' ); } done_testing(); ������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-help-types.t�������������������������������������������������������������������������0000644�0001750�0001750�00000001407�13213376747�014142� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use List::Util qw(sum); use Test::More; use lib 't'; use Util; prep_environment(); my @types = ( perl => [qw{.pl .pod .pl .t}], python => [qw{.py}], ruby => [qw{.rb Rakefile}], ); my @options = qw( --help-types --help=types ); plan tests => 12; foreach my $option ( @options ) { my @output = run_ack($option); while ( my ($type,$checks) = splice( @types, 0, 2 ) ) { my ( $matching_line ) = grep { /--\[no\]$type/ } @output; ok( $matching_line, "A match should be found for --$type in the output for $option" ); foreach my $check (@{$checks}) { like( $matching_line, qr/\Q$check\E/, "Line for --$type in output for $option contains $check" ); } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-x.t����������������������������������������������������������������������������������0000644�0001750�0001750�00000011240�13216123637�012302� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use Test::More tests => 2; use lib 't'; use Util; sub do_parent { my %params = @_; my ( $stdout_read, $stderr_read, $stdout_lines, $stderr_lines ) = @params{qw/stdout_read stderr_read stdout_lines stderr_lines/}; while ( $stdout_read || $stderr_read ) { my $rin = ''; vec( $rin, fileno($stdout_read), 1 ) = 1 if $stdout_read; vec( $rin, fileno($stderr_read), 1 ) = 1 if $stderr_read; select( $rin, undef, undef, undef ); if ( $stdout_read && vec( $rin, fileno($stdout_read), 1 ) ) { my $line = <$stdout_read>; if ( defined( $line ) ) { push @{$stdout_lines}, $line; } else { close $stdout_read; undef $stdout_read; } } if ( $stderr_read && vec( $rin, fileno($stderr_read), 1 ) ) { my $line = <$stderr_read>; if ( defined( $line ) ) { push @{$stderr_lines}, $line; } else { close $stderr_read; undef $stderr_read; } } } chomp @{$stdout_lines}; chomp @{$stderr_lines}; return; } prep_environment(); my $ozy__ = reslash( 't/text/ozymandias.txt' ); my $raven = reslash( 't/text/raven.txt' ); my @expected = line_split( <<"HERE" ); $ozy__:6:Tell that its sculptor well those passions read $ozy__:8:The hand that mocked them, and the heart that fed: $ozy__:13:Of that colossal wreck, boundless and bare $raven:17:So that now, to still the beating of my heart, I stood repeating $raven:26:That I scarce was sure I heard you" -- here I opened wide the door: -- $raven:29:Deep into that darkness peering, long I stood there wondering, fearing, $raven:38:"Surely," said I, "surely that is something at my window lattice; $raven:59:For we cannot help agreeing that no living human being $raven:65:That one word, as if his soul in that one word he did outpour. $raven:75:Till the dirges of his Hope that melancholy burden bore $raven:88:On the cushion's velvet lining that the lamplight gloated o'er, $raven:107:By that Heaven that bends above us, by that God we both adore, $raven:113:"Be that word our sign of parting, bird or fiend!" I shrieked, upstarting: $raven:115:Leave no black plume as a token of that lie thy soul hath spoken! $raven:122:And his eyes have all the seeming of a demon's that is dreaming, $raven:124:And my soul from out that shadow that lies floating on the floor HERE my $perl = caret_X(); my @lhs_args = ( $perl, '-Mblib', build_ack_invocation( '--sort-files', '-g', '[vz]', 't/text' ) ); my @rhs_args = ( $perl, '-Mblib', build_ack_invocation( '-x', '-i', 'that' ) ); if ( $ENV{'ACK_TEST_STANDALONE'} ) { @lhs_args = grep { $_ ne '-Mblib' } @lhs_args; @rhs_args = grep { $_ ne '-Mblib' } @rhs_args; } my ($stdout, $stderr); if ( is_windows() ) { ($stdout, $stderr) = run_cmd("@lhs_args | @rhs_args"); } else { my ( $stdout_read, $stdout_write ); my ( $stderr_read, $stderr_write ); my ( $lhs_rhs_read, $lhs_rhs_write ); pipe( $stdout_read, $stdout_write ); pipe( $stderr_read, $stderr_write ); pipe( $lhs_rhs_read, $lhs_rhs_write ); my $lhs_pid; my $rhs_pid; $lhs_pid = fork(); if ( !defined($lhs_pid) ) { die 'Unable to fork'; } if ( $lhs_pid ) { $rhs_pid = fork(); if ( !defined($rhs_pid) ) { kill TERM => $lhs_pid; waitpid $lhs_pid, 0; die 'Unable to fork'; } } if ( $rhs_pid ) { # parent close $stdout_write; close $stderr_write; close $lhs_rhs_write; close $lhs_rhs_read; do_parent( stdout_read => $stdout_read, stderr_read => $stderr_read, stdout_lines => ($stdout = []), stderr_lines => ($stderr = []), ); waitpid $lhs_pid, 0; waitpid $rhs_pid, 0; } elsif ( $lhs_pid ) { # right-hand-side child close $stdout_read; close $stderr_read; close $stderr_write; close $lhs_rhs_write; open STDIN, '<&', $lhs_rhs_read or die "Can't open: $!"; open STDOUT, '>&', $stdout_write or die "Can't open: $!"; close STDERR; exec @rhs_args; } else { # left-hand side child close $stdout_read; close $stdout_write; close $lhs_rhs_read; close $stderr_read; open STDOUT, '>&', $lhs_rhs_write or die "Can't open: $!"; open STDERR, '>&', $stderr_write or die "Can't open: $!"; close STDIN; exec @lhs_args; } } sets_match( $stdout, \@expected, __FILE__ ); is_empty_array( $stderr ); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-create-ackrc.t�����������������������������������������������������������������������0000644�0001750�0001750�00000001476�13213376747�014402� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 5; use Util; use App::Ack (); use App::Ack::ConfigDefault (); prep_environment(); my @commented = App::Ack::ConfigDefault::options(); my @uncommented = App::Ack::ConfigDefault::options_clean(); cmp_ok( scalar @commented, '>', scalar @uncommented, 'There are fewer lines in the uncommented options.' ); my @output = run_ack( 'ack', '--create-ackrc' ); ok(scalar(grep { $_ eq '--ignore-ack-defaults' } @output), '--ignore-ack-defaults should be present in output'); @output = grep { $_ ne '--ignore-ack-defaults' } @output; lists_match(\@output, \@commented, 'lines in output should match the default options'); my @versions = grep { /\Qack version $App::Ack::VERSION/ } @commented; is( scalar @versions, 1, 'Got exactly one version line' ); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/config-loader.t��������������������������������������������������������������������������0000644�0001750�0001750�00000023515�13215622023�014010� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use Util; use Test::More tests => 37; use Carp qw(croak); use File::Temp; use App::Ack::Filter::Default; use App::Ack::ConfigLoader; delete @ENV{qw( PAGER ACK_PAGER ACK_PAGER_COLOR ACK_OPTIONS )}; my %defaults = ( 'break' => undef, color => undef, column => undef, count => undef, dont_report_bad_filenames => undef, f => undef, files_from => undef, filters => [ App::Ack::Filter::Default->new ], flush => undef, follow => undef, g => undef, h => undef, H => undef, heading => undef, i => undef, l => undef, L => undef, m => undef, n => undef, output => undef, pager => undef, passthru => undef, print0 => undef, Q => undef, regex => undef, show_types => undef, smart_case => undef, sort_files => undef, v => undef, w => undef, ); test_loader( expected_opts => { %defaults }, expected_targets => [], 'empty inputs should result in default outputs' ); # --after_context, --before_context for my $option ( qw( after_context before_context ) ) { my $long_arg = $option; $long_arg =~ s/_/-/ or die; test_loader( argv => [ "--$long_arg=15" ], expected_opts => { %defaults, $option => 15 }, expected_targets => [], "--$long_arg=15 should set $option to 15", ); test_loader( argv => [ "--$long_arg=0" ], expected_opts => { %defaults, $option => 0 }, expected_targets => [], "--$long_arg=0 should set $option to 0", ); test_loader( argv => [ "--$long_arg" ], expected_opts => { %defaults, $option => 2 }, expected_targets => [], "--$long_arg without a value should default $option to 2", ); test_loader( argv => [ "--$long_arg=-43" ], expected_opts => { %defaults, $option => 2 }, expected_targets => [], "--$long_arg with a negative value should default $option to 2", ); my $short_arg = '-' . uc substr( $option, 0, 1 ); test_loader( argv => [ $short_arg, 15 ], expected_opts => { %defaults, $option => 15 }, expected_targets => [], "$short_arg 15 should set $option to 15", ); test_loader( argv => [ $short_arg, 0 ], expected_opts => { %defaults, $option => 0 }, expected_targets => [], "$short_arg 0 should set $option to 0", ); test_loader( argv => [ $short_arg ], expected_opts => { %defaults, $option => 2 }, expected_targets => [], "$short_arg without a value should default $option to 2", ); test_loader( argv => [ $short_arg, '-43' ], expected_opts => { %defaults, $option => 2 }, expected_targets => [], "$short_arg with a negative value should default $option to 2", ); } test_loader( argv => ['-C', 5], expected_opts => { %defaults, after_context => 5, before_context => 5 }, expected_targets => [], '-C sets both before_context and after_context' ); test_loader( argv => ['-C'], expected_opts => { %defaults, after_context => 2, before_context => 2 }, expected_targets => [], '-C sets both before_context and after_context, with default' ); test_loader( argv => ['-C', 0], expected_opts => { %defaults, after_context => 0, before_context => 0 }, expected_targets => [], '-C sets both before_context and after_context, with zero overriding default' ); test_loader( argv => ['-C', -43], expected_opts => { %defaults, after_context => 2, before_context => 2 }, expected_targets => [], '-C with invalid value sets both before_context and after_context to default' ); test_loader( argv => ['--context=5'], expected_opts => { %defaults, after_context => 5, before_context => 5 }, expected_targets => [], '--context sets both before_context and after_context' ); test_loader( argv => ['--context'], expected_opts => { %defaults, after_context => 2, before_context => 2 }, expected_targets => [], '--context sets both before_context and after_context, with default' ); test_loader( argv => ['--context=0'], expected_opts => { %defaults, after_context => 0, before_context => 0 }, expected_targets => [], '--context sets both before_context and after_context, with zero overriding default' ); test_loader( argv => ['--context=-43'], expected_opts => { %defaults, after_context => 2, before_context => 2 }, expected_targets => [], '--context with invalid value sets both before_context and after_context to default' ); # XXX These tests should all be replicated to work off of the ack command line # tools instead of its internal APIs! do { local $ENV{'ACK_PAGER'} = './test-pager --skip=2'; test_loader( argv => [], expected_opts => { %defaults, pager => './test-pager --skip=2' }, expected_targets => [], 'ACK_PAGER should set the default pager', ); test_loader( argv => ['--pager=./test-pager'], expected_opts => { %defaults, pager => './test-pager' }, expected_targets => [], '--pager should override ACK_PAGER', ); test_loader( argv => ['--nopager'], expected_opts => { %defaults }, expected_targets => [], '--nopager should suppress ACK_PAGER', ); }; do { local $ENV{'ACK_PAGER_COLOR'} = './test-pager --skip=2'; test_loader( argv => [], expected_opts => { %defaults, pager => './test-pager --skip=2' }, expected_targets => [], 'ACK_PAGER_COLOR should set the default pager', ); test_loader( argv => ['--pager=./test-pager'], expected_opts => { %defaults, pager => './test-pager' }, expected_targets => [], '--pager should override ACK_PAGER_COLOR', ); test_loader( argv => ['--nopager'], expected_opts => { %defaults }, expected_targets => [], '--nopager should suppress ACK_PAGER_COLOR', ); local $ENV{'ACK_PAGER'} = './test-pager --skip=3'; test_loader( argv => [], expected_opts => { %defaults, pager => './test-pager --skip=2' }, expected_targets => [], 'ACK_PAGER_COLOR should override ACK_PAGER', ); test_loader( argv => ['--pager=./test-pager'], expected_opts => { %defaults, pager => './test-pager' }, expected_targets => [], '--pager should override ACK_PAGER_COLOR and ACK_PAGER', ); test_loader( argv => ['--nopager'], expected_opts => { %defaults }, expected_targets => [], '--nopager should suppress ACK_PAGER_COLOR and ACK_PAGER', ); }; do { local $ENV{'PAGER'} = './test-pager'; test_loader( argv => [], expected_opts => { %defaults }, expected_targets => [], q{PAGER doesn't affect ack by default}, ); test_loader( argv => ['--pager'], expected_opts => { %defaults, pager => './test-pager' }, expected_targets => [], 'PAGER is used if --pager is specified with no argument', ); test_loader( argv => ['--pager=./test-pager --skip=2'], expected_opts => { %defaults, pager => './test-pager --skip=2' }, expected_targets => [], 'PAGER is not used if --pager is specified with an argument', ); # XXX what if --pager is specified but PAGER isn't set? }; done_testing; sub test_loader { local $Test::Builder::Level = $Test::Builder::Level + 1; die 'Must pass key/value pairs, plus a message at the end' unless @_ % 2 == 1; my $msg = pop; my %opts = @_; return subtest "test_loader( $msg )" => sub { plan tests => 2; my ( $env, $argv, $expected_opts, $expected_targets ) = delete @opts{qw/env argv expected_opts expected_targets/}; $env = '' unless defined $env; $argv = [] unless defined $argv; my @files = map { $opts{$_} } sort { my ( $a_end ) = $a =~ /(\d+)/; my ( $b_end ) = $b =~ /(\d+)/; $a_end <=> $b_end; } grep { /^file\d+/ } keys %opts; foreach my $contents (@files) { my $file = File::Temp->new; print {$file} $contents; close $file or die $!; } my ( $got_opts, $got_targets ); do { local $ENV{'ACK_OPTIONS'} = $env; local @ARGV; my @arg_sources = ( { name => 'ARGV', contents => $argv }, map { +{ name => $_, contents => scalar read_file($_) } } @files, ); $got_opts = App::Ack::ConfigLoader::process_args( @arg_sources ); $got_targets = [ @ARGV ]; }; is_deeply( $got_opts, $expected_opts, 'Options match' ); is_deeply( $got_targets, $expected_targets, 'Targets match' ); }; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-ignore-dir.t�������������������������������������������������������������������������0000644�0001750�0001750�00000020243�13213376747�014106� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 45; use File::Spec; use lib 't'; use Util; prep_environment(); my @files_mentioning_apples = qw( t/swamp/groceries/fruit t/swamp/groceries/junk t/swamp/groceries/another_subdir/fruit t/swamp/groceries/another_subdir/junk t/swamp/groceries/another_subdir/CVS/fruit t/swamp/groceries/another_subdir/CVS/junk t/swamp/groceries/another_subdir/RCS/fruit t/swamp/groceries/another_subdir/RCS/junk t/swamp/groceries/dir.d/fruit t/swamp/groceries/dir.d/junk t/swamp/groceries/dir.d/CVS/fruit t/swamp/groceries/dir.d/CVS/junk t/swamp/groceries/dir.d/RCS/fruit t/swamp/groceries/dir.d/RCS/junk t/swamp/groceries/subdir/fruit t/swamp/groceries/subdir/junk t/swamp/groceries/CVS/fruit t/swamp/groceries/CVS/junk t/swamp/groceries/RCS/fruit t/swamp/groceries/RCS/junk ); my @std_ignore = qw( RCS CVS ); my( @expected, @results, $test_description ); sub set_up_assertion_that_these_options_will_ignore_those_directories { my( $options, $ignored_directories, $optional_test_description ) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; $test_description = $optional_test_description || join( ' ', @{$options} ); my $filter = join( '|', @{$ignored_directories} ); @expected = grep { ! m{/(?:$filter)/} } @files_mentioning_apples; @results = run_ack( @{$options}, '--noenv', '-l', 'apple', 't/swamp' ); # ignore everything in .svn directories my $svn_regex = quotemeta File::Spec->catfile( '', '.svn', '' ); # the respective filesystem equivalent of '/.svn/' @results = grep { ! m/$svn_regex/ } @results; return; } DASH_IGNORE_DIR: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=subdir', ], [ @std_ignore, 'subdir', ], ); sets_match( \@results, \@expected, $test_description ); } DASH_IGNORE_DIR_WITH_SLASH: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=subdir/', ], [ @std_ignore, 'subdir', ], ); sets_match( \@results, \@expected, $test_description ); } DASH_IGNORE_DIR_MULTIPLE_TIMES: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=subdir', '--ignore-dir=another_subdir', ], [ @std_ignore, 'subdir', 'another_subdir', ], ); sets_match( \@results, \@expected, $test_description ); } DASH_NOIGNORE_DIR: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--noignore-dir=CVS', ], [ 'RCS', ], ); sets_match( \@results, \@expected, $test_description ); } DASH_NOIGNORE_DIR_MULTIPLE_TIMES: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--noignore-dir=CVS', '--noignore-dir=RCS', ], [ ], ); sets_match( \@results, \@expected, $test_description ); } DASH_IGNORE_DIR_WITH_DASH_NOIGNORE_DIR: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--noignore-dir=CVS', '--ignore-dir=subdir', ], [ 'RCS', 'subdir', ], ); sets_match( \@results, \@expected, $test_description ); } LAST_ONE_LISTED_WINS: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--noignore-dir=CVS', '--ignore-dir=CVS', ], [ @std_ignore, ], ); sets_match( \@results, \@expected, $test_description ); set_up_assertion_that_these_options_will_ignore_those_directories( [ '--noignore-dir=CVS', '--ignore-dir=CVS', '--noignore-dir=CVS', ], [ 'RCS', ], ); sets_match( \@results, \@expected, $test_description ); set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=subdir', '--noignore-dir=subdir', ], [ @std_ignore, ], ); sets_match( \@results, \@expected, $test_description ); set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=subdir', '--noignore-dir=subdir', '--ignore-dir=subdir', ], [ @std_ignore, 'subdir', ], ); sets_match( \@results, \@expected, $test_description ); } DASH_IGNORE_DIR_IGNORES_RELATIVE_PATHS: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=' . File::Spec->catdir('t' ,'swamp', 'groceries' , 'another_subdir'), ], [ @std_ignore, 'another_subdir', ], 'ignore relative paths instead of just directory names', ); sets_match( \@results, \@expected, $test_description ); } NOIGNORE_SUBDIR_WINS: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=another_subdir', '--noignore-dir=CVS' ], [ 'RCS', 'another_subdir(?!/CVS)' ], ); sets_match( \@results, \@expected, $test_description ); } IGNORE_DIR_MATCH: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=match:/\w_subdir/' ], [ @std_ignore, 'another_subdir', ], ); sets_match( \@results, \@expected, $test_description ); } IGNORE_DIR_EXT: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=ext:d' ], [ @std_ignore, 'dir.d', ], ); sets_match( \@results, \@expected, $test_description ); } IGNORE_DIR_FIRSTMATCH: { my ( $stdout, $stderr ) = run_ack_with_stderr('--ignore-dir=firstlinematch:perl', '--noenv', '-l', 'apple', 't/swamp'); is(scalar(@{$stdout}), 0, '--ignore-dir=firstlinematch:perl is erroneous and should print nothing to standard output'); isnt(scalar(@{$stderr}), 0, '--ignore-dir=firstlinematch:perl is erroneous and should print something to standard error'); like($stderr->[0], qr/Invalid filter specification "firstlinematch" for option '--ignore-dir'/, '--ignore-dir=firstlinematch:perl should report an error message'); } IGNORE_DIR_MATCH_NOIGNORE_DIR: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=match:/\w_subdir/', '--noignore-dir=CVS' ], [ 'RCS', 'another_subdir(?!/CVS)', ], ); sets_match( \@results, \@expected, $test_description ); } IGNORE_DIR_MATCH_NOIGNORE_DIR_IS: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=match:/\w_subdir/', '--noignore-dir=is:CVS' ], [ 'RCS', 'another_subdir(?!/CVS)', ], ); sets_match( \@results, \@expected, $test_description ); } IGNORE_DIR_MATCH_NOIGNORE_DIR_MATCH: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--ignore-dir=match:/\w_subdir/', '--noignore-dir=match:/^..S/' ], [ 'another_subdir(?!/(?:CVS|RCS))', ], ); sets_match( \@results, \@expected, $test_description ); } NOIGNORE_DIR_RELATIVE_PATHS: { set_up_assertion_that_these_options_will_ignore_those_directories( [ '--noignore-dir=' . File::Spec->catdir('t' ,'swamp', 'groceries' , 'another_subdir', 'CVS'), ], [ 'RCS', '(?<!another_subdir/)CVS', ], 'no-ignore relative paths instead of just directory names', ); sets_match( \@results, \@expected, $test_description ); } IGNORE_DIR_DONT_IGNORE_TARGET: { my @stdout = run_ack('--ignore-dir=swamp', '-f', 't/swamp'); isnt(scalar(@stdout), 0, 'Specifying a directory on the command line should override ignoring it'); } IGNORE_SUBDIR_OF_TARGET: { my @stdout = run_ack('--ignore-dir=swamp', '-l', 'quux', 't/swamp'); is(scalar(@stdout), 0, 'Specifying a directory on the command line should still ignore matching subdirs'); @stdout = run_ack('-l', 'quux', 't/swamp'); is(scalar(@stdout), 1, 'Double-check it is found without ignore-dir'); } # --noignore-dir=firstlinematch # --ignore-dir=... + --noignore-dir=ext # --ignore-dir=is + --noignore-dir=match # --ignore-dir=is + --noignore-dir=ext # --ignore-dir=match + --noignore-dir=match # --ignore-dir=match + --noignore-dir=ext # --ignore-dir=ext + --noignore-dir=match # --ignore-dir=ext + --noignore-dir=ext # re-ignore a directory �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-invalid-ackrc.t����������������������������������������������������������������������0000644�0001750�0001750�00000004260�13213402177�014542� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use File::Temp; use List::Util qw(sum); use Test::More; use lib 't'; use Util; plan skip_all => q{Don't yet have a reliable way to ignore the Unicode complaints from Pod::Perldoc}; my @types = ( perl => [qw{.pl .pod .pl .t}], python => [qw{.py}], ruby => [qw{.rb Rakefile}], ); plan tests => sum(map { ref($_) ? scalar(@$_) : 1 } @types) + 14; prep_environment(); my $wd = getcwd_clean(); my $tempdir = File::Temp->newdir; safe_chdir( $tempdir->dirname ); write_file '.ackrc', "--frobnicate\n"; my $output; $output = run_ack( '--env', '--help' ); like $output, qr/Usage: ack/; { my $stderr; ( $output, $stderr ) = run_ack_with_stderr( '--env', '--help-types' ); like join("\n", @{$output}), qr/Usage: ack/; $stderr = join("\n", @{$stderr}); like $stderr, qr/Unknown option: frobnicate/; # the following was shamelessly copied from ack-help-types.t for (my $i = 0; $i < @types; $i += 2) { my ( $type, $checks ) = @types[ $i , $i + 1 ]; my ( $matching_line ) = grep { /--\[no\]$type/ } @{$output}; ok $matching_line; foreach my $check (@{$checks}) { like $matching_line, qr/\Q$check\E/; } } } { ($output, my $stderr) = run_ack_with_stderr( '--env', '--man' ); # Don't worry if man complains about long lines, # or if the terminal doesn't handle Unicode: is( scalar(grep !m{can't\ break\ line |Wide\ character\ in\ print |Unknown\ escape\ E<0x[[:xdigit:]]+>}x, @{$stderr}), 0, 'Should have no output to stderr: ack --env --man' ) or diag( join( "\n", 'STDERR:', @{$stderr} ) ); if ( is_windows() ) { like( join("\n", @{$output}[0,1]), qr/^NAME\s+ack(?:-standalone)?\s/ ); } else { like( $output->[0], qr/ACK(?:-STANDALONE)?\Q(1)\E/ ); } } $output = run_ack( '--env', '--thpppt' ); like( $output, qr/ack --thpppt/ ); $output = run_ack( '--env', '--bar' ); like( $output, qr/It's a grep/ ); $output = run_ack( '--env', '--cathy' ); like $output, qr/CHOCOLATE/; $output = run_ack( '--env', '--version' ); like $output, qr/ack 2[.]\d+/; safe_chdir( $wd ); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/anchored.t�������������������������������������������������������������������������������0000644�0001750�0001750�00000006056�13216123637�013073� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T # Make sure beginning-of-line anchor works use strict; use warnings; use Test::More tests => 5; use lib 't'; use Util; prep_environment(); my @files = qw( t/text/constitution.txt ); FRONT_ANCHORED: { my @args = qw( --sort-files -h -i ^congress ); my @expected = line_split( <<'HERE' ); Congress prior to the Year one thousand eight hundred and eight, but HERE ack_lists_match( [ @args, @files ], \@expected, 'Looking for front-anchored "congress"' ); } BACK_ANCHORED: { my @args = qw( --sort-files -h -i congress$ ); my @expected = line_split( <<'HERE' ); All legislative Powers herein granted shall be vested in a Congress Fact, with such Exceptions, and under such Regulations as the Congress Records, and judicial Proceedings of every other State. And the Congress HERE ack_sets_match( [ @args, @files ], \@expected, 'Looking for back-anchored "congress"' ); } UNANCHORED: { my @args = qw( --sort-files -h -i congress ); my @expected = line_split( <<'HERE' ); All legislative Powers herein granted shall be vested in a Congress the first Meeting of the Congress of the United States, and within thereof; but the Congress may at any time by Law make or alter such The Congress shall assemble at least once in every Year, and such Neither House, during the Session of Congress, shall, without the Consent a Law, in like Manner as if he had signed it, unless the Congress by The Congress shall have Power To lay and collect Taxes, Duties, Imposts the discipline prescribed by Congress; particular States, and the Acceptance of Congress, become the Seat of Congress prior to the Year one thousand eight hundred and eight, but the Consent of the Congress, accept of any present, Emolument, Office, No State shall, without the Consent of the Congress, lay any Imposts or subject to the Revision and Control of the Congress. No State shall, without the Consent of Congress, lay any Duty of Tonnage, and Representatives to which the State may be entitled in the Congress: The Congress may determine the Time of chusing the Electors, and the Office, the Same shall devolve on the Vice President, and the Congress may be established by Law: but the Congress may by Law vest the Appointment He shall from time to time give to the Congress Information on the State Court, and in such inferior Courts as the Congress may from time to Fact, with such Exceptions, and under such Regulations as the Congress shall be at such Place or Places as the Congress may by Law have directed. The Congress shall have Power to declare the Punishment of Treason, but Records, and judicial Proceedings of every other State. And the Congress New States may be admitted by the Congress into this Union; but no new concerned as well as of the Congress. The Congress shall have Power to dispose of and make all needful Rules and The Congress, whenever two thirds of both Houses shall deem it necessary, Ratification may be proposed by the Congress; Provided that no Amendment HERE ack_lists_match( [ @args, @files ], \@expected, 'Looking for unanchored congress' ); } done_testing(); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-o.t����������������������������������������������������������������������������������0000644�0001750�0001750�00000007006�13216123637�012276� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 11; use File::Spec (); use File::Temp (); use lib 't'; use Util; prep_environment(); NO_O: { my @files = qw( t/text/gettysburg.txt ); my @args = qw( the\\s+\\S+ ); my @expected = line_split( <<'HERE' ); but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who here dedicated to the great task remaining before us -- that from these the last full measure of devotion -- that we here highly resolve that shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth. HERE s/^\s+// for @expected; ack_lists_match( [ @args, @files ], \@expected, 'Find all the things without -o' ); } WITH_O: { my @files = qw( t/text/gettysburg.txt ); my @args = qw( the\\s+\\S+ -o ); my @expected = line_split( <<'HERE' ); the living, the unfinished the great the last the people, the people, the people, the earth. HERE s/^\s+// for @expected; ack_lists_match( [ @args, @files ], \@expected, 'Find all the things with -o' ); } # Find a match in multiple files, and output it in double quotes. OUTPUT_DOUBLE_QUOTES: { my @files = qw( t/text/ ); my @args = ( '--output="$1"', '(free\\w*)', '--sort-files' ); my @target_file = map { reslash($_) } qw( t/text/bill-of-rights.txt t/text/constitution.txt t/text/gettysburg.txt ); my @expected = ( qq{$target_file[0]:4:"free"}, qq{$target_file[0]:4:"freedom"}, qq{$target_file[0]:10:"free"}, qq{$target_file[1]:32:"free"}, qq{$target_file[2]:23:"freedom"}, ); ack_sets_match( [ @args, @files ], \@expected, 'Find all the things with --output function' ); } my $wd = getcwd_clean(); my $tempdir = File::Temp->newdir; safe_mkdir( File::Spec->catdir($tempdir->dirname, 'subdir') ); PROJECT_ACKRC_OUTPUT_FORBIDDEN: { my @files = untaint( File::Spec->rel2abs('t/text/') ); my @args = qw/ --env question(\\S+) /; safe_chdir( $tempdir->dirname ); write_file '.ackrc', "--output=foo\n"; my ( $stdout, $stderr ) = run_ack_with_stderr(@args, @files); is_empty_array( $stdout ); first_line_like( $stderr, qr/\QOptions --output, --pager and --match are forbidden in project .ackrc files/ ); safe_chdir( $wd ); } HOME_ACKRC_OUTPUT_PERMITTED: { my @files = untaint( File::Spec->rel2abs('t/text/') ); my @args = qw/ --env question(\\S+) --sort-files /; write_file(File::Spec->catfile($tempdir->dirname, '.ackrc'), "--output=foo\n"); safe_chdir( File::Spec->catdir($tempdir->dirname, 'subdir') ); local $ENV{'HOME'} = $tempdir->dirname; my ( $stdout, $stderr ) = run_ack_with_stderr(@args, @files); is_nonempty_array( $stdout ); is_empty_array( $stderr ); safe_chdir( $wd ); } ACKRC_ACKRC_OUTPUT_PERMITTED: { my @files = untaint( File::Spec->rel2abs('t/text/') ); my @args = qw/ --env question(\\S+) --sort-files /; write_file(File::Spec->catfile($tempdir->dirname, '.ackrc'), "--output=foo\n"); safe_chdir( File::Spec->catdir($tempdir->dirname, 'subdir') ); local $ENV{'ACKRC'} = File::Spec->catfile($tempdir->dirname, '.ackrc'); my ( $stdout, $stderr ) = run_ack_with_stderr(@args, @files); is_nonempty_array( $stdout ); is_empty_array( $stderr ); safe_chdir( $wd ); } done_testing(); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/asp-net-ext.t����������������������������������������������������������������������������0000644�0001750�0001750�00000000560�13213376747�013460� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 2; use Util; prep_environment(); my @expected = qw( t/swamp/MasterPage.master t/swamp/Sample.ascx t/swamp/Sample.asmx t/swamp/sample.aspx t/swamp/service.svc ); my @args = qw( --aspx -f ); my @results = run_ack(@args); sets_match( \@results, \@expected, __FILE__ ); ������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-known-types.t������������������������������������������������������������������������0000644�0001750�0001750�00000003163�13213376747�014347� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use Test::More tests => 4; use lib 't'; use Util; prep_environment(); my @files = qw( t/swamp/0 t/swamp/Rakefile t/swamp/parrot.pir t/swamp/options-crlf.pl t/swamp/options.pl t/swamp/javascript.js t/swamp/html.html t/swamp/perl-without-extension t/swamp/sample.rake t/swamp/perl.cgi t/swamp/Makefile t/swamp/pipe-stress-freaks.F t/swamp/perl.pod t/swamp/html.htm t/swamp/perl-test.t t/swamp/perl.handler.pod t/swamp/perl.pl t/swamp/Makefile.PL t/swamp/MasterPage.master t/swamp/c-source.c t/swamp/perl.pm t/swamp/c-header.h t/swamp/crystallography-weenies.f t/swamp/CMakeLists.txt t/swamp/Sample.ascx t/swamp/Sample.asmx t/swamp/sample.asp t/swamp/sample.aspx t/swamp/service.svc t/swamp/stuff.cmake t/swamp/example.R t/swamp/fresh.css t/swamp/lua-shebang-test ); my @files_no_perl = qw( t/swamp/Rakefile t/swamp/parrot.pir t/swamp/javascript.js t/swamp/html.html t/swamp/sample.rake t/swamp/Makefile t/swamp/MasterPage.master t/swamp/pipe-stress-freaks.F t/swamp/html.htm t/swamp/c-source.c t/swamp/c-header.h t/swamp/crystallography-weenies.f t/swamp/CMakeLists.txt t/swamp/Sample.ascx t/swamp/Sample.asmx t/swamp/sample.asp t/swamp/sample.aspx t/swamp/service.svc t/swamp/stuff.cmake t/swamp/example.R t/swamp/fresh.css t/swamp/lua-shebang-test ); ack_sets_match( [ '--known-types', '-f', 't/swamp' ], \@files, '--known-types test #1' ); ack_sets_match( [ '--known-types', '--noperl', '-f', 't/swamp' ], \@files_no_perl, '--known-types test #2' ); ack_sets_match( [ '-k', '-f', 't/swamp' ], \@files, '-k test #1' ); ack_sets_match( [ '-k', '-f', '--noperl', 't/swamp' ], \@files_no_perl, '-k test #2' ); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-named-pipes.t������������������������������������������������������������������������0000644�0001750�0001750�00000001772�13213402177�014242� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use File::Temp; use Test::More; use Util; use POSIX (); local $SIG{'ALRM'} = sub { fail 'Timeout'; exit; }; prep_environment(); my $tempdir = File::Temp->newdir; safe_mkdir( "$tempdir/foo" ); my $rc = eval { POSIX::mkfifo( "$tempdir/foo/test.pipe", oct(660) ) }; if ( !$rc ) { dir_cleanup( $tempdir ); plan skip_all => $@ ? $@ : q{I can't run a mkfifo, so cannot run this test.}; } plan tests => 2; touch( "$tempdir/foo/bar.txt" ); alarm 5; # Should be plenty of time. my @results = run_ack( '-f', $tempdir ); is_deeply( \@results, [ "$tempdir/foo/bar.txt", ], 'Acking should not find the fifo' ); dir_cleanup( $tempdir ); done_testing(); sub dir_cleanup { my $tempdir = shift; unlink "$tempdir/foo/bar.txt"; rmdir "$tempdir/foo"; rmdir $tempdir; return; } sub touch { my $filename = shift; my $fh; open $fh, '>>', $filename or die "Unable to append to $filename: $!"; close $fh; return; } ������ack-2.22/t/ack-interactive.t������������������������������������������������������������������������0000644�0001750�0001750�00000010333�13216123637�014352� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use Test::More; use Term::ANSIColor qw(color); use lib 't'; use Util; if ( not has_io_pty() ) { plan skip_all => q{You need to install IO::Pty to run this test}; exit(0); } plan tests => 6; prep_environment(); INTERACTIVE_GROUPING_NOCOLOR: { my @args = qw( free --nocolor --sort-files ); my @files = qw( t/text ); my $output = run_ack_interactive(@args, @files); is( $output, <<'HERE' ); t/text/bill-of-rights.txt 4:or prohibiting the free exercise thereof; or abridging the freedom of 10:A well regulated Militia, being necessary to the security of a free State, t/text/constitution.txt 32:Number of free Persons, including those bound to Service for a Term t/text/gettysburg.txt 23:shall have a new birth of freedom -- and that government of the people, HERE } INTERACTIVE_NOHEADING_NOCOLOR: { my @args = qw( free --nocolor --noheading --sort-files ); my @files = qw( t/text ); my $output = run_ack_interactive(@args, @files); is( $output, <<'HERE' ); t/text/bill-of-rights.txt:4:or prohibiting the free exercise thereof; or abridging the freedom of t/text/bill-of-rights.txt:10:A well regulated Militia, being necessary to the security of a free State, t/text/constitution.txt:32:Number of free Persons, including those bound to Service for a Term t/text/gettysburg.txt:23:shall have a new birth of freedom -- and that government of the people, HERE } INTERACTIVE_NOGROUP_NOCOLOR: { my @args = qw( free --nocolor --nogroup --sort-files ); my @files = qw( t/text ); my $output = run_ack_interactive(@args, @files); is( $output, <<'HERE' ); t/text/bill-of-rights.txt:4:or prohibiting the free exercise thereof; or abridging the freedom of t/text/bill-of-rights.txt:10:A well regulated Militia, being necessary to the security of a free State, t/text/constitution.txt:32:Number of free Persons, including those bound to Service for a Term t/text/gettysburg.txt:23:shall have a new birth of freedom -- and that government of the people, HERE } INTERACTIVE_GROUPING_COLOR: { my @args = qw( free --sort-files ); # --color is on by default my @files = qw( t/text ); my $CFN = color 'bold green'; my $CRESET = color 'reset'; my $CLN = color 'bold yellow'; my $CM = color 'black on_yellow'; my $LINE_END = "\e[0m\e[K"; my @expected_lines = line_split( <<"HERE" ); ${CFN}t/text/bill-of-rights.txt${CRESET} ${CLN}4${CRESET}:or prohibiting the ${CM}free${CRESET} exercise thereof; or abridging the ${CM}free${CRESET}dom of$LINE_END ${CLN}10${CRESET}:A well regulated Militia, being necessary to the security of a ${CM}free${CRESET} State,$LINE_END ${CFN}t/text/constitution.txt${CRESET} ${CLN}32${CRESET}:Number of ${CM}free${CRESET} Persons, including those bound to Service for a Term$LINE_END ${CFN}t/text/gettysburg.txt${CRESET} ${CLN}23${CRESET}:shall have a new birth of ${CM}free${CRESET}dom -- and that government of the people,$LINE_END HERE my @lines = run_ack_interactive(@args, @files); lists_match( \@lines, \@expected_lines, 'INTERACTIVE_GROUPING_COLOR' ); } INTERACTIVE_SINGLE_TARGET: { my @args = qw( (nevermore) -i --nocolor ); my @files = qw( t/text/raven.txt ); my $output = run_ack_interactive(@args, @files); is( $output, <<'HERE' ); Quoth the Raven, "Nevermore." With such name as "Nevermore." Then the bird said, "Nevermore." Of 'Never -- nevermore.' Meant in croaking "Nevermore." She shall press, ah, nevermore! Quoth the Raven, "Nevermore." Quoth the Raven, "Nevermore." Quoth the Raven, "Nevermore." Quoth the Raven, "Nevermore." Shall be lifted--nevermore! HERE } INTERACTIVE_NOCOLOR_REGEXP_CAPTURE: { my @args = qw( (nevermore) -i --nocolor ); my @files = qw( t/text/raven.txt ); my $output = run_ack_interactive(@args, @files); is( $output, <<'HERE' ); Quoth the Raven, "Nevermore." With such name as "Nevermore." Then the bird said, "Nevermore." Of 'Never -- nevermore.' Meant in croaking "Nevermore." She shall press, ah, nevermore! Quoth the Raven, "Nevermore." Quoth the Raven, "Nevermore." Quoth the Raven, "Nevermore." Quoth the Raven, "Nevermore." Shall be lifted--nevermore! HERE } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/default-filter.t�������������������������������������������������������������������������0000644�0001750�0001750�00000006233�13213376747�014225� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use FilterTest; use Test::More tests => 1; use App::Ack::Filter::Default; App::Ack::Filter->register_filter('default' => 'App::Ack::Filter::Default'); filter_test( [ 'default' ], [ 't/swamp/#emacs-workfile.pl#', 't/swamp/0', 't/swamp/c-header.h', 't/swamp/c-source.c', 't/swamp/crystallography-weenies.f', 't/swamp/example.R', 't/swamp/file.bar', 't/swamp/file.foo', 't/swamp/fresh.css', 't/swamp/fresh.min.css', 't/swamp/fresh.css.min', 't/swamp/html.htm', 't/swamp/html.html', 't/swamp/incomplete-last-line.txt', 't/swamp/javascript.js', 't/swamp/lua-shebang-test', 't/swamp/Makefile', 't/swamp/Makefile.PL', 't/swamp/MasterPage.master', 't/swamp/minified.js.min', 't/swamp/minified.min.js', 't/swamp/not-an-#emacs-workfile#', 't/swamp/notaMakefile', 't/swamp/notaRakefile', 't/swamp/notes.md', 't/swamp/options-crlf.pl', 't/swamp/options.pl', 't/swamp/options.pl.bak', 't/swamp/parrot.pir', 't/swamp/perl-test.t', 't/swamp/perl-without-extension', 't/swamp/perl.cgi', 't/swamp/perl.handler.pod', 't/swamp/perl.pl', 't/swamp/perl.pm', 't/swamp/perl.pod', 't/swamp/pipe-stress-freaks.F', 't/swamp/Rakefile', 't/swamp/Sample.ascx', 't/swamp/Sample.asmx', 't/swamp/sample.asp', 't/swamp/sample.aspx', 't/swamp/sample.rake', 't/swamp/service.svc', 't/swamp/blib/ignore.pir', 't/swamp/blib/ignore.pm', 't/swamp/blib/ignore.pod', 't/swamp/groceries/fruit', 't/swamp/groceries/junk', 't/swamp/groceries/meat', 't/swamp/groceries/another_subdir/fruit', 't/swamp/groceries/another_subdir/junk', 't/swamp/groceries/another_subdir/meat', 't/swamp/groceries/another_subdir/CVS/fruit', 't/swamp/groceries/another_subdir/CVS/junk', 't/swamp/groceries/another_subdir/CVS/meat', 't/swamp/groceries/another_subdir/RCS/fruit', 't/swamp/groceries/another_subdir/RCS/junk', 't/swamp/groceries/another_subdir/RCS/meat', 't/swamp/groceries/dir.d/fruit', 't/swamp/groceries/dir.d/junk', 't/swamp/groceries/dir.d/meat', 't/swamp/groceries/dir.d/CVS/fruit', 't/swamp/groceries/dir.d/CVS/junk', 't/swamp/groceries/dir.d/CVS/meat', 't/swamp/groceries/dir.d/RCS/fruit', 't/swamp/groceries/dir.d/RCS/junk', 't/swamp/groceries/dir.d/RCS/meat', 't/swamp/groceries/CVS/fruit', 't/swamp/groceries/CVS/junk', 't/swamp/groceries/CVS/meat', 't/swamp/groceries/RCS/fruit', 't/swamp/groceries/RCS/junk', 't/swamp/groceries/RCS/meat', 't/swamp/groceries/subdir/fruit', 't/swamp/groceries/subdir/junk', 't/swamp/groceries/subdir/meat', 't/swamp/stuff.cmake', 't/swamp/CMakeLists.txt', 't/swamp/swamp/ignoreme.txt', ], 'only non-binary files should be matched' ); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/issue571.t�������������������������������������������������������������������������������0000644�0001750�0001750�00000000545�13216123637�012672� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 2; use File::Temp; use Util; prep_environment(); my $tempfile = File::Temp->new(); print {$tempfile} <<'HERE'; fo oo HERE close $tempfile; my @results = run_ack('-l', 'fo\s+oo', $tempfile->filename); lists_match(\@results, [], '\s+ should never match across line boundaries'); �����������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/r-lang-ext.t�����������������������������������������������������������������������������0000644�0001750�0001750�00000000410�13213376747�013263� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 2; use Util; prep_environment(); my @expected = qw( t/swamp/example.R ); my @args = qw( --rr -f ); my @results = run_ack( @args ); sets_match( \@results, \@expected, __FILE__ ); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/home/������������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�13217305507�012043� 5����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/home/.ackrc������������������������������������������������������������������������������0000644�0001750�0001750�00000000000�12726365114�013121� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-k.t����������������������������������������������������������������������������������0000644�0001750�0001750�00000002074�13213402177�012266� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 2; use lib 't'; use Util; prep_environment(); subtest 'No restrictions on type' => sub { my $expected = <<'HERE'; t/etc/buttonhook.xml.xxx => xml t/etc/shebang.empty.xxx => t/etc/shebang.foobar.xxx => t/etc/shebang.php.xxx => php t/etc/shebang.pl.xxx => perl t/etc/shebang.py.xxx => python t/etc/shebang.rb.xxx => ruby t/etc/shebang.sh.xxx => shell HERE my @expected = reslash_all( line_split( $expected ) ); my @args = qw( -f --show-types t/etc ); ack_sets_match( [ @args ], \@expected, 'No restrictions on type' ); }; subtest 'Only known types' => sub { local $TODO = '-k not added yet'; my $expected = <<'HERE'; t/etc/buttonhook.xml.xxx => xml t/etc/shebang.php.xxx => php t/etc/shebang.pl.xxx => perl t/etc/shebang.py.xxx => python t/etc/shebang.rb.xxx => ruby t/etc/shebang.sh.xxx => shell HERE my @expected = reslash_all( line_split( $expected ) ); my @args = qw( -f -k --show-types t/etc ); ack_sets_match( [ @args ], \@expected, 'Only known types' ); }; done_testing(); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-g.t����������������������������������������������������������������������������������0000644�0001750�0001750�00000016070�13216123637�012267� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 18; use lib 't'; use Util; prep_environment(); subtest 'No starting directory specified' => sub { my $regex = 'non'; my @files = qw( t/foo/non-existent ); my @args = ( '-g', $regex ); my ($stdout, $stderr) = run_ack_with_stderr( @args, @files ); is_empty_array( $stdout, 'No STDOUT for non-existent file' ); is( scalar @{$stderr}, 1, 'One line of STDERR for non-existent file' ); like( $stderr->[0], qr/non-existent: No such file or directory/, 'Correct warning message for non-existent file' ); }; subtest 'regex comes before -g on the command line' => sub { my $regex = 'non'; my @files = qw( t/foo/non-existent ); my @args = ( $regex, '-g' ); my ($stdout, $stderr) = run_ack_with_stderr( @args, @files ); is_empty_array( $stdout, 'No STDOUT for non-existent file' ); is( scalar @{$stderr}, 1, 'One line of STDERR for non-existent file' ); like( $stderr->[0], qr/non-existent: No such file or directory/, 'Correct warning message for non-existent file' ); }; subtest 'No metacharacters' => sub { my @expected = qw( t/swamp/Makefile t/swamp/Makefile.PL t/swamp/notaMakefile ); my $regex = 'Makefile'; my @args = ( '-g', $regex ); my @files = qw( t/ ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex" ); }; subtest 'With metacharacters' => sub { my @expected = qw( t/swamp/html.htm t/swamp/html.html ); my $regex = 'swam.......htm'; my @args = ( '-g', $regex ); my @files = qw( t/ ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex" ); }; subtest 'Front anchor' => sub { my @expected = qw( t/file-permission.t t/filetypes.t t/filter.t ); my $regex = '^t.fil'; my @args = ( '-g', $regex ); my @files = qw( t ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex" ); }; subtest 'Back anchor' => sub { my @expected = qw( t/runtests.pl t/swamp/options-crlf.pl t/swamp/options.pl t/swamp/perl.pl ); my $regex = 'pl$'; my @args = ( '-g', $regex ); my @files = qw( t ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex" ); }; subtest 'Case-insensitive via -i' => sub { my @expected = qw( t/swamp/pipe-stress-freaks.F ); my $regex = 'PIPE'; my @args = ( '-i', '-g', $regex ); my @files = qw( t/swamp ); ack_sets_match( [ @args, @files ], \@expected, "Looking for -i -g $regex " ); }; subtest 'Case-insensitive via (?i:)' => sub { my @expected = qw( t/swamp/pipe-stress-freaks.F ); my $regex = '(?i:PIPE)'; my @files = qw( t/swamp ); my @args = ( '-g', $regex ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex" ); }; subtest 'File on command line is always searched' => sub { my @expected = ( 't/swamp/#emacs-workfile.pl#' ); my $regex = 'emacs'; my @args = ( '-g', $regex ); my @files = ( 't/swamp/#emacs-workfile.pl#' ); ack_sets_match( [ @args, @files ], \@expected, 'File on command line is always searched' ); }; subtest 'File on command line is always searched, even with wrong filetype' => sub { my @expected = qw( t/swamp/parrot.pir ); my $regex = 'parrot'; my @files = qw( t/swamp/parrot.pir ); my @args = ( '--html', '-g', $regex ); ack_sets_match( [ @args, @files ], \@expected, 'File on command line is always searched, even with wrong type.' ); }; subtest '-Q works on -g' => sub { my @expected = (); my $regex = 'ack-g.t$'; my @files = qw( t ); my @args = ( '-Q', '-g', $regex ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex with quotemeta." ); }; subtest '-w works on -g' => sub { my @expected = qw( t/text/number.txt ); my $regex = 'number'; # "number" shouldn't match "numbered" my @files = qw( t/text ); my @args = ( '-w', '-g', $regex, '--sort-files' ); ack_sets_match( [ @args, @files ], \@expected, "Looking for $regex with '-w'." ); }; subtest '-v works on -g' => sub { my @expected = qw( t/text/bill-of-rights.txt t/text/gettysburg.txt ); my $file_regex = 'n'; my @args = ( '-v', '-g', $file_regex, '--sort-files' ); my @files = qw( t/text/ ); ack_sets_match( [ @args, @files ], \@expected, "Looking for file names that do not match $file_regex" ); }; subtest '--smart-case works on -g' => sub { my @expected = qw( t/swamp/pipe-stress-freaks.F t/swamp/crystallography-weenies.f ); my @files = qw( t/swamp ); my @args = ( '--smart-case', '-g', 'f$' ); ack_sets_match( [ @args, @files ], \@expected, 'Looking for f$' ); @expected = qw( t/swamp/pipe-stress-freaks.F ); @args = ( '--smart-case', '-g', 'F$' ); ack_sets_match( [ @args, @files ], \@expected, 'Looking for f$' ); }; subtest 'test exit codes' => sub { my $file_regex = 'foo'; my @files = ( 't/text/' ); run_ack( '-g', $file_regex, @files ); is( get_rc(), 1, '-g with no matches must exit with 1' ); $file_regex = 'raven'; run_ack( '-g', $file_regex, @files ); is( get_rc(), 0, '-g with matches must exit with 0' ); }; subtest 'test -g on a path' => sub { my $file_regex = 'text'; my @expected = qw( t/context.t t/text/amontillado.txt t/text/bill-of-rights.txt t/text/constitution.txt t/text/gettysburg.txt t/text/number.txt t/text/numbered-text.txt t/text/ozymandias.txt t/text/raven.txt ); my @args = ( '--sort-files', '-g', $file_regex ); ack_sets_match( [ @args ], \@expected, 'Make sure -g matches the whole path' ); }; subtest 'test -g with --color' => sub { my $file_regex = 'text'; my $expected_original = <<'HERE'; t/con(text).t t/(text)/amontillado.txt t/(text)/bill-of-rights.txt t/(text)/constitution.txt t/(text)/gettysburg.txt t/(text)/number.txt t/(text)/numbered-(text).txt t/(text)/ozymandias.txt t/(text)/raven.txt HERE $expected_original = windows_slashify( $expected_original ) if is_windows; my @expected = colorize( $expected_original ); my @args = ( '--sort-files', '-g', $file_regex ); my @results = run_ack(@args, '--color'); is_deeply( \@results, \@expected, 'Colorizing -g output with --color should work'); }; subtest q{test -g without --color; make sure colors don't show} => sub { if ( !has_io_pty() ) { plan skip_all => 'IO::Pty is required for this test'; return; } plan tests => 1; my $file_regex = 'text'; my $expected = <<'HERE'; t/context.t t/text/amontillado.txt t/text/bill-of-rights.txt t/text/constitution.txt t/text/gettysburg.txt t/text/number.txt t/text/numbered-text.txt t/text/ozymandias.txt t/text/raven.txt HERE my @args = ( '--sort-files', '-g', $file_regex ); my $results = run_ack_interactive(@args); is( $results, $expected, 'Colorizing -g output without --color should have no color' ); }; done_testing(); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-help.t�������������������������������������������������������������������������������0000644�0001750�0001750�00000002660�13213376747�013002� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use Test::More; use lib 't'; use Util; { my $help_options; sub _populate_help_options { my ( $output, undef ) = run_ack_with_stderr( '--help' ); $help_options = []; foreach my $line (@{$output}) { if ( $line =~ /^\s+-/ ) { while ( $line =~ /(-[^\s=,]+)/g ) { my $option = $1; chop $option if $option =~ /\[$/; if ( $option =~ s/^--\[no\]/--/ ) { my $negated_option = $option; substr $negated_option, 2, 0, 'no'; push @{$help_options}, $negated_option; } push @{$help_options}, $option; } } } return; } sub get_help_options { _populate_help_options() unless $help_options; return @{ $help_options }; } } sub option_in_usage { my ( $expected_option ) = @_; my @help_options = get_help_options(); my $found; foreach my $option ( @help_options ) { if ( $option eq $expected_option ) { $found = 1; last; } } ok( $found, "Option '$expected_option' found in --help output" ); return; } my @options = get_options(); plan tests => scalar(@options); prep_environment(); foreach my $option ( @options ) { option_in_usage( $option ); } ��������������������������������������������������������������������������������ack-2.22/t/exit-code.t������������������������������������������������������������������������������0000644�0001750�0001750�00000000506�13213376747�013174� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 4; use Util; prep_environment(); run_ack( 'legislative', 't/text/constitution.txt' ); is( get_rc(), 0, 'Exit code with matches should be 0' ); run_ack( 'foo', 't/text/constitution.txt' ); is( get_rc(), 1, 'Exit code with no matches should be 1' ); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-h.t����������������������������������������������������������������������������������0000644�0001750�0001750�00000003161�13216123637�012265� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use Test::More tests => 12; use lib 't'; use Util; prep_environment(); NO_SWITCHES_ONE_FILE: { my @expected = line_split( <<'HERE' ); use strict; HERE my @files = qw( t/swamp/options.pl ); my @args = qw( strict ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Looking for strict in one file' ); } NO_SWITCHES_MULTIPLE_FILES: { my $target_file = reslash( 't/swamp/options.pl' ); my @expected = line_split( <<"HERE" ); $target_file:2:use strict; HERE my @files = qw( t/swamp/options.pl t/swamp/pipe-stress-freaks.F ); my @args = qw( strict ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Looking for strict in multiple files' ); } WITH_SWITCHES_ONE_FILE: { my $target_file = reslash( 't/swamp/options.pl' ); for my $opt ( qw( -H --with-filename ) ) { my @expected = line_split( <<"HERE" ); $target_file:2:use strict; HERE my @files = qw( t/swamp/options.pl ); my @args = ( $opt, qw( strict ) ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, "Looking for strict in one file with $opt" ); } } WITH_SWITCHES_MULTIPLE_FILES: { for my $opt ( qw( -h --no-filename ) ) { my @expected = line_split( <<"HERE" ); use strict; HERE my @files = qw( t/swamp/options.pl t/swamp/crystallography-weenies.f ); my @args = ( $opt, qw( strict ) ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, "Looking for strict in multiple files with $opt" ); } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-output.t�����������������������������������������������������������������������������0000644�0001750�0001750�00000011152�13213402177�013371� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 24; use lib 't'; use Util; prep_environment(); ARG: { my @expected = line_split( <<'HERE' ); shall have a new birth of freedom -- and that government of the people, HERE my @files = qw( t/text/gettysburg.txt ); my @args = qw( free --output=$_ ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Matching line' ); } ARG_MULTIPLE_FILES: { # Note the first line is there twice because it matches twice. my @expected = line_split( <<'HERE' ); or prohibiting the free exercise thereof; or abridging the freedom of or prohibiting the free exercise thereof; or abridging the freedom of A well regulated Militia, being necessary to the security of a free State, Number of free Persons, including those bound to Service for a Term shall have a new birth of freedom -- and that government of the people, HERE my @files = qw( t/text ); my @args = qw( free --sort-files -h --output=$_ ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Matching line' ); } MATCH: { my @expected = ( 'free' ); my @files = qw( t/text/gettysburg.txt ); my @args = qw( free --output=$& ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Part of a line matching pattern' ); } MATCH_MULTIPLE_FILES: { my @expected = line_split( <<'HERE' ); t/text/bill-of-rights.txt:4:free t/text/bill-of-rights.txt:4:free t/text/bill-of-rights.txt:10:free t/text/constitution.txt:32:free t/text/gettysburg.txt:23:free HERE my @files = qw ( t/text ); my @args = qw( free --sort-files --output=$& ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Part of a line matching pattern' ); } PREMATCH: { # No HEREDOC here since we do not want our editor/IDE messing with trailing whitespace. my @expected = ( 'shall have a new birth of ' ); my @files = qw( t/text/gettysburg.txt ); my @args = qw( freedom --output=$` ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Part of a line preceding match' ); } PREMATCH_MULTIPLE_FILES: { # No HEREDOC here since we do not want our editor/IDE messing with trailing whitespace. my @expected = ( 'or prohibiting the free exercise thereof; or abridging the ', 'shall have a new birth of ' ); my @files = qw( t/text/); my @args = qw( freedom -h --sort-files --output=$` ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Part of a line preceding match' ); } POSTMATCH: { my @expected = line_split( <<'HERE' ); -- and that government of the people, HERE my @files = qw( t/text/gettysburg.txt ); my @args = qw( freedom --output=$' ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Part of a line that follows match' ); } POSTMATCH_MULTIPLE_FILES: { my @expected = line_split( <<'HERE' ); of -- and that government of the people, HERE my @files = qw( t/text/ ); my @args = qw( freedom -h --sort-files --output=$' ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Part of a line that follows match' ); } SUBPATTERN_MATCH: { my @expected = ( 'love-God-Montresor' ); my @files = qw( t/text/amontillado.txt ); my @args = qw( (love).+(God).+(Montresor) --output=$1-$2-$3 ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Capturing parentheses match' ); } SUBPATTERN_MATCH_MULTIPLE_FILES: { my @expected = line_split( <<'HERE' ); the-free-exercise a-free-State of-free-Persons HERE my @files = qw( t/text/ ); my @args = qw( (\w+)\s(free)\s(\w+) -h --sort-files --output=$1-$2-$3 ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Capturing parentheses match' ); } INPUT_LINE_NUMBER: { my @expected = ( 'line:15' ); my @files = qw( t/text/bill-of-rights.txt ); my @args = qw( quartered --output=line:$. ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Line number' ); } INPUT_LINE_NUMBER_MULTIPLE_FILES: { my @expected = line_split( <<'HERE' ); t/text/bill-of-rights.txt:4:line:4 t/text/bill-of-rights.txt:4:line:4 t/text/bill-of-rights.txt:10:line:10 t/text/constitution.txt:32:line:32 t/text/gettysburg.txt:23:line:23 HERE my @files = qw( t/text/ ); my @args = qw( free --sort-files --output=line:$. ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Line number' ); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/filetypes.t������������������������������������������������������������������������������0000644�0001750�0001750�00000005064�13213402177�013306� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 19; use lib 't'; use Util; my %types_for_file; prep_environment(); sets_match( [filetypes( 't/swamp/perl.pod' )], [qw( parrot perl )], 'foo.pod can be multiple things' ); sets_match( [filetypes( 't/swamp/perl.pm' )], [qw( perl )], 't/swamp/perl.pm' ); sets_match( [filetypes( 't/swamp/Makefile.PL' )], [qw( perl )], 't/swamp/Makefile.PL' ); sets_match( [filetypes( 'Unknown.wango' )], [], 'Unknown' ); ok( is_filetype( 't/swamp/perl.pod', 'perl' ), 'foo.pod can be perl' ); ok( is_filetype( 't/swamp/perl.pod', 'parrot' ), 'foo.pod can be parrot' ); ok( !is_filetype( 't/swamp/perl.pod', 'ruby' ), 'foo.pod cannot be ruby' ); ok( is_filetype( 't/swamp/perl.handler.pod', 'perl' ), 'perl.handler.pod can be perl' ); ok( is_filetype( 't/swamp/Makefile', 'make' ), 'Makefile is a makefile' ); ok( is_filetype( 't/swamp/Rakefile', 'rake' ), 'Rakefile is a rakefile' ); is_empty_array( [filetypes('t/swamp/#emacs-workfile.pl#')], 'correctly skip files starting and ending with hash mark' ); MATCH_VIA_CONTENT: { my %lookups = ( 't/swamp/Makefile' => 'make', 't/swamp/Makefile.PL' => 'perl', 't/etc/shebang.php.xxx' => 'php', 't/etc/shebang.pl.xxx' => 'perl', 't/etc/shebang.py.xxx' => 'python', 't/etc/shebang.rb.xxx' => 'ruby', 't/etc/shebang.sh.xxx' => 'shell', 't/etc/buttonhook.xml.xxx' => 'xml', ); for my $filename ( sort keys %lookups ) { my $type = $lookups{$filename}; sets_match( [filetypes( $filename )], [ $type ], "Checking $filename" ); } } done_testing; sub populate_filetypes { my ( $type_lines, undef ) = run_ack_with_stderr('--help-types'); my @types_to_try; foreach my $line ( @{$type_lines} ) { if ( $line =~ /^\s+--\[no\](\w+)/ ) { push @types_to_try, $1; } } foreach my $type (@types_to_try) { my ( $filenames, undef ) = run_ack_with_stderr('-f', "--$type", 't/swamp', 't/etc'); foreach my $filename ( @{$filenames} ) { push @{ $types_for_file{$filename} }, $type; } } return; } # XXX Implement me with --show-types. sub filetypes { my $filename = reslash(shift); if ( !%types_for_file ) { populate_filetypes(); } return @{ $types_for_file{$filename} || [] }; } sub is_filetype { my ( $filename, $wanted_type ) = @_; for my $maybe_type ( filetypes( $filename ) ) { return 1 if $maybe_type eq $wanted_type; } return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/issue562.t�������������������������������������������������������������������������������0000644�0001750�0001750�00000000542�13216123637�012667� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 2; use File::Temp; use Util; prep_environment(); my $tempfile = File::Temp->new(); print {$tempfile} <<'HERE'; HERE close $tempfile; my @results = run_ack('^\s\s+$', $tempfile->filename); lists_match(\@results, [], '^\s\s+$ should never match a sequence of empty lines'); ��������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/context.t��������������������������������������������������������������������������������0000644�0001750�0001750�00000024552�13216123637�012775� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 36; use lib 't'; use Util; prep_environment(); # Checks also beginning of file. BEFORE: { my @expected = line_split( <<'HERE' ); I met a traveller from an antique land -- Stand in the desert... Near them, on the sand, Half sunk, a shattered visage lies, whose frown, HERE my $regex = 'a'; my @files = qw( t/text/ozymandias.txt ); my @args = ( '-w', '-B1', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex - before" ); } BEFORE_WITH_LINE_NO: { my $target_file = reslash( 't/text/ozymandias.txt' ); my @expected = line_split( <<"HERE" ); $target_file-1-I met a traveller from an antique land $target_file-2-Who said: Two vast and trunkless legs of stone $target_file:3:Stand in the desert... Near them, on the sand, -- $target_file-12-Nothing beside remains. Round the decay $target_file-13-Of that colossal wreck, boundless and bare $target_file:14:The lone and level sands stretch far away. HERE my $regex = 'sand'; my @files = qw( t/text/ozymandias.txt t/text/bill-of-rights.txt ); # So we don't pick up constitution.txt my @args = ( '--sort-files', '-B2', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex - before with line numbers" ); } # Checks also end of file. AFTER: { my @expected = line_split( <<'HERE' ); The lone and level sands stretch far away. HERE my $regex = 'sands'; my @files = qw( t/text/ozymandias.txt ); my @args = ( '-A2', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex - after" ); } # Context defaults to 2. CONTEXT_DEFAULT: { my @expected = line_split( <<'HERE' ); "Yes,"I said, "let us be gone." "For the love of God, Montresor!" "Yes," I said, "for the love of God!" HERE my $regex = 'Montresor'; my @files = qw( t/text/amontillado.txt ); my @args = ( '-w', '-C', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex - context defaults to 2" ); } # Try context 1. CONTEXT_ONE: { my @expected = line_split( <<"HERE" ); "For the love of God, Montresor!" HERE push( @expected, '' ); # Since split eats the last line. my $regex = 'Montresor'; my @files = qw( t/text/amontillado.txt ); my @args = ( '-w', '-C', 1, $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex - context=1" ); } # --context=0 means no context. CONTEXT_ONE: { my @expected = line_split( <<'HERE' ); "For the love of God, Montresor!" HERE my $regex = 'Montresor'; my @files = qw( t/text/amontillado.txt ); my @args = ( '-w', '-C', 0, $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex - context=0" ); } # -1 must not stop the ending context from displaying. CONTEXT_DEFAULT: { my @expected = line_split( <<"HERE" ); or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances. HERE my $regex = 'right'; my @files = qw( t/text/bill-of-rights.txt ); my @args = ( '-1', '-C1', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex with -1" ); } # -C with overlapping contexts (adjacent lines) CONTEXT_OVERLAPPING: { my @expected = line_split( <<"HERE" ); This is line 03 This is line 04 This is line 05 This is line 06 This is line 07 This is line 08 HERE my $regex = '05|06'; my @files = qw( t/text/numbered-text.txt ); my @args = ( '-C', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex with overlapping contexts" ); } # -C with contexts that touch. CONTEXT_ADJACENT: { my @expected = line_split( <<"HERE" ); This is line 01 This is line 02 This is line 03 This is line 04 This is line 05 This is line 06 This is line 07 This is line 08 This is line 09 This is line 10 HERE my $regex = '03|08'; my @files = qw( t/text/numbered-text.txt ); my @args = ( '-C', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex with contexts that touch" ); } # -C with contexts that just don't touch. CONTEXT_NONADJACENT: { my @expected = line_split( <<"HERE" ); This is line 01 This is line 02 This is line 03 This is line 04 This is line 05 -- This is line 07 This is line 08 This is line 09 This is line 10 This is line 11 HERE my $regex = '03|09'; my @files = qw( t/text/numbered-text.txt ); my @args = ( '-C', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex with contexts that just don't touch" ); } CONTEXT_OVERLAPPING_COLOR: { my $match_start = "\e[30;43m"; my $match_end = "\e[0m"; my $line_end = "\e[0m\e[K"; my @expected = line_split( <<"HERE" ); This is line 03 This is line 04 This is line ${match_start}05${match_end}${line_end} This is line ${match_start}06${match_end}${line_end} This is line 07 This is line 08 HERE my $regex = '05|06'; my @files = qw( t/text/numbered-text.txt ); my @args = ( '--color', '-C', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex with overlapping contexts" ); } CONTEXT_OVERLAPPING_COLOR_BEFORE: { my $match_start = "\e[30;43m"; my $match_end = "\e[0m"; my $line_end = "\e[0m\e[K"; my @expected = line_split( <<"HERE" ); This is line 03 This is line 04 This is line ${match_start}05${match_end}${line_end} This is line ${match_start}06${match_end}${line_end} HERE my $regex = '05|06'; my @files = qw( t/text/numbered-text.txt ); my @args = ( '--color', '-B2', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex with overlapping contexts" ); } CONTEXT_OVERLAPPING_COLOR_AFTER: { my $match_start = "\e[30;43m"; my $match_end = "\e[0m"; my $line_end = "\e[0m\e[K"; my @expected = line_split( <<"HERE" ); This is line ${match_start}05${match_end}${line_end} This is line ${match_start}06${match_end}${line_end} This is line 07 This is line 08 HERE my $regex = '05|06'; my @files = qw( t/text/numbered-text.txt ); my @args = ( '--color', '-A2', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex with overlapping contexts" ); } # -m3 should work properly and show only 3 matches with correct context # even though there is a 4th match in the after context of the third match # ("ratifying" in the last line) CONTEXT_MAX_COUNT: { my @expected = line_split( <<"HERE" ); ratified by the Legislatures of three fourths of the several States, or by Conventions in three fourths thereof, as the one or the other Mode of Ratification may be proposed by the Congress; Provided that no Amendment which may be made prior to the Year One thousand eight hundred and eight -- The Ratification of the Conventions of nine States, shall be sufficient for the Establishment of this Constitution between the States so ratifying HERE my $regex = 'ratif'; my @files = qw( t/text/constitution.txt ); my @args = ( '-i', '-m3', '-A1', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex with -m3" ); } # Highlighting works with context. HIGHLIGHTING: { my @ack_args = qw( wretch -i -C5 --color ); my @results = pipe_into_ack( 't/text/raven.txt', @ack_args ); my @escaped_lines = grep { /\e/ } @results; is( scalar @escaped_lines, 1, 'Only one line highlighted' ); is( scalar @results, 11, 'Expecting altogether 11 lines back' ); } # Grouping works with context (single file). GROUPING_SINGLE_FILE: { my $target_file = reslash( 't/etc/shebang.py.xxx' ); my @expected = line_split( <<"HERE" ); $target_file 1:#!/usr/bin/python HERE my $regex = 'python'; my @args = ( '--python', '--group', '-C', $regex ); ack_lists_match( [ @args ], \@expected, "Looking for $regex in Python files with grouping" ); } # Grouping works with context and multiple files. # i.e. a separator line between different matches in the same file and no separator between files GROUPING_MULTIPLE_FILES: { my @expected = line_split( <<'HERE' ); t/text/amontillado.txt 258-As I said these words I busied myself among the pile of bones of 259:which I have before spoken. Throwing them aside, I soon uncovered t/text/raven.txt 31-But the silence was unbroken, and the stillness gave no token, 32:And the only word there spoken was the whispered word, "Lenore?" -- 70- 71:Startled at the stillness broken by reply so aptly spoken, -- 114-"Get thee back into the tempest and the Night's Plutonian shore! 115:Leave no black plume as a token of that lie thy soul hath spoken! HERE my $regex = 'spoken'; my @files = qw( t/text/ ); my @args = ( '--group', '-B1', '--sort-files', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex in multiple files with grouping" ); } # See https://github.com/beyondgrep/ack2/issues/326 and links there for details. WITH_COLUMNS_AND_CONTEXT: { my @files = qw( t/text/ ); my @expected = line_split( <<'HERE' ); t/text/bill-of-rights.txt-1-# Amendment I t/text/bill-of-rights.txt-2- t/text/bill-of-rights.txt-3-Congress shall make no law respecting an establishment of religion, t/text/bill-of-rights.txt:4:60:or prohibiting the free exercise thereof; or abridging the freedom of t/text/bill-of-rights.txt-5-speech, or of the press; or the right of the people peaceably to assemble, t/text/bill-of-rights.txt-6-and to petition the Government for a redress of grievances. t/text/bill-of-rights.txt-7- t/text/bill-of-rights.txt-8-# Amendment II t/text/bill-of-rights.txt-9- -- t/text/gettysburg.txt-18-fought here have thus far so nobly advanced. It is rather for us to be t/text/gettysburg.txt-19-here dedicated to the great task remaining before us -- that from these t/text/gettysburg.txt-20-honored dead we take increased devotion to that cause for which they gave t/text/gettysburg.txt-21-the last full measure of devotion -- that we here highly resolve that t/text/gettysburg.txt-22-these dead shall not have died in vain -- that this nation, under God, t/text/gettysburg.txt:23:27:shall have a new birth of freedom -- and that government of the people, t/text/gettysburg.txt-24-by the people, for the people, shall not perish from the earth. HERE my $regex = 'freedom'; my @args = ( '--column', '-C5', '-H', '--sort-files', $regex ); ack_lists_match( [ @args, @files ], \@expected, "Looking for $regex" ); } ������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/file-permission.t������������������������������������������������������������������������0000644�0001750�0001750�00000005316�13215622023�014403� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T # Make sure ack can handle files it can't read. use warnings; use strict; use Test::More; use lib 't'; use Util; use File::Spec; use File::Copy; use File::Temp; use constant NTESTS => 6; plan skip_all => q{Can't be checked under Win32} if is_windows(); plan skip_all => q{Can't be run as root} if $> == 0; plan tests => NTESTS; prep_environment(); my $temp_dir = File::Temp::newdir('temp.XXXX', CLEANUP => 1, EXLOCK => 0, TMPDIR => 1); my $target = File::Spec->catfile( $temp_dir, 'foo' ); copy( $0, $target ) or die "Can't copy $0 to $target"; # Change permissions of this file to unreadable. my (undef, undef, $old_mode) = stat($target); chmod 0000, $target; my (undef, undef, $new_mode) = stat($target); sub o { return sprintf '%o', shift } SKIP: { skip q{Unable to modify test program's permissions}, NTESTS if $old_mode eq $new_mode; skip q{Program readable despite permission changes}, NTESTS if -r $target; isnt( o($new_mode), o($old_mode), "chmodded $target to be unreadable" ); # Execute a search on this file. check_with( 'regex 1', $target ); # --count takes a different execution path check_with( 'regex 2', '--count', $target, { expected_stdout => 1, } ); my($volume,$path) = File::Spec->splitpath($target); # Run another test on the directory containing the read only file. check_with( 'notinthere', $volume . $path ); # Change permissions back. my $rc = chmod $old_mode, $target; ok( $rc, "Succeeded chmodding $target to " . o($old_mode) ); my (undef, undef, $back_mode) = stat($target); is( o($back_mode), o($old_mode), "${target}'s are back to what we expect" ); } done_testing(); sub check_with { local $Test::Builder::Level = $Test::Builder::Level + 1; my ( @args ) = @_; return subtest "check_with( $args[0] )" => sub { plan tests => 4; my $opts = {}; foreach my $arg ( @args ) { if ( ref($arg) eq 'HASH' ) { $opts = $arg; } } @args = grep { ref ne 'HASH' } @args; my $expected_stdout = $opts->{expected_stdout} || 0; my ($stdout, $stderr) = run_ack_with_stderr( @args ); is( get_rc(), 1, 'Exit code 1 for no output for grep compatibility' ); # Should be 2 for best grep compatibility since there was an error but we agreed that wasn't required. is( scalar @{$stdout}, $expected_stdout, 'No normal output' ) or diag(explain($stdout)); is( scalar @{$stderr}, 1, 'One line of stderr output' ) or diag(explain($stderr)); # Don't check for exact text of warning, the message text depends on LC_MESSAGES like( $stderr->[0], qr/\Q$target\E:/, 'Warning message OK' ); }; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-pager.t������������������������������������������������������������������������������0000644�0001750�0001750�00000017273�13216123637�013145� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use File::Spec (); use File::Temp (); use Test::More; use lib 't'; use Util; if ( not has_io_pty() ) { plan skip_all => q{You need to install IO::Pty to run this test}; exit(0); } plan tests => 15; prep_environment(); NO_PAGER: { my @args = qw(--nocolor --sort-files -i nevermore t/text); my @expected = line_split( <<'HERE' ); t/text/raven.txt 55: Quoth the Raven, "Nevermore." 62: With such name as "Nevermore." 69: Then the bird said, "Nevermore." 76: Of 'Never -- nevermore.' 83: Meant in croaking "Nevermore." 90: She shall press, ah, nevermore! 97: Quoth the Raven, "Nevermore." 104: Quoth the Raven, "Nevermore." 111: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." 125: Shall be lifted--nevermore! HERE my @got = run_ack_interactive(@args); lists_match( \@got, \@expected, 'NO_PAGER' ); } PAGER: { my @args = qw(--nocolor --pager=./test-pager --sort-files -i nevermore t/text); my @expected = line_split( <<'HERE' ); t/text/raven.txt 55: Quoth the Raven, "Nevermore." 62: With such name as "Nevermore." 69: Then the bird said, "Nevermore." 76: Of 'Never -- nevermore.' 83: Meant in croaking "Nevermore." 90: She shall press, ah, nevermore! 97: Quoth the Raven, "Nevermore." 104: Quoth the Raven, "Nevermore." 111: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." 125: Shall be lifted--nevermore! HERE my @got = run_ack_interactive(@args); lists_match( \@got, \@expected, 'PAGER' ); } PAGER_WITH_OPTS: { my @args = ('--nocolor', '--pager=./test-pager --skip=2', '--sort-files', '-i', 'nevermore', 't/text'); my @expected = line_split( <<'HERE' ); t/text/raven.txt 62: With such name as "Nevermore." 76: Of 'Never -- nevermore.' 90: She shall press, ah, nevermore! 104: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." HERE my @got = run_ack_interactive(@args); lists_match( \@got, \@expected, 'PAGER_WITH_OPTS' ); } FORCE_NO_PAGER: { my @args = ('--nocolor', '--pager=./test-pager --skip=2', '--nopager', '--sort-files', '-i', 'nevermore', 't/text'); my @expected = line_split( <<'HERE' ); t/text/raven.txt 55: Quoth the Raven, "Nevermore." 62: With such name as "Nevermore." 69: Then the bird said, "Nevermore." 76: Of 'Never -- nevermore.' 83: Meant in croaking "Nevermore." 90: She shall press, ah, nevermore! 97: Quoth the Raven, "Nevermore." 104: Quoth the Raven, "Nevermore." 111: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." 125: Shall be lifted--nevermore! HERE my @got = run_ack_interactive(@args); lists_match( \@got, \@expected, 'FORCE_NO_PAGER' ); } PAGER_ENV: { local $ENV{'ACK_PAGER'} = './test-pager --skip=2'; local $TODO = q{Setting ACK_PAGER in tests won't work for the time being}; my @args = ('--nocolor', '--sort-files', '-i', 'nevermore', 't/text'); my @expected = line_split( <<'HERE' ); t/text/raven.txt 62: With such name as "Nevermore." 76: Of 'Never -- nevermore.' 90: She shall press, ah, nevermore! 104: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." HERE my @got = run_ack_interactive(@args); lists_match( \@got, \@expected, 'PAGER_ENV' ); } PAGER_ENV_OVERRIDE: { local $ENV{'ACK_PAGER'} = './test-pager --skip=2'; my @args = ('--nocolor', '--nopager', '--sort-files', '-i', 'nevermore', 't/text'); my @expected = line_split( <<'HERE' ); t/text/raven.txt 55: Quoth the Raven, "Nevermore." 62: With such name as "Nevermore." 69: Then the bird said, "Nevermore." 76: Of 'Never -- nevermore.' 83: Meant in croaking "Nevermore." 90: She shall press, ah, nevermore! 97: Quoth the Raven, "Nevermore." 104: Quoth the Raven, "Nevermore." 111: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." 125: Shall be lifted--nevermore! HERE my @got = run_ack_interactive(@args); lists_match( \@got, \@expected, 'PAGER_ENV_OVERRIDE' ); } PAGER_ACKRC: { my @args = ('--nocolor', '--sort-files', '-i', 'nevermore', 't/text'); my $ackrc = <<'HERE'; --pager=./test-pager --skip=2 HERE my @expected = line_split( <<'HERE' ); t/text/raven.txt 62: With such name as "Nevermore." 76: Of 'Never -- nevermore.' 90: She shall press, ah, nevermore! 104: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." HERE my @got = run_ack_interactive(@args, { ackrc => \$ackrc, }); lists_match( \@got, \@expected, 'PAGER_ACKRC' ); } PAGER_ACKRC_OVERRIDE: { my @args = ('--nocolor', '--nopager', '--sort-files', '-i', 'nevermore', 't/text'); my $ackrc = <<'HERE'; --pager=./test-pager --skip=2 HERE my @expected = line_split( <<'HERE' ); t/text/raven.txt 55: Quoth the Raven, "Nevermore." 62: With such name as "Nevermore." 69: Then the bird said, "Nevermore." 76: Of 'Never -- nevermore.' 83: Meant in croaking "Nevermore." 90: She shall press, ah, nevermore! 97: Quoth the Raven, "Nevermore." 104: Quoth the Raven, "Nevermore." 111: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." 125: Shall be lifted--nevermore! HERE my @got = run_ack_interactive(@args, { ackrc => \$ackrc, }); lists_match( \@got, \@expected, 'PAGER_ACKRC_OVERRIDE' ); } PAGER_NOENV: { local $ENV{'ACK_PAGER'} = './test-pager --skip=2'; my @args = ('--nocolor', '--noenv', '--sort-files', '-i', 'nevermore', 't/text'); my @expected = line_split( <<'HERE' ); t/text/raven.txt 55: Quoth the Raven, "Nevermore." 62: With such name as "Nevermore." 69: Then the bird said, "Nevermore." 76: Of 'Never -- nevermore.' 83: Meant in croaking "Nevermore." 90: She shall press, ah, nevermore! 97: Quoth the Raven, "Nevermore." 104: Quoth the Raven, "Nevermore." 111: Quoth the Raven, "Nevermore." 118: Quoth the Raven, "Nevermore." 125: Shall be lifted--nevermore! HERE my @got = run_ack_interactive(@args); lists_match( \@got, \@expected, 'PAGER_NOENV' ); } my $wd = getcwd_clean(); my $tempdir = File::Temp->newdir; my $pager = File::Spec->rel2abs('test-pager'); safe_mkdir( File::Spec->catdir($tempdir->dirname, 'subdir') ); PROJECT_ACKRC_PAGER_FORBIDDEN: { my @files = untaint( File::Spec->rel2abs('t/text/') ); my @args = qw/ --env question(\\S+) /; safe_chdir( $tempdir->dirname ); write_file '.ackrc', "--pager=$pager\n"; my ( $stdout, $stderr ) = run_ack_with_stderr(@args, @files); is_empty_array( $stdout ); first_line_like( $stderr, qr/\QOptions --output, --pager and --match are forbidden in project .ackrc files/ ); safe_chdir( $wd ); } HOME_ACKRC_PAGER_PERMITTED: { my @files = untaint( File::Spec->rel2abs('t/text/') ); my @args = qw/ --env question(\\S+) /; write_file(File::Spec->catfile($tempdir->dirname, '.ackrc'), "--pager=$pager\n"); safe_chdir( File::Spec->catdir($tempdir->dirname, 'subdir') ); local $ENV{'HOME'} = $tempdir->dirname; my ( $stdout, $stderr ) = run_ack_with_stderr(@args, @files); is_nonempty_array( $stdout ); is_empty_array( $stderr ); safe_chdir( $wd ); } ACKRC_ACKRC_PAGER_PERMITTED: { my @files = untaint( File::Spec->rel2abs('t/text/') ); my @args = qw/ --env question(\\S+) /; write_file(File::Spec->catfile($tempdir->dirname, '.ackrc'), "--pager=$pager\n"); safe_chdir( File::Spec->catdir($tempdir->dirname, 'subdir') ); local $ENV{'ACKRC'} = File::Spec->catfile($tempdir->dirname, '.ackrc'); my ( $stdout, $stderr ) = run_ack_with_stderr(@args, @files); is_nonempty_array( $stdout ); is_empty_array( $stderr ); safe_chdir( $wd ); } done_testing(); exit 0; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/longopts.t�������������������������������������������������������������������������������0000644�0001750�0001750�00000007032�13213402177�013144� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; =head1 DESCRIPTION This tests whether ack's command line options work as expected. =cut use Test::More; # --no-recurse is inconsistent w/--nogroup plan tests => 38; use lib 't'; use Util; prep_environment(); my $swamp = 't/swamp'; my $ack = './ack'; # Help for my $arg ( qw( --help ) ) { my @args = ($arg); my $results = run_ack( @args ); like( $results, qr{ ^Usage: .* Example: }xs, qq{$arg output is correct} ); } # Version for my $arg ( qw( --version ) ) { my @args = ($arg); my $results = run_ack( @args ); like( $results, qr{ ^ack .* Copyright }xs, qq{$arg output is correct} ); } # Ignore case for my $arg ( qw( -i --ignore-case ) ) { my @args = ( $arg, 'upper case' ); my @files = ( 't/swamp/options.pl' ); my $results = run_ack( @args, @files ); like( $results, qr{UPPER CASE}, qq{$arg works correctly for ascii} ); } SMART_CASE: { my @files = 't/swamp/options.pl'; my $opt = '--smart-case'; like( +run_ack( $opt, 'upper case', @files ), qr{UPPER CASE}, qq{$opt turn on ignore-case when PATTERN has no upper} ); unlike( +run_ack( $opt, 'Upper case', @files ), qr{UPPER CASE}, qq{$opt does nothing when PATTERN has upper} ); like( +run_ack( $opt, '-i', 'UpPer CaSe', @files ), qr{UPPER CASE}, qq{-i overrides $opt, forcing ignore case, even when PATTERN has upper} ); } # Invert match # This test was changed from using unlike to using like because # old versions of Test::More::unlike (before 0.48_2) cannot # work with multiline output (which ack produces in this case). for my $arg ( qw( -v --invert-match ) ) { my @args = ( $arg, 'use warnings' ); my @files = qw( t/swamp/options.pl ); my $results = run_ack( @args, @files ); like( $results, qr{use strict;\n\n=head1 NAME}, # no 'use warnings' in between here qq{$arg works correctly} ); } # Word regexp for my $arg ( qw( -w --word-regexp ) ) { my @args = ( $arg, 'word' ); my @files = qw( t/swamp/options.pl ); my $results = run_ack( @args, @files ); like( $results, qr{ word }, qq{$arg ignores non-words} ); unlike( $results, qr{notaword}, qq{$arg ignores non-words} ); } # Literal for my $arg ( qw( -Q --literal ) ) { my @args = ( $arg, '[abc]' ); my @files = qw( t/swamp/options.pl ); my $results = run_ack( @args, @files ); like( $results, qr{\Q[abc]\E}, qq{$arg matches a literal string} ); } my $expected = reslash( 't/swamp/options.pl' ); # Files with matches for my $arg ( qw( -l --files-with-matches ) ) { my @args = ( $arg, 'use strict' ); my @files = qw( t/swamp/options.pl ); my $results = run_ack( @args, @files ); like( $results, qr{\Q$expected}, qq{$arg prints matching files} ); } # Files without match for my $arg ( qw( -L --files-without-matches ) ) { my @args = ( $arg, 'use snorgledork' ); my @files = qw( t/swamp/options.pl ); my $results = run_ack( @args, @files ); like( $results, qr{\Q$expected}, qq{$arg prints matching files} ); } LINE: { my @files = 't/swamp/options.pl'; my $opt = '--line=1'; my @lines = run_ack( $opt, @files ); is_deeply( \@lines, ['#!/usr/bin/env perl'], 'Only one matching line should be a shebang' ); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-type-del.t���������������������������������������������������������������������������0000644�0001750�0001750�00000003052�13213376747�013571� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use Test::More tests => 12; use lib 't'; use Util; prep_environment(); my ( $stdout, $stderr ); my $help_types_output; # sanity check ( $stdout, $stderr ) = run_ack_with_stderr('--perl', '-f', 't/swamp'); is( scalar(@{$stdout}), 11, 'Found initial 11 files' ); is_empty_array( $stderr, 'Nothing in stderr' ); ( $stdout, $stderr ) = run_ack_with_stderr('--type-del=perl', '--type-del=perltest', '--perl', '-f', 't/swamp'); is_empty_array( $stdout, 'Nothing in stdout' ); first_line_like( $stderr, qr/Unknown option: perl/ ); ( $stdout, $stderr ) = run_ack_with_stderr('--type-del=perl', '--type-del=perltest', '--type-add=perl:ext:pm', '--perl', '-f', 't/swamp'); is( scalar(@{$stdout}), 1, 'Got one output line' ); is_empty_array( $stderr, 'Nothing in stderr' ); # more sanity checking $help_types_output = run_ack( '--help-types' ); like( $help_types_output, qr/\Q--[no]perl/ ); $help_types_output = run_ack( '--type-del=perl', '--type-del=perltest', '--help-types' ); unlike( $help_types_output, qr/\Q--[no]perl/ ); DUMP: { my @dump_output = run_ack( '--type-del=perl', '--type-del=perltest', '--dump' ); # discard everything up to the ARGV section while(@dump_output && $dump_output[0] ne 'ARGV') { shift @dump_output; } shift @dump_output; # discard ARGV shift @dump_output; # discard header foreach my $line (@dump_output) { $line =~ s/^\s+|\s+$//g; } lists_match( \@dump_output, ['--type-del=perl', '--type-del=perltest'], '--type-del should show up in --dump output' ); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-passthru.t���������������������������������������������������������������������������0000644�0001750�0001750�00000005260�13216123637�013711� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 6; use lib 't'; use Util; prep_environment(); my @full_speech = <DATA>; chomp @full_speech; NORMAL: { my @expected = line_split( <<'HERE' ); Now we are engaged in a great civil war, testing whether that nation, on a great battle-field of that war. We have come to dedicate a portion HERE my @files = qw( t/text/gettysburg.txt ); my @args = qw( war ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Search for war' ); } DASH_C: { my @expected = @full_speech; my @files = qw( t/text/gettysburg.txt ); my @args = qw( war --passthru ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, q{Still lookin' for war, in passthru mode} ); } SKIP: { skip 'Input options have not been implemented for Win32 yet', 2 if is_windows(); # Some lines will match, most won't. my @ack_args = qw( war --passthru --color ); my @results = pipe_into_ack( 't/text/gettysburg.txt', @ack_args ); is( scalar @results, scalar @full_speech, 'Got all the lines back' ); my @escaped_lines = grep { /\e/ } @results; is( scalar @escaped_lines, 2, 'Only two lines are highlighted' ); } __DATA__ Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-i.t����������������������������������������������������������������������������������0000644�0001750�0001750�00000001101�13213376747�012267� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use Util; use Test::More tests => 4; prep_environment(); my @expected = ( 't/swamp/groceries/fruit:1:apple', 't/swamp/groceries/junk:1:apple fritters', ); my @targets = map { "t/swamp/groceries/$_" } qw/fruit junk meat/; my @args = ( qw( --nocolor APPLE -i ), @targets ); my @results = run_ack( @args ); lists_match( \@results, \@expected, '-i flag' ); @args = ( qw( --nocolor APPLE --ignore-case ), @targets ); @results = run_ack( @args ); lists_match( \@results, \@expected, '--ignore-case flag' ); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/etc/�������������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�13217305507�011666� 5����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/etc/shebang.foobar.xxx�������������������������������������������������������������������0000644�0001750�0001750�00000000022�12726365114�015313� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/foobar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/etc/shebang.rb.xxx�����������������������������������������������������������������������0000644�0001750�0001750�00000000020�12726365114�014444� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/ruby ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/etc/shebang.pl.xxx�����������������������������������������������������������������������0000644�0001750�0001750�00000000152�12726365114�014462� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl # NOTE: This must stay a very short file so that C<-B $open_fh> will # think it's binary. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/etc/shebang.sh.xxx�����������������������������������������������������������������������0000644�0001750�0001750�00000000016�12726365114�014460� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/sh ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/etc/buttonhook.xml.xxx�������������������������������������������������������������������0000644�0001750�0001750�00000000473�12726365114�015442� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <children name="" colour="#AAAAAA" size="61988"> <children name="A" colour="#CCCC00" size="41720"> <children name="1A" colour="#CCCC00" size="1934"> <children name="W1MX" colour="#FFFFFF" size="1934" /> </children> </children> </children> </children> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/etc/shebang.py.xxx�����������������������������������������������������������������������0000644�0001750�0001750�00000000022�12726365114�014473� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/python ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/etc/shebang.empty.xxx��������������������������������������������������������������������0000644�0001750�0001750�00000000000�12726365114�015175� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/etc/shebang.php.xxx����������������������������������������������������������������������0000644�0001750�0001750�00000000017�12726365114�014636� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/php �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-removed-options.t��������������������������������������������������������������������0000644�0001750�0001750�00000001212�13213376747�015174� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use Test::More; use lib 't'; use Util; prep_environment(); my @options = (qw{ -a --all -u }, ['-G', 'sue']); plan tests => scalar @options; foreach my $option (@options) { my @args = ref($option) ? @{$option} : ( $option ); $option = $option->[0] if ref($option); push @args, 'the', 't/text'; my ( $stdout, $stderr ) = run_ack_with_stderr( @args ); subtest "options = @args" => sub { plan tests => 2; is_empty_array( $stdout, 'Nothing in stdout' ); like( $stderr->[0], qr/Option '$option' is not valid in ack 2/, 'Found error message' ); }; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-filetypes.t��������������������������������������������������������������������������0000644�0001750�0001750�00000001337�13213376747�014056� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use Test::More; use lib 't'; use Util; prep_environment(); my @filetypes = qw( actionscript ada asm batch cc cfmx clojure coffeescript cpp csharp css delphi elisp erlang fortran go groovy gsp haskell hh html java js json jsp less lisp lua make objc objcpp ocaml parrot perl php plone python rake rst ruby rust sass scala scheme shell smalltalk sql swift tcl tex tt vb verilog vhdl vim xml yaml ); plan tests => scalar(@filetypes); foreach my $filetype ( @filetypes ) { my @args = ( '-f', "--$filetype" ); my ( undef, $stderr ) = run_ack_with_stderr( @args ); # Throw away stdout. We don't care. is_empty_array( $stderr, "--$filetype should print no errors" ); } done_testing(); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/highlighting.t���������������������������������������������������������������������������0000644�0001750�0001750�00000005215�13213376747�013762� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use warnings; use strict; use Test::More tests => 6; use lib 't'; use Util; use Term::ANSIColor; prep_environment(); my @HIGHLIGHT = qw( --color --group --sort-files ); BASIC: { my @args = qw( --sort-files Montresor t/text/ ); my $expected_original = <<'END'; <t/text/amontillado.txt> {99}:the catacombs of the (Montresor)s. {152}:"The (Montresor)s," I replied, "were a great and numerous family." {309}:"For the love of God, (Montresor)!" END $expected_original = windows_slashify( $expected_original ) if is_windows; my @expected = colorize( $expected_original ); my @results = run_ack( @args, @HIGHLIGHT ); is_deeply( \@results, \@expected, 'Basic highlights match' ); } METACHARACTERS: { my @args = qw( --sort-files \w*rave\w* t/text/ ); my $expected_original = <<'END'; <t/text/gettysburg.txt> {13}:we can not hallow -- this ground. The (brave) men, living and dead, who <t/text/ozymandias.txt> {1}:I met a (traveller) from an antique land <t/text/raven.txt> {51}:By the (grave) and stern decorum of the countenance it wore, {52}:"Though thy crest be shorn and shaven, thou," I said, "art sure no (craven), END $expected_original = windows_slashify( $expected_original ) if is_windows; my @expected = colorize( $expected_original ); my @results = run_ack( @args, @HIGHLIGHT ); is_deeply( \@results, \@expected, 'Metacharacters match' ); } CONTEXT: { my @args = qw( --sort-files free -C1 t/text/ ); my $expected_original = <<'END'; <t/text/bill-of-rights.txt> {3}-Congress shall make no law respecting an establishment of religion, {4}:or prohibiting the (free) exercise thereof; or abridging the (free)dom of {5}-speech, or of the press; or the right of the people peaceably to assemble, -- {9}- {10}:A well regulated Militia, being necessary to the security of a (free) State, {11}-the right of the people to keep and bear Arms, shall not be infringed. <t/text/constitution.txt> {31}-respective Numbers, which shall be determined by adding to the whole {32}:Number of (free) Persons, including those bound to Service for a Term {33}-of Years, and excluding Indians not taxed, three fifths of all other <t/text/gettysburg.txt> {22}-these dead shall not have died in vain -- that this nation, under God, {23}:shall have a new birth of (free)dom -- and that government of the people, {24}-by the people, for the people, shall not perish from the earth. END $expected_original = windows_slashify( $expected_original ) if is_windows; my @expected = colorize( $expected_original ); my @results = run_ack( @args, @HIGHLIGHT ); is_deeply( \@results, \@expected, 'Context is all good' ); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/is-filter.t������������������������������������������������������������������������������0000644�0001750�0001750�00000000346�13213376747�013213� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use lib 't'; use FilterTest; use Test::More tests => 1; use App::Ack::Filter::Is; filter_test( [ is => 'Makefile' ], [ 't/swamp/Makefile' ], 'Only Makefile should be matched' ); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/ack-n.t����������������������������������������������������������������������������������0000644�0001750�0001750�00000003375�13213376747�012313� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -T use strict; use warnings; use Test::More tests => 10; use lib 't'; use Util; my $expected_norecurse = <<'END'; t/swamp/groceries/fruit:1:apple t/swamp/groceries/junk:1:apple fritters END my $expected_recurse = <<'END'; t/swamp/groceries/another_subdir/fruit:1:apple t/swamp/groceries/another_subdir/junk:1:apple fritters t/swamp/groceries/dir.d/fruit:1:apple t/swamp/groceries/dir.d/junk:1:apple fritters t/swamp/groceries/fruit:1:apple t/swamp/groceries/junk:1:apple fritters t/swamp/groceries/subdir/fruit:1:apple t/swamp/groceries/subdir/junk:1:apple fritters END chomp $expected_norecurse; chomp $expected_recurse; if ( is_windows() ) { $expected_norecurse =~ s{/}{\\}g; $expected_recurse =~ s{/}{\\}g; } my @args; my $lines; prep_environment(); # We sort to ensure deterministic results. @args = ('-n', '--sort-files', 'apple', 't/swamp/groceries'); $lines = run_ack(@args); lists_match $lines, $expected_norecurse, '-n should disable recursion'; @args = ('--no-recurse', '--sort-files', 'apple', 't/swamp/groceries'); $lines = run_ack(@args); lists_match $lines, $expected_norecurse, '--no-recurse should disable recursion'; # Make sure that re-enabling recursion works. @args = ('-n', '-r', '--sort-files', 'apple', 't/swamp/groceries'); $lines = run_ack(@args); lists_match $lines, $expected_recurse, '-r after -n should re-enable recursion'; @args = ('--no-recurse', '-R', '--sort-files', 'apple', 't/swamp/groceries'); $lines = run_ack(@args); lists_match $lines, $expected_recurse, '-R after --no-recurse should re-enable recursion'; @args = ('--no-recurse', '--recurse', '--sort-files', 'apple', 't/swamp/groceries'); $lines = run_ack(@args); lists_match $lines, $expected_recurse, '--recurse after --no-recurse should re-enable recursion'; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/swamp/�����������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�13217305507�012242� 5����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/swamp/notaRakefile�����������������������������������������������������������������������0000644�0001750�0001750�00000000220�12726365114�014567� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is just a plain old textfile that has a name that looks like "Rakefile" but indeed is not. However, it should not match --rake or --ruby. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/swamp/MasterPage.master������������������������������������������������������������������0000644�0001750�0001750�00000000123�12726365114�015507� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<%@ Master AutoEventWireup="true" CodeFile="MasterPage.master.cs" Language="C#" %> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/swamp/perl.pod���������������������������������������������������������������������������0000644�0001750�0001750�00000000077�12726365114�013720� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=head1 Dummy document =head2 There's important stuff in here! �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/swamp/CMakeLists.txt���������������������������������������������������������������������0000644�0001750�0001750�00000000035�12726365114�015004� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Not actually a cmake file! ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ack-2.22/t/swamp/html.html��������������������������������������������������������������������������0000644�0001750�0001750�00000000246�12726365114�014102� 0����������������������������������������������������������������������������������������������������ustar �andy����������������������������andy�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE html PUBLIC "-//w3c//dtd html 3.2//en"> <html><head><title>Boring test file

but trying to be conforming anyway

ack-2.22/t/swamp/Sample.ascx0000644000175000017500000000014612726365114014350 0ustar andyandy<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Sample.ascx.cs" %>

Sample Control!

ack-2.22/t/swamp/perl.handler.pod0000644000175000017500000000002712726365114015327 0ustar andyandy=head1 I'm Here! =cut ack-2.22/t/swamp/sample.asp0000644000175000017500000000020612726365114014232 0ustar andyandy ASP Example <% Response.Write "Hello!" %> ack-2.22/t/swamp/service.svc0000644000175000017500000000007112726365114014421 0ustar andyandy<%@ ServiceHost Language="C#" Service="SampleService" %> ack-2.22/t/swamp/html.htm0000644000175000017500000000034012726365114013721 0ustar andyandy Boring test file

but trying to be conforming anyway

ack-2.22/t/swamp/perl-test.t0000644000175000017500000000024312726365114014351 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 1; BEGIN { use_ok( 'App::Ack' ); } diag( "Testing App::Ack $App::Ack::VERSION, Perl $], $^X" ); ack-2.22/t/swamp/sample.aspx0000644000175000017500000000037312726365114014427 0ustar andyandy<% example.Text = "Example"; %> Sample ASP.Net Page
ack-2.22/t/swamp/javascript.js0000644000175000017500000000016612726365114014755 0ustar andyandy// JavaScript goodness // Files and directory structures var cssDir = "./Stylesheets/"; var NS4CSS = "wango.css"; ack-2.22/t/swamp/Makefile.PL0000644000175000017500000000024312726365114014217 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 1; BEGIN { use_ok( 'App::Ack' ); } diag( "Testing App::Ack $App::Ack::VERSION, Perl $], $^X" ); ack-2.22/t/swamp/file.bar0000644000175000017500000000002412726365114013647 0ustar andyandyThis is a bar file. ack-2.22/t/swamp/parrot.pir0000644000175000017500000000266512726365114014302 0ustar andyandy=head1 INFORMATION This example shows the usage of C. =head1 FUNCTIONS =over 4 =item _main =cut .sub _main :main .local pmc stream load_bytecode "library/Stream/Sub.pir" load_bytecode "library/Stream/Replay.pir" find_type $I0, "Stream::Sub" new $P0, $I0 # set the stream's source sub .const .Sub temp = "_hello" assign $P0, $P1 find_type $I0,"Stream::Replay" stream = new $I0 assign stream, $P0 $S0 = stream."read_bytes"( 3 ) print "'hel': [" print $S0 print "]\n" stream = clone stream $P0 = clone stream $S0 = stream."read_bytes"( 4 ) print "'lowo': [" print $S0 print "] = " $S0 = $P0."read_bytes"( 4 ) print "[" print $S0 print "]\n" $S0 = stream."read"() print "'rld!': [" print $S0 print "]\n" $S0 = stream."read_bytes"( 100 ) print "'parrotis cool': [" print $S0 print "]\n" end .end =item _hello This sub is used as the source for the stream. It just writes some text to the stream. =cut .sub _hello :method self."write"( "hello" ) self."write"( "world!" ) self."write"( "parrot" ) self."write"( "is cool" ) .end =back =head1 AUTHOR Jens Rieks Eparrot at jensbeimsurfen dot deE is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list. =head1 COPYRIGHT Copyright (C) 2004, The Perl Foundation. =cut ack-2.22/t/swamp/notaMakefile0000644000175000017500000000020612726365114014566 0ustar andyandyThis is just a plain old textfile that has a name that looks like "Makefile" but indeed is not. However, it should not match --make. ack-2.22/t/swamp/fresh.css.min0000644000175000017500000011534012726365114014655 0ustar andyandyhtml,.wp-dialog{background-color:#fff;}* html input,* html .widget{border-color:#dfdfdf;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#F9F9F9;}#postcustomstuff thead th{background-color:#F1F1F1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#f9f9f9;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,.wp-tab-panel,ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-color:#dfdfdf;background-color:#fff;}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{background-color:#fff;}input.disabled,textarea.disabled{background-color:#ccc;}#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3,.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head,.sidebar-name,#nav-menu-header,#nav-menu-footer,.menu-item-handle,#fullscreen-topbar{background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec);}.widget .widget-top,.postbox h3,.stuffbox h3{border-bottom-color:#dfdfdf;text-shadow:#fff 0 1px 0;-moz-box-shadow:0 1px 0 #fff;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#464646;}.wrap .add-new-h2{background:#f1f1f1;}.subtitle{color:#777;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alternate,.alt{background-color:#fcfcfc;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}div.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}div.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#DFDFDF;}.highlight{background-color:#e4f2fd;color:#000;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#bbb;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#298cba;font-weight:bold;color:#fff;background:#21759B url(../images/button-grad.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#13455b;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#9FD0D5!important;background:#298CBA!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#side-sortables .category-tabs .tabs a,#side-sortables .add-menu-item-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}div.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#B8D3E2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th{border-top-color:#fff;border-bottom-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat td{color:#555;}.widefat p,.widefat ol,.widefat ul{color:#333;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;}th.sortable a:hover,th.sortable a:active,th.sortable a:focus{color:#333;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#21759b;}#adminmenu .awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow{background-color:#464646;color:#fff;-moz-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-khtml-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0;}#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li.current a .awaiting-mod,#adminmenu li a.wp-has-current-submenu .update-plugins{background-color:#464646;color:#fff;-moz-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-khtml-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on,.submitted-on{color:#777;}.login #nav a,.login #backtoblog a{color:#21759b!important;}.login #nav a:hover,.login #backtoblog a:hover{color:#d54e21!important;}#footer{color:#777;border-color:#dfdfdf;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fcfcfc;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#f4f4f4;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.widget,#widget-list .widget-top,.postbox,.menu-item-settings{background-color:#f5f5f5;background-image:-ms-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:-moz-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:-o-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#f5f5f5));background-image:-webkit-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:linear-gradient(top,#f9f9f9,#f5f5f5);}.postbox h3{color:#464646;}.widget .widget-top{color:#222;}.sidebar-name:hover h3,.postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag,.update-nag{background-color:#FFFBCC;border-color:#E6DB55;color:#555;}.login #backtoblog a{color:#464646;}#wphead{border-bottom:#dfdfdf 1px solid;}#wphead h1 a{color:#464646;}#user_info{color:#555;}#user_info:hover,#user_info.active{color:#222;}#user_info.active{background-color:#f1f1f1;background-image:-ms-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:-moz-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:-o-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:-webkit-gradient(linear,left bottom,left top,from(#e9e9e9),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:linear-gradient(bottom,#e9e9e9,#f9f9f9);border-color:#aaa #aaa #dfdfdf;}#user_info_arrow{background:transparent url(../images/arrows.png) no-repeat 6px 5px;}#user_info:hover #user_info_arrow,#user_info.active #user_info_arrow{background:transparent url(../images/arrows-dark.png) no-repeat 6px 5px;}#user_info_links{-moz-box-shadow:0 3px 2px -2px rgba(0,0,0,0.2);-webkit-box-shadow:0 3px 2px -2px rgba(0,0,0,0.2);box-shadow:0 3px 2px -2px rgba(0,0,0,0.2);}#user_info_links ul{background:#f1f1f1;border-color:#ccc #aaa #aaa;-moz-box-shadow:inset 0 1px 0 #f9f9f9;-webkit-box-shadow:inset 0 1px 0 #f9f9f9;box-shadow:inset 0 1px 0 #f9f9f9;}#user_info_links li:hover{background-color:#dfdfdf;}#user_info_links li:hover a,#user_info_links li a:hover{text-decoration:none;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{text-decoration:none;}#footer a:hover{color:#000;text-decoration:underline;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#ccc;background-color:#dfdfdf;background-image:url("../images/ed-bg.gif");}#ed_toolbar input{border-color:#C3C3C3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#dfdfdf;}#poststuff .wp_themeSkin .mceStatusbar *{color:#555;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f1f1f1;border-color:#dfdfdf #dfdfdf #ccc;color:#999;}#poststuff #editor-toolbar .active{border-color:#ccc #ccc #e9e9e9;background-color:#e9e9e9;color:#333;}#post-status-info{background-color:#EDEDED;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin table.mceLayout{border-color:#ccc #ccc #dfdfdf;}#editorcontainer #content,#editorcontainer .wp_themeSkin .mceIframeContainer{-moz-box-shadow:inset 1px 1px 2px rgba(0,0,0,0.1);-webkit-box-shadow:inset 1px 1px 2px rgba(0,0,0,0.1);box-shadow:inset 1px 1px 2px rgba(0,0,0,0.1);}.wp_themeSkin iframe{background:transparent;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{border-color:#ccc;background-color:#eee;background-image:-ms-linear-gradient(bottom,#ddd,#fff);background-image:-moz-linear-gradient(bottom,#ddd,#fff);background-image:-o-linear-gradient(bottom,#ddd,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#fff));background-image:-webkit-linear-gradient(bottom,#ddd,#fff);background-image:linear-gradient(bottom,#ddd,#fff);}.wp_themeSkin a.mceButtonEnabled:hover{border-color:#a0a0a0;background:#ddd;background-image:-ms-linear-gradient(bottom,#ccc,#fff);background-image:-moz-linear-gradient(bottom,#ccc,#fff);background-image:-o-linear-gradient(bottom,#ccc,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(bottom,#ccc,#fff);background-image:linear-gradient(bottom,#ccc,#fff);}.wp_themeSkin a.mceButton:active,.wp_themeSkin a.mceButtonEnabled:active,.wp_themeSkin a.mceButtonSelected:active,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonActive:active,.wp_themeSkin a.mceButtonActive:hover{background-color:#ddd;background-image:-ms-linear-gradient(bottom,#eee,#bbb);background-image:-moz-linear-gradient(bottom,#eee,#bbb);background-image:-o-linear-gradient(bottom,#eee,#bbb);background-image:-webkit-gradient(linear,left bottom,left top,from(#eee),to(#bbb));background-image:-webkit-linear-gradient(bottom,#eee,#bbb);background-image:linear-gradient(bottom,#eee,#bbb);border-color:#909090;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#ccc;background-color:#eee;background-image:-ms-linear-gradient(bottom,#ddd,#fff);background-image:-moz-linear-gradient(bottom,#ddd,#fff);background-image:-o-linear-gradient(bottom,#ddd,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#fff));background-image:-webkit-linear-gradient(bottom,#ddd,#fff);background-image:linear-gradient(bottom,#ddd,#fff);}.wp_themeSkin .mceListBox .mceOpen{border-left:0!important;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxHover:active .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText,.wp_themeSkin table.mceListBoxEnabled:active .mceText{background:#ccc;border-color:#999;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText,.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen{border-color:#909090;background-color:#eee;background-image:-ms-linear-gradient(bottom,#ccc,#fff);background-image:-moz-linear-gradient(bottom,#ccc,#fff);background-image:-o-linear-gradient(bottom,#ccc,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(bottom,#ccc,#fff);background-image:linear-gradient(bottom,#ccc,#fff);}.wp_themeSkin select.mceListBox{border-color:#B2B2B2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#ccc;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{border-color:#909090;}.wp_themeSkin table.mceSplitButton td{background-color:#eee;background-image:-ms-linear-gradient(bottom,#ddd,#fff);background-image:-moz-linear-gradient(bottom,#ddd,#fff);background-image:-o-linear-gradient(bottom,#ddd,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#fff));background-image:-webkit-linear-gradient(bottom,#ddd,#fff);background-image:linear-gradient(bottom,#ddd,#fff);}.wp_themeSkin table.mceSplitButton:hover td{background-image:-ms-linear-gradient(bottom,#ccc,#fff);background-image:-moz-linear-gradient(bottom,#ccc,#fff);background-image:-o-linear-gradient(bottom,#ccc,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(bottom,#ccc,#fff);background-image:linear-gradient(bottom,#ccc,#fff);}.wp_themeSkin .mceSplitButtonActive{background-color:#B2B2B2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0A246A;background-color:#B6BDD2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0A246A;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}.wp_themeSkin tr.mceFirst td.mceToolbar{background:#dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top;border-color:#ccc;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:3px 0 0 0;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:3px;-khtml-border-top-right-radius:3px;-webkit-border-top-right-radius:3px;-moz-border-radius:0 3px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#titlediv #title{border-color:#ccc;}#editorcontainer{border-color:#ccc #ccc #dfdfdf;}#post-status-info{border-color:#dfdfdf #ccc #ccc;}.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#ddd;}#adminmenuback,#adminmenuwrap{background-color:#ececec;border-color:#ccc;}#adminmenushadow,#adminmenuback{background-image:url(../images/menu-shadow.png);background-position:top right;background-repeat:repeat-y;}#adminmenu li.wp-menu-separator{background:#dfdfdf;border-color:#cfcfcf;}#adminmenu div.separator{border-color:#e1e1e1;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/arrows-dark.png) no-repeat -1px 6px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/arrows.png) no-repeat -2px 6px;}#adminmenu a.menu-top,.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#f9f9f9;border-bottom-color:#dfdfdf;}#adminmenu li.wp-menu-open{border-color:#dfdfdf;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,#adminmenu .wp-menu-arrow,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{text-shadow:0 -1px 0 #333;color:#fff;border-top-color:#808080;border-bottom-color:#6d6d6d;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{border-top-color:#808080;border-bottom-color:#6d6d6d;}#adminmenu .wp-submenu a:hover{background-color:#EAF2FA!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu .wp-submenu-wrap,.folded #adminmenu .wp-submenu ul{border-color:#dfdfdf;}.folded #adminmenu .wp-submenu-wrap{-moz-box-shadow:2px 2px 5px rgba(0,0,0,0.4);-webkit-box-shadow:2px 2px 5px rgba(0,0,0,0.4);box-shadow:2px 2px 5px rgba(0,0,0,0.4);}#adminmenu .wp-submenu .wp-submenu-head{border-right-color:#dfdfdf;background-color:#ececec;}#adminmenu div.wp-submenu{background-color:transparent;}#collapse-menu{color:#aaa;}#collapse-menu:hover{color:#999;}#collapse-button{border-color:#ccc;background-color:#f4f4f4;background-image:-ms-linear-gradient(bottom,#dfdfdf,#fff);background-image:-moz-linear-gradient(bottom,#dfdfdf,#fff);background-image:-o-linear-gradient(bottom,#dfdfdf,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#fff));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#fff);background-image:linear-gradient(bottom,#dfdfdf,#fff);}#collapse-menu:hover #collapse-button{border-color:#aaa;}#collapse-button div{background:transparent url(../images/arrows.png) no-repeat 0 -72px;}.folded #collapse-button div{background-position:0 -108px;}#adminmenu .menu-icon-dashboard div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -60px -33px;}#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-dashboard.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -60px -1px;}#adminmenu .menu-icon-post div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -271px -33px;}#adminmenu .menu-icon-post:hover div.wp-menu-image,#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -271px -1px;}#adminmenu .menu-icon-media div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -120px -33px;}#adminmenu .menu-icon-media:hover div.wp-menu-image,#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -120px -1px;}#adminmenu .menu-icon-links div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -90px -33px;}#adminmenu .menu-icon-links:hover div.wp-menu-image,#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -90px -1px;}#adminmenu .menu-icon-page div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -150px -33px;}#adminmenu .menu-icon-page:hover div.wp-menu-image,#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -150px -1px;}#adminmenu .menu-icon-comments div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -30px -33px;}#adminmenu .menu-icon-comments:hover div.wp-menu-image,#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-comments.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -30px -1px;}#adminmenu .menu-icon-appearance div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll 0 -33px;}#adminmenu .menu-icon-appearance:hover div.wp-menu-image,#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll 0 -1px;}#adminmenu .menu-icon-plugins div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -180px -33px;}#adminmenu .menu-icon-plugins:hover div.wp-menu-image,#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -180px -1px;}#adminmenu .menu-icon-users div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -300px -33px;}#adminmenu .menu-icon-users:hover div.wp-menu-image,#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-users.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -300px -1px;}#adminmenu .menu-icon-tools div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -210px -33px;}#adminmenu .menu-icon-tools:hover div.wp-menu-image,#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-tools.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -210px -1px;}#icon-options-general,#adminmenu .menu-icon-settings div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -240px -33px;}#adminmenu .menu-icon-settings:hover div.wp-menu-image,#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -240px -1px;}#adminmenu .menu-icon-site div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -360px -33px;}#adminmenu .menu-icon-site:hover div.wp-menu-image,#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -360px -1px;}#icon-edit,#icon-post{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -492px -5px;}#icon-ms-admin{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -659px -5px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#E4F2FD;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#D54E21;}#screen-options-wrap,#contextual-help-wrap{background-color:#f1f1f1;border-color:#dfdfdf;}#screen-options-link-wrap,#contextual-help-link-wrap{background-color:#e3e3e3;border-right:1px solid transparent;border-left:1px solid transparent;border-bottom:1px solid transparent;background-image:-ms-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-moz-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-o-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#f1f1f1));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:linear-gradient(bottom,#dfdfdf,#f1f1f1);}#screen-meta-links a.show-settings{color:#777;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#E4F2FD!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}div.star img{border-left:1px solid #fff;border-right:1px solid #fff;}.widefat div.star img{border-left:1px solid #f9f9f9;border-right:1px solid #f9f9f9;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#EAF3FA;}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#D54E21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover,.tablenav .tablenav-pages a:focus{color:#d54e21;}.tablenav .tablenav-pages a.disabled,.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:focus{color:#aaa;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-top-color:#fff;border-bottom-color:#dfdfdf;}#minor-publishing{border-bottom-color:#dfdfdf;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a,body.press-this ul.category-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{border-color:#c0c0c0;background:#f1f1f1;background:-moz-linear-gradient(bottom,#e7e7e7,#fff);background:-webkit-gradient(linear,left bottom,left top,from(#e7e7e7),to(#fff));}#favorite-inside{border-color:#c0c0c0;background-color:#fff;}#favorite-toggle{background:transparent url(../images/arrows.png) no-repeat 4px 2px;border-color:#dfdfdf;-moz-box-shadow:inset 1px 0 0 #fff;-webkit-box-shadow:inset 1px 0 0 #fff;box-shadow:inset 1px 0 0 #fff;}#favorite-actions a{color:#464646;}#favorite-actions a:hover{color:#000;}#favorite-inside a:hover{text-decoration:underline;}#screen-meta a.show-settings,.toggle-arrow{background:transparent url(../images/arrows.png) no-repeat right 3px;}#screen-meta .screen-meta-active a.show-settings{background:transparent url(../images/arrows.png) no-repeat right -33px;}.view-switch #view-switch-list{background:transparent url(../images/list.png) no-repeat 0 0;}.view-switch .current #view-switch-list{background:transparent url(../images/list.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -20px 0;}.view-switch .current #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo.png?ver=20110504) no-repeat scroll center center;}.popular-tags,.feature-filter{background-color:#fff;border-color:#DFDFDF;}#theme-information .action-button{border-top-color:#DFDFDF;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#fcfcfc;border-color:#dfdfdf;}#available-widgets .widget-holder{background-color:#fcfcfc;border-color:#dfdfdf;}#available-widgets .widget-description{color:#555;}.sidebar-name{color:#464646;text-shadow:#fff 0 1px 0;border-color:#dfdfdf;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}.sidebar-name-arrow{background:transparent url(../images/arrows.png) no-repeat 5px 9px;}.sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark.png) no-repeat 5px 9px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;}#menu-management .menu-edit{border-color:#dfdfdf;}#post-body{background:#fff;border-top-color:#fff;border-bottom-color:#dfdfdf;}#nav-menu-header{border-bottom-color:#dfdfdf;}#nav-menu-footer{border-top-color:#fff;}#menu-management .nav-tabs-arrow a{color:#C1C1C1;}#menu-management .nav-tabs-arrow a:hover{color:#D54E21;}#menu-management .nav-tabs-arrow a:active{color:#464646;}#menu-management .nav-tab-active{border-color:#dfdfdf;}#menu-management .nav-tab{background:#fbfbfb;border-color:#dfdfdf;}.js .input-with-default-title{color:#aaa;}#cancel-save{color:#f00;}#cancel-save:hover{background-color:#F00;color:#fff;}.list-container{border-color:#DFDFDF;}.menu-item-handle{border-color:#dfdfdf;}.menu li.deleting .menu-item-handle{background-color:#f66;text-shadow:#ccc;}.item-type{color:#999;}.item-controls .menu-item-delete:hover{color:#f00;}.item-edit{background:transparent url(../images/arrows.png) no-repeat 8px 10px;border-bottom-color:#eee;}.item-edit:hover{background:transparent url(../images/arrows-dark.png) no-repeat 8px 10px;}.menu-item-settings{border-color:#dfdfdf;}.link-to-original{color:#777;border-color:#dfdfdf;}#cancel-save:hover{color:#fff!important;}#update-menu-item{color:#fff!important;}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important;}.submitbox .submitcancel{color:#21759B;border-bottom-color:#21759B;}.submitbox .submitcancel:hover{background:#21759B;color:#fff;}#menu-management .nav-tab-active,.menu-item-handle,.menu-item-settings{-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;}#menu-management .nav-tab-active{background:#f9f9f9;border-bottom-color:#f9f9f9;}#upload-form label{color:#777;}.fullscreen-overlay{background:#fff;}.wp-fullscreen-focus #wp-fullscreen-title,.wp-fullscreen-focus #wp-fullscreen-container{border-color:#ccc;}#fullscreen-topbar{border-bottom-color:#DFDFDF;}ack-2.22/t/swamp/lua-shebang-test0000644000175000017500000000005212726365114015331 0ustar andyandy#!/usr/bin/env lua print 'Hello, World!' ack-2.22/t/swamp/example.R0000644000175000017500000000001412726365114014017 0ustar andyandyprint('hi') ack-2.22/t/swamp/minified.min.js0000644000175000017500000000006312726365114015151 0ustar andyandyvar cssDir="./Stylesheets/";var NS4CSS="wango.css" ack-2.22/t/swamp/solution8.tar0000644000175000017500000000047112726365114014724 0ustar andyandy~'IMK0)nmӗ M~X7¾ ڋݘ>K(-$银k(X<8 )1, (za`w?=7vBu.Xn;>`eލ}BHO4 (f9yh&*[u26؆*ܮJ ;b=Uj9F/݇_?6V5ZO ۇjs\vCf(wύzZ3raLF8.(ack-2.22/t/swamp/perltoot.jpg0000644000175000017500000023233112726365114014624 0ustar andyandyJFshC     C   8" m !1A"Qa2q #BR$3br&Cu%4568DEFSUstGTVWcefv'(Xd+!1AQ"2aBq#Rb ?4j;A046< <`ePFhfQ  -sa#Y06WgVČ!;y>>b֘zbӎ[[8 *o6WJ$*'l{FL2L fZ1cx MHH p9Vq>ؙSqDG&]XhRi$(heŁ{ApnDfٿ]]rB@Ug:A7Z70@d5 06FaX s7F4!~QRZqm9< |u!T^ u2P&Bq>G0E09(^6Kdt[q7ecHՋCE*I:>zmOfts^B:AB*kT8imGtwR.zZeI !YT-Mﱅ|4Aa&%PV lmI H xM ,[ (6c/: -;Z5,mk±$B7~:Un"_I#,j! c e&MȆ%:qz.9FVg?Խ2223 Mmq2Vօ #8IDqv Jt)1Vt>7RdQd|;Q oW|1Oe{%#3ϒs!_=AHqhpLmmL.H43|FrŚ./m`gebO,}B3Iʡ*>:BF>RR<(Wأ˻aob.i=:> rEn{aapb=N?0?' 5h9"H,mJ ZMoK/=-p.>87/#^>I! UE} : _jq^GyL8 xב(k ,|IԛZE J8򛵴,‡~C"/ۈ(, .7S7;[<(8a;!ŠX/%kꊯgjoB?n ^ G$KT ]`oUCv^ G#+?E|-S˔%yZ9ʼFݭ,rB? 㐞Xģjl"Rm4UqsS!Y]1b9TuK|&m}dMD1;os6dœ=C%x &~0];O+ow͕DF^[HhNßHWӴCzi'S"j'&z];r*Oc^xho[cc.LK,W0~^1m)pAYXl{+10A0F̑D-&cG*H61,=O?1 ܢ͜NfBy2ƭKD,8ܤWC整jKe9@[r%ZhI3t_I#I.!0npb\OXw; # 1ny 0q_eBKS.lv>P?#)f]. /*&~ -9Mb#Pw)?1[^܏maZZlͯ uH0{dXFM.a#4ˬ"6]\?T1PIu%Ѥhb9DfI%[$l, &ىap tc7Κ * X *6AlzBnf oŮ62ƅM 9{"ВI'~-r".5XE7Qxԧ`֥t0͖Py˶eJ:c-zHg 6ԒH ,lOKTk5q.YpI6b8T%m|eJh(0Mcb 0Zf҅-rHx LH&e[|+-x^fqUh縌n$ +P&(5ZS5GҖnMQe4z*ce2&9鉡(| 齔E񫆎I;%hm B(6IG&"lBa>qGL5zT-!̂$[{JiƜsir%hvX؆mxp(wJL>5MX;tHs#10#xP7m ]H#hPTm ]jA@kb7qtm[7[x*HI shHUY"㨙f:J9?KPPlPU.yR,H)%;FŦASik}vgHG mUSK-1ym :DDGYLb*(j{Gtc8GCt4ؒ"@@X*+ꨍ9XR-p}(32@C vhBP6F0O/ L?Ab#igU'1. KmM18ڳR,fZ'qcuL#2>թ+ōR&Tnې< iꑆH[س 0VP!;%d|vm]Gx  8 UT$ n uVfuē 3K7 sVgZ6Ƹ]/Z -y$t==1EƴnmlLT-A(nK|6nm@1UGbTCP$zM)NGeL3TI3i!sb$_=Gz K8e&-%*:yN S͔TA 8ME%nvRwxD>LO[Eތ(\ (TP@-^3:X.ByZ̕'npmIxD6Tb"4g\)  \d ;g\[d`{&Od'kEMQG7ne Vy_D;әN+($2⁹ߕDSKpѿIS cdQTiaGm:̻h-%2"muf] ;c H,<#;:!e!j#tԕ,r8)z 3*4tA}qL+ } >-8J9N;'a-iTJs)N hL}Mj--ڼEd=gE]Q䮂yW6rK^ٱ;`-sK(p<.IePys2Ԓ-u1T\h(mzq9+8o F3oGIRA[Ja3*67FMκlbSDqnM+-NȒ@Trx}WX:;&K½Rwxfm4v4q3nH<6&R#nrajKⲕ+n}d;ue [a7'ƚ ̺Ci,!M9-98;CcG-)Q5|øү)K[\5$AmeξٸPRuGٕ"M`6$:L(, I+I6ߘo WZ͚+F(?MyT!,)eRլ_-M&fj=4IHFٶH$^h,=rRU>LeR6CM@MɰoLߕC;qdZ= $f] :[p =x|ݟ1hQ0ITI-(mMR;:G |9,]*/ylC=8'&$܋E[LZ@fhʊt#SZ$2\Jʛa qnJ&mK7'-i!LW80%ᶶ%,:I=!hR2wc%;CqE=ϥAR)! B k6^g577dĒ JUbFD~0ܣJt(%€]=UB2%>7XjfFԍFSא!%@Y @Si%a̝?a}O2i~l*eg\i Vn وщ(rcګ\3$f~Iˡ Z\'u}%6w.Bј̬ٙ\267Sn"Q;"+Y5SS&`KV|eh6m|D޾l1^&K)0@b\tG5lkRDTr6RtU,3 (%1^vCbe?KsM%s MRbZmx{sc9;5VV{b.rK)W hҔ)wPѰ:.}uz *f=WbfrHҧ.Ju/ݴ0^oTGe|Vx`ث~ \i|i7lJP FtH xC+a:%qT*r,NmU ܡq{q=B?rvL-#'^|S a,)T4rF^ܻXT3MYZtW;ZϮ/k~˚lf;K&Usk)JeM*Ԝgr9s|09S)yioN6Z+~ݔOkf\XJ2 ):Y)CѦ;/Ԕb>2sbVbZeɦj"%ڒBHBR'(5lq&EE"b>~A 0 :ҧm YZIK^hُ{gY3VuY7H,V1/-QiiqH*B\p RD;2Uа}zsff_A53VOܾ6Ы/ͽy_꧖(&h;,KcViW4l V:r8e(V?aIԬuS"2mR~ vO{_-GG8|-?{_-@t$ShU8@{V^9+Yi*q~TsRV%rRlA"̨ ͷBl!K-E6TcB6* ^f^~wK(7#섬L 5:HjMy$[t1ϢÜOrBndIh}H".3Vu%C##Wq,䣁MESd)J;")&(,SXv`8 _;47 Cm )Tʀ"/R|MZѧkLᎉ8Ǭ-7PM0ap=H-ٳ ڲ5>ӼyM曀|4e;ݥMS=91pV@8._жz^ǢUՠX0cI7 XFcQ|jw'rb}O2q%ne.KB)%SHUB݁1I{8([Pz>;J.~IGa uJ_(-&]e,-K Ĺ\G崾!jF%Ǟ|EĘoοOTrꔩ˫.YĺՊ+;R2Xׇk3 ~M2ꔅ8M f6{`lĸ7U|a=m_{5B wm>&;A7ݒ$1VjV:V{J.'41qDMiI'NdkؒOЪ*{I A $D+c$||y%'ڋ2qGb3+)ꑨR>حIscbglg:ay}US*Z)n Ij.r`B GX383-aؗT5 :⛨0 q!O$+O2Z.yQF1?Bk#Wh1agZoXj3o*^1374uW(ҖD)DI7$c(XS[Q1)fg ᰅR:DNi.4DarKR7:S^8Uck_ x"Q!J {SSj;C-p!횵֕*uCHU1xI4W@"B}\ATQ<9!Hzit]K`_Q$v kҥ ~AR])5CyjRUq<2:RrM}jQZ;I.-K!d foijy5=J[8 M& )G8q };BHZߐ 14eZa,%8Hzg 2.:_Mͯkq5.jvrca3(>$S̼ҔV S+WВ!AI.*G^ ?&4W;uTNb) MH2.Kdx"oӼ'0{Sw23NXΕO]6ԦK4T־"nmnSZ8j4ʶ)|ęo1LjVBQ/ k =Ad}U TRTg2 U*;*醜[jHp,լ@'m)Xp#'VdxDyn'%Rbobo!\F`@/0 @\F`@pD_CWrt|s#5rKʚ}NQ DuI]@;cD]j)*QeI 'o 5 Dbf[I#h <@ByʃkQ^6ͽR.b]N⼐dOMJN{]u#u_WAfVɰ[d'6K^!(v~p2C ]+RUNAJt>1-Q .*z+mO3;gʓt(UvY3R lb\stݎv¥c f|?9T6%2 [*DM LI D9Tl#(!&bm9dBz\pC޵߬53db|!XU/ S-B k dШiQq! ͹ã-~Qr7 !~&boх&a(SpMood5!!k)Ut$e)O2*QQIʚ Zq>XӨ{m]:%átE%RzAUҷM˨`hR Y]]D>a0藧ɗ; #.z%c~̷2_ J9;;HSܖ-$$n|lbOa:I[RPVO$v,baG"юt6Ws %]D){AcN8Kazu1)> \r CM@W"*2-d.zany!0IGUSNB#c@ܢάS?1?,0ZeIMf`͕k#3 vˊn4o:*xP4é6[K$lH&;%%hÁPb3bN`RU)R`ja;88[ɌǓXrepiKKi6>Ȋ)*-(%;a&\}8:l@DtF84^q%%*) p"ӌ;—{8HIɶrF*,]c*Z;Brb[v1ocy{'KUhXzW 7Nvwߓ}^CV ̤uݨ;,mH?I.lo J/Dut?RU8IV8Q]0q [?~WiE)w)<|  ٿ׷*OIjE;iDcGKSfBdg7K2˳_E'V0/TJSe< }?(fg+g1kh|][ ZZ*́TEȗ,,1kh YG ZZ+g8P%WD 4>5c ůբg#C6AƏ8W ůՠ~Qw~#Eڏa#+N%gԏXcjbb>##i+H|M?I/&8I NXVqhUT3iBƒiPBJA;wnEVnԄhv^D·Prm<iX*{b.*ePԳrIEH$P;"xm^";fP6Y''a꓋7P˩m7ILňX1m;c(E(e4]V^ cf@´v9P&mn5o\JF1 #>1_"G5-WUYs9QaV>Q{7 yƋ$x9ZӲϘ?>;iO&)UWf(4ܭMTl% Z׹D 7Ƒ$nM9=?=yG}>6:{1QN%]ŏT.lMXo^+c7V/2gU˞bXV|lNy//քkWJBL' 8:gʔꬑ g [Ԯoew G"9.B`~hY%BŰnF hFԂ]sZA;*͂T-r|<:qвTZ.uYvnIm m5[?4m>xG{Cz&)'G#ɇBTsamw鴾͆u0) $0i/2:%FF7PK%iSH=IL@ kG(L$*p$]J<Jƴr#-D'py WJ7!iANTUe1MQhfPESBKd-oˣA%u)+XP+)x3I"QqØaYia'09%O1C 1k^IdG0AԬBHR5Hfصe͢[\fý" na R,a4g)?0M}S3!+alR|yf@Ƭ)2uQ_UGǾ*f*o@RX(8U*RIRF6[+xf/=.FD+ Bl)y%+hL--;O":bU^ZKt(Sj)ijm3*NĆW)@XF /cɤ.I0b1 P&wowܓ QJ~|R7JB<ȴäXL60r*[x9):H[ [sd6V3d7ÃxFnWW6E̝b zb|Pά-IdNaecЁO(+Ο${3&t mwҝhjl6)'w.gVkwRb&yj_sXneO˘jzӤق=+oeq!L! Dle/kQD-LE)h|؋|۞=xl_.d_b|(9Y+ʗ?d&{(_":C>MBs+4WdiYJ:xR# c]xPY!j2a`zyGFׄn$/!ڋ`JK*,8@"9XTC#uz9 ^l.YML ~c:p]PCJA|ϙk'v%iɩQoq -i6=Rҵ`O(a~PCtĈҤHR;7dT=Ѻ7aWi!~I)PvkAEķB[xtTJ'5RSOHJI>0Gj!:yh8E&FPb?Oғ!-8Ny9.(ߟHqq{=2V'%PCmBRw7 lP-Xn\@ Ja(^3&M,) %%׽"꒔;XF‘{ܛ)Cg NۋAȩkL89NKۆw6t*p%nMBGw5qTeeN,o rn!jY_u!twP,V ΐ n$}tBqܽ_]=Kcyb]H PZ٥RprX_0K;7U+n} I!G0<W4>FdE& fY_(t>[L%֭vqhTRb &b[!a IRwHE0%WWFlWu*UJ{CK0zt 6n>*+yzel=yꋍݞ6"] {Û99Ioq,mlbb)T!hm,t;X4IJRh-5P32q{\}7Cpj`ttgm 0S %'|=L0:j#(`^3T&hl6j IROE1+ -E1q.=74`tWøSkRYs r9!iT)lI{z7Rw!s6D~"1 9A Pdmesr׏]Hq(o4S)Ru,5Rruh ᯪIn4mE!u![+CkF]u&rJ JmpS  Ԧ Y$$ˑgnyAZPVH&дx4wRIaCa [*_h\Z=yOiSEsNi!18F/Oi'Xa嫍34aZR<IgX P'Vmquu٫ȗ4=<Ǒ(HRVLvodfpRg\LċԎbuMQdO)k"xl Z,A0-#?d1OS!WH>˫[9O42jeSL` U}ZMɨ DkFN+@#6nVJduɇR4Y"p ]w钋غwP9ՙb\72ۨ|/*>nhSx|#-;o*̬Us!Z Jqor<"μ1@Ì:imI-̨*|#O e9.-47PRqOdI>&9833Ⱦ)lomT3ag} -&(i͜ʧUͪu2rGuD)o?Ou=J *<; 9#fyk%,%CPz@U `B>l}x D( +?Žd샕C_i=Kv4쏝Co鲋o?N:©?ŽY;Y)6n 8yvRb&ʔHQA>h+F뻘 , Vvs^B]iH׼'mСtX*ЋjM2d{XCFJ, @smKIM9ƉbtMAjjfHf>JBiE("J?oTG(ɢva#[ZlGErs Q by@|$PT>mkHN9:99CJIW22{ sOP+LKO.AC& 595OW |3()yx8W~q6zgZyD%)y`$e,dPޞg_+k"ʫ[|QS".'vlmnf;Vp'+#_+Yb]Jc)K UJy_̣KԋNU{(XT:kӒҫÉZAԻA?bfItMl~1V˗TI Y>cS u.$(mЎ܎vKtU8b_@;h.4nQn2!XzJ|KHaGu&Xo 1MDT;N7oMOW33/ JRl?ew3e.) >OtQp9Dr"u)e7;f&vU iy'~3ݔ230JI+Nr d9m;sL'Sz]RT 4ۈ(c[_e۟7{e$qߙs˄V#3JH3,!eUM ]Poec a w-1:ļdܩyħRt;(b8VLi[.[x8FLۿ?|?l5)=1 w ; IJJ+FM\Knca'&Ow䉛$ᵝ?\ 2GYd4y<ECrϾ66)@y`ǫ 5*~1+'oAԏ,)e{*P8z;*pz[q2çesl锉E(+[]@ܘzzmm*-v5a*d [7)I>w7-^iTjXMBx%v\M:j4I!,jߪ|=>T|x'3MENSd?*DH%O!sS :Gx:dLäRkǪiAq%rvo=ԚdMR,~t2+;uJׇ l& êkQ yZ0'rvU8D)2~襱3 q4RU{U[ty*]RTp'd麄ysWeJ]q%mΝryt|e^ Xna[98>e)z/j*>7KRp̝=&m3m+ӭWj'7ꃼY+Š|Izjpõ yoOA 6ioߜ2LMbW$HtҥD$*%$jֲnO)R;х,1D :9c*T@ PѨU 7ܛF\ɽmJ%o\:6X1Bl.eqޒ,/U[qQ-#zNR&I3"g2i 6eˁ>9C+֦ +C@S:lkSl I1I[mvNe£{rZT9JHd{qʫQI$p"dskxNκ)&$KV76H,Tl.Ʀ ʲeAE*8y=_ˌ8E QW6t.;Į<\YlyAs9LIL, YI7@ǃ:zi3: rƒf+4%IQ&pz]6 *6ݥɲ۳0-rIg)r+;T?zh_feWm8.$/h ڋ]DsU˅;CRg&_{q="辕Xr_O8(fG aĬx-cP)˶SPyOVjg2ckˠWC/qWW[m"0У}:m~&hEf$=:M4B;׾Nj;zÂE-УbGQR%M9  2YzT TzT!;Z'oS Z=d,`3moZ,zvR,7Oɋ:㋊ H۶UrN8tTDD҅2IMTKg~vVMzYvq6P_%$cƃMU5X3zysSͩ\RkԳ6eL9apä3Zhi& ϩD6ƈBO8(ABdP`%;^iR8RXZkx$LiJyu:6x'`- 쒡ԞÅ*] ޢDnL2.Ók :4+* B+ 2u'kkJ"ͤZ$ǗUZ6ĵ\[[Ra+.{={UMG24pĒ ؏?Q,?Mt0 $/BcŊ8mSgK'劏 ͪ*eMyߤ'qz`)ijZS`@7muZۘ=k 0sab[ؘUMAuá!E({͆MƒO+Ôqĥ#rldC.RRnB3ܓSJR,ض[s"-Jj"v"%FTۡE zbfTN#+f"ujcDVZEoGNf8|5; ɘ$X ;. %r0 YI*>B4SE6 \`aؒiM9e$hUYUM:SWuJ:qY8E3Q˸IR,A<א.M!I.Tve>taۆȷşW9E\YяHeLo88`OTm#`TF!>_Bz/um@1yt4%'3d ]uFc C\7#D")yYRw1^b,RB.L1a, 8nG\JPj ɚL32_Ue [e=16mG{p2Cx'ˀcO$y$O/& /a0/}C6Bҵ /zzyFN9\et]#E|q(kZQ0OUt-||>>ݮf% X"|Uʈs{0. V{13sn2.֗ Z?"3$<ǥ(\g~Ռ=Q;g@ՁpjmZ8 @⃓G?ڤ|~{8:Kj#9^ǧ0!@nA0]arz&8`\կMmoI'kI)fZ $͏Np0Pjz h|pY?۠sGQ[W𠙬 m ˌ E ?ƏB/m?AG kt ܩi:( AA4G!B9NoX%k ezXx%Cδ =]7˜ [W<]kz!%/rgM?k gPcW ՗]Q 8G|y{Wyq_…]BrY\?V'5-Bj-uukP:vл€RH;r}s>Nh-T]NP6R:)* G4dUTm6}a-= qR:M]?+43]*yJnZ'sl<|"쁕V\5JI+DXouW~'**Ms61>FeaL7mZ)h6|$-x ͇8jlz#(+jn5TzTmG$GTZBr]6Ҁ ]2>..LZRz{hoJr1x|biBٶYCkb)D.>7]"ln|Z36aH^n 359h*JN5$ 7?!XpRll$]~vqi*Mi R?]cz*c$#RQ +So~fosnsΊ֧M8\yG)O'"Љ?H@I&KoEBtNثrĘl4 &2:11-x0l<4Jo6̹h]:e~0Q KԫD/ȑ"ļ$IeDwaa15A9ZCNˍvPثꏎSJ]JUbPOgad):: 6IPm)'Y4g1*r7<Ǔ>|:Rܫah 嬍L4=T%^WtF(6Q۳SUFSEٝYVU邋Om>O]>fHiVYš䜩UiMT@ѹ)/rNIms J=.!œ$s|fj`텲LZ#H&&Z_JByA[xGEP(T/H|7ba;_V19$#1-k(aS:A t>QqSdQ!Oz;=`=w82rG?-UejDA6 mܛڋCi_fpN"eBT|Ru;0d6P3 hyWYY]%dyD2juv]RD,V0IdeZJٙvg x1قO@Ra'f.&-3?e/L{~U~3̃cfN@ @ @3 @cf @#S1k0<Ȕ˻HRN1djo2nIG3IAAW,~{񎫨`o~sFI)S/%(YeJR,>_xF237vkc6 )--@K=GSHuAE<_2NJ* j;۔Ii(%X[(ʔiX{=-:uDSv\R9VT'@raa#Hڢ-Wbw TM߫~k!c>+#Cl]HN|G0ާ!heU< Dh34TL?a)>+p[\YwN)mJbn{ DmbS^v1:@-zQBM&P*ƹ6nQip 0=eR@8aVxϧngJ ۧHQ('SyĤ/rbuZi6蔍DA r*12u3U.z#_sҦ-d![8>Ǻ#0Z|ST RgdS@UWDut}Zm ,a8kGK:9,ahC7L!9#CYMҜPvIa>S0.#³R$+ٚd‘iM;(Ǡq.3s71FzbVffB1J.NNiRuhZlܫa 4pIy]|*J/6쿡M$ŗZTVAQ)1;E/5:30!j^a]S\ҕhֵ]VP Ovl416I^c|5*U16̿-—BRPIH*F;<+4`j0|gpVv]%ͺR S(ShԥjNv]ggdϘ똑>-@BNuO(3l- FXnP'<꽅(ZV Wḍ28_֑p89e;[`env*|M*Tf_,.֭t_FhvQS\*nOa4$leYxn,$@_I7=32=)Oէm}:G{8:";Ifsd~1,=V0C:=qK@'S:6 !A[X8߱1|(8w7kx8A]2#[!|0mtĈrWs[|UPUS4ٵҕenn ZAWO&soix U'(MjZ}5H"K:MA[kOht\,(ʜU c$q`lԍ5\iVʹOz .c}q\GL@3S%YTS"^BRβ@&;;~yS"KR(]jU!N--A ]KZ W;G;doھaA30/1z=-6H.ii Smպ{xZ؃ 1]?fbN۞gZJҕ%I!ā6P:,uZ<ߖA{*25r7213:hEP]Dt)ℕ^0ڙW:Sأ FebaFBzMRfR M[Bo+6SEFn3bnaXٳC\5U ފJGV'%#?~Nc\NSSwR*rj342eI`ҕplF`Ϛ̺Pd]fjBS)*BARt ~M&1 ꅅƛA3 i]QrU씴$Dƙ-F~,n[i(&g]BP'Blt^L$(r+E6h6IyI;w0 Fo OV%X#*6夛sx/%j{'zsA*;KVQo88:,# >5yG}%V7QÌ49"'>d#4*xkXItxVId`w|aY[ێRe`r_){GS}#֔d> ! cggk%r%EuGOժi3!RU/5J]d-@Z^+Iex_s3*zy ŕe"14_0uo*.IhVbsOQNZĈk:+*DžR"*Z틹Il0ulދy)-#0DVZ,ifJ/5kq ǔbD3X z aK}Пp*Sf/mly~ AI%f$݈AK I2{{ }7ƴD-uR_Go*3O'UmZLNbHK Hd~fԊX\ItOLюӗ8mn_u=gW3eotjyX!|0{*¡=1RZR *b.[qEjmh"]#tJE)iVh-OO+3rQ%s2xjIyD_@f]tTg ̵\hifY)܈٦J$ 21S&fPwUk)R*a<\m@DerZl\TStq=IΣ_rbƓݗp,*𲂇QmQ|),@\?Mf@߬W9_:*Ѹ!*^,y9P hm{G;/j"JJ4֪rRt`GeLCmǥRM~J#0ě-8I@\mTH{83j $9UZli$mv}3Kink铳ꔖLJ:aI8%@A#czҗ>=ŎU)݊ڞz[%JZ8\QU4Y X}bZc#0+a)L][sJzEe0Ԗ%Z-,6Uέ:H٧.&3e8_ZDm95ĦH"Y.˅` ,(OtgNw1f/Uk[ci$k5,ABJu8$pu 7)}>]1klĸUrӥ0FinKY/KBI@CJ.H hn|+ɫϰąnzMt"ViOΩ/8J[~9׽1>`vx970sxݤlio7fwfo2v-?50VdL9K/I[ZL6@ ғ1NMO6&UܷMNC Լ)|d-RHYy,cKfQ:<ǽsNښ ٺ\3>xlˤM#VZ}ȀS Gڃi<Ԣ>!4C8jvt* SEA$@ B{|>ӹNŔԷߩIUІmRAP%y.|kx;.kfqf+2:# Χ[ptye%5ٕmb W-LlS߳eLIM7Ӵ'7#-a Ĭ4Vq< <PuJP NMG+>]2fc40&*LHxI* 3ml ސ#H4;B`yjW ca1cb?)8rW&uLl}3N%.>5CdRPuδPN]hdIvLe8Q6`Fī)J[wX#4T2L6CL}Yޮ%٥+C2$kn<$pKQ{5j2R`5а<# J.9IL%u6xr%. _:n&ZQ,KcȡQ9#ͫ+n؁o(6RCvNc pE>ޚ }?5+O5oM 5)*p +E *5ιo+@q^\Vƒ$ĘH"!MEԥAO(`:a8v;| R#j#uT Q+Kh sʊ:q(qI7ͬG8BL0NMރ+PUr^VqIKj$@ ͊,(W~fd[R EBEN!6F[3فK{PM*]*L/Fء) NJ) ) 2XF I,zDZiJ 8ZT "L(% zKm#! .a &LʅeAOK|;'0&B:C5G4I+R*0I*US{5SQ>$1"3HJn[(}G96;[S-94fXp\M>q>1Y)=):?A&&dSd\K~K8G]A#ƕq'@ԄV;}We̪IaV Jkj|0ܣmx(7R.L-Oq).KRH.@\]&#^"116B)JI9GTye$TT4TbSp_YDFEYҶT.DCp_m[edMqq۔qol\-t+ң)C鿅?m")CiIhx)]h쉉G)Z1.;;3MU3fƂ'i m=p<81sHљwe9&M6񊧳bvE7K6'x]OQvwRNa/Ouu=v:}VTIJJAQ;XFRVrfut[rZYAM+S"i`kQ몷U(`Xcx=33Wk,g'V^V!Yߍg%/5.JYVҥ2Xq%a*I)*@ b9={ ;DvM˷*YyRy a˯5:.cҢwW3bb>l Ƹ*\IP봆 `! hlp" &\gƘ{ fyT3"e֚ ZgRY}.F헹#+!Hs 8bjq]3y"x@GV('uo<?wc,UmV,ɇ4@\!)"$yc D~SwTO8ysN-8~T4ɗ_mG[D3/rocl=6P%gJkRu'”O]BciN-t0\{fV/p D3;9p~bfB1rMV(0@P*-%W gdh_b<8RÒAqRX &c%ۻ!q6mp YH|%?A6ekVs{PS4D$'/$H#_ 8K$ /4;T*^|͚PױaƩIP\oB2n{đbM(̬-!BRT6 "8.>RJ 723U=(;A\[KMN6:*BWkJ=\ÊbJZ}B@ l:R Igc7s"LWq\?nBiԅ E\yL˩Vf3)jh{K)Z4Azըk퉓^z1̝njtȩ^Z) yMT 2G59( "ji$^ H,(t7{BKLBKE$UAze9_ITJVRI ?j3U]AP$,Aֈxv՘.X7.+z.v[!4ÃBR4i*hԢV@7"V+'.).R%9GKl..)J$!:MXi\-P/1l#4au_ISN llXtq :#clh>KTMK]eʫGAly{މʟk_}r*|ѓ*\a.[_[o 3/uJxennW2R!ɦmGΥW$)J)Ө3N\auR\S:zfij' ɰ@<쒾s8 MƓXઊT2B*i`-)[ Vٞ=ԜfN86Qe.Q 4BCr\()a X ֤܂A gc\}TLƞVrnV_kBpԫ#Er<섰#AJ ;%8F#m+yθr~cf)5b1.̀!q|jۂpXU_$&A.)A:Ltȩ1#:\'s8}b",;m15>8 \_/tMݗӶS"\(nL} 54\'E:@펍b]L?5C9fuiJQ0Mcs{3QJ@Ĕe] Q4K4TtE#S1]״ZQ4@ԯ;T_.O-'&VMVvmŪF͢|s{5I~i[НÖR6a¤B| k Mz0CI ~ xA/LL H_n U@! lV`P&ÄlzŎDD;q@OKCMVB7#3R. ˙efY̩W$_c-HɗZ8>crG*kFLdH_m?gFrEe%i8u FģMi;6*k眰eInri/6P&;jQLwb>&I։6QӹODKl^#H!V9%b78(iґE7ɀW%ީ$vpm,G%* b]agPQ1qVJNUkxVwU' &\$@tE+ppT‚veDarg\TɽʝR7tn̹eƪKޚ$ϜoPK"i@Bla'rlOD#-QAG'fͯD#/F72I1_#ѡ(eZIۊD+.e*YR+BLGxD4F^] "cֲmGCot4=%߰LjO7Ӿ),qaR%mF&d G)Rq 0 %JS5*H itY:ok}QКZQOvxq~)Ir BABB[ToNZǧj2J*?XO̬#RdeNJ^MerRsm%_ii)[kB JH) (Glwo!b}u Q($PTɨkAj85.CG*q+А]]ֳDG21$p]^)hbA:{%Vdp>ZZ jR{3,Ĕϔ'Xƍ,Ka֜8}4&Ԋt#W0m*Y ^yF}j_l?LDRJi؎ܵ˯T CvBܷ(~ >B>vp*ޠ7NC*O;DXmJ-daUejM,(QP<#&d͠$}mUat@~jF^NSKeVi|˲@+ B. 3ؕ86E96\FEĤ 3_C[*$ΒцW2uIHuxWT Gm<Ϣ?tDrMIZKZ71 j a?O<L(^i#Cpq@ܩ(R "TY\}I{JB(zD)6IIѤz6'mvշ-t aT,F> @ F, 0 @#, r @1q F$qdO ̷,6HIo+Cj6K0fgG'죋!Wy^dc)[ih;THPޛ62aFi,@#IOJl IjNѪ_ÜXgY#trĂVVct *"sHEiƉ!%9=yPLj'DG>Y@EL60|^ti/DdcK}efC)e?*/q&Bmh^ iScI[)u /)R7 mEˀiRpДp$-j$Y¥$:|olQ RT B1gÎXPslP0gk"R(@ { =~=PR)O }H3*䈋JLч˼6M['S\`2[? I<,2srϺ'5Pb"dOڨm.qڿP-75؞q1ƉS9otW.VѬP)S&r;hEŽZdAwgCz!SlK.U&Pi*RJ+n'52Ґ>\=;wQJA v1q{cDܜ)Tlpԥ|cl !59%A}.YRڔCi],!e3d4 NㅦemH~@TD iUsh,:itjdk^Y6%5^Vj"@J[Ry}esrvhƸ*fHebiA,JAn;ko$g\E?? ~+v}=q]+9>({ynZ'=qYrh9+^~2#i? C_xqGd?|9mz]m>{5,R&Q٣eݿaA˯|qAnLTvWX"˯|q$|×^ߛ[8K'd?Prk[=q|olm$p)ʻ]{[(Ys|qlO e%sq}>BUK̴hysHC\,hP |aL \)hce5wnp_5 l&l&H up:|]ȿmPn O_GG_|qi;v$A8L9rr?l~R~O|q}Z6\)hʕvSu'[,G}bah "&95 XԊURB\Yos9qh4V VRT*$lSSV0 侇O%Gn\c~yG`ZԞ鱍Sz꿔'MTY<MylyYxJMSGVj :`)#g$qcԛiCe_DѦmox[1( s;`yvyzPeœȦ*+=('𽆽BRVBcK$YzeC0]Y; QE:n}u&e]y!}DI0r>Rzz[!:)a!@b :_8y9{`l3{whۘm{0MƶX}^20kFB<WB8*q& 0 d,.Vf"JWshxa4fogPKf{Fě_PRS!A5G ^ )#TV"|Zt˔B2 rR ;@H'{F1|>AẗH $zCZaH쏓wRؑu\Lߙq-d){TU=2MaeJmn@RM6xP6xJ$dB70T Yh [5R)l}AT ?*Gtj*q+QbGds: H]2"_,)xy[l$JYpb6gbI*,*~imGH֘T: h4 ~7l+Tormnn9BD۟ N,Jy/#}nmezB}6в5B(.P xRIJA;s# =BG8\E\]@)wS2Ni\OGF>]$_h2$m4Wt8=PhWx/ΤT/6 O5*FpVJLk6JU;!A>*wܓ}^Frl #0H$}m*e fy]`y?Q'O29r k6,[8=aY%d!OkߔvYrMयV #ѲMo{F-:ƁD1<`do ׍o7܌.ddfϫ1{ <[ N 7M'w - lHZlj>6Hv,t%SdhA'xT#RyB($#6A8Mkp:AH+)/D*#}Ʃa ;(C6M4wt$I>PkIjM+p3Lxw'$(PnOr҉V%ZɎ.-si>%ouI?"phVAoU|fJTXB&w&%I *&LzyXZ 5IZzӎs0}A*uK2xM6UAUL O1֑ XJFE)Po%W1 rXm"WZ[j|K.%9(g/L5|k8wXl>0XS)EEE_DJp~eI]P浨^&*65<a{/QIeU=2J/3NDjR,pOuIRja};ĆQ2E,?O񁠺SɜDfʬH8{FZg$dty~rMKWv2@34ߩ%e(eIq##/#|rQM)YCz) u~oǵ괧iN/AmIiQҒ9Jq ւ[sA^ZjjJ^RH7hJ6TQQ'V+fd4WA6"$k%3Ei)UĒ5f[)uP7RdXkWwVWKh!u-6~_d-R0,HH@=*w)7TU2 _rtg.yjPH?|pK4[JV`믠y6t9;i兣 Fߙ2*'U}H@Cѧ*t*V9HÏwSkZH2{yGI.J"yI)s`(J*}EltI*]ٶvW1DAqcD$zObcPx.ZQlJb?(㑲_DXMP‡ZӽMF Vt6ԖiG!dd2tE>¶D$y*+b73cȈJ^W L(mP@Ⴇ*txoN$纥XymcKl>6@U*ä2}M\)R0[^p_lG^]r)JrG1O/?q.j5g$ܧ< 4ƛXm X0eht0b5~}^@6`{!Lg#* Qrr񀫘N5_xaC{-DܘJw&X I|O =O  AY)W.1)~`ښ졢!JIl7E빎F`3NOtsEZїB֋?% MlZC]=V2zdӤ*]A_%<*T\{2 ;0ձcΗE}UM`s7/-RGֱ>/%Yy&5-"0dZU4FYHͷ1 Sx#,}ȰX&XkE5[h6R;$٥v1)ɺeGg%*WFI|,N/c;maɉ`,(\'^MK8ڊVٺHoENA' D'}$_{y6-| m-(60uBRMnjZ:gz4敠uCwҦI#$څ~o[`d(nAx&s\g,Gh~Z>lZs(II ϐ#$\(bSt_ sVi `0ṟuRyV{94ka4V|Is30n|uQ':#u$tQM݊ۚnN GV+#iRέm%'Inbyq-L#%ѥ*QwJ+ғЭk#װ$!He.[u\ʠlZRZ ßğX!s,wxɽ-z$=-'twSYnכS _JU?X+q{ox2cMx%Oh'iu.^J~Wf[ٖel@q?Kkp,<76]•_EÒqh[km,XMƘKܸ|%F;"q='nq[ ڀ  Iŀy;W(%'d(^Ucb0OHom UF Ξ0L>#U!&f)mnۀyr):[kA [M-'nQ/fa[ƇqhW0H ߬w0O&F v(ƪ_HYyR־]` 4V1mw8fǺohUqXXnk6$EECLꍦx@=as]>~Ub%%*^ Y2R6AaUt^ֈ)~҈epu 1J0"Wx{Ģ8_Lx}+/o#EV)4w(i7t1d"~'UpG\rT)℄Ljve<)iu19NLo"UUd(ڏ5 r1kB±#e}䶎n-gJkOkRw>.puvN<xؘdJLF)UiUQ 9.md&q 9zyu ƇwLu6M9 H0'Җ Eq%{~qLwN[J 9pO˚}f!A7 (mH­ ΜKT%3RVxfy)36l" ֒ʂ=fy/1 idJ8fFe\ѝϠ58Vqiw fl)e6{Pb/Q4(yZ-Yd6겶ĵ3<&VDSkN*6Ju㍽s*}ݩd*iFm|1ͼkòOX=TbHlL 8lrij(LJ7{fbrjZ"R]IhOۢ.Cuר \=O&UHA,nj[l*t0TJ1lI'iTW|"??(-uJԮ!ugIQV%*vC!Lސ*/HMnQg#j%Z/dV3A/) IiHKf2/DnfK{ϩ$$D+M X# US3B^p"YV24?mQlwR/di?0Oڮl飘nvml|c IkA)Tt&yohU 7񸲆+P>QP #`A $+l @)bH|$*p -,mnH@ZwC=[%\XHƝaU8(8?8Fr@xsH#]8œXZ)U .jK͛)$=6*d&8mm&M!"2q)͹CrbFhKS]3n\!IPbyEE!J{l<̻YQUt?DŒwtZra$l~z78sbwO;`arb='twTy\PRY#bW}enWqgh~0Be͏ni`U8aخ}U*l\P¬;3qfm*H8{J6.(gdIgGio!PX_l>1sb4S'd] &_R5IJt+_a4 X?( R Ih˛"ƽjh_9($ x{*rExNaȩr\НBŞp@ ^+DZ6`2rzR[GPHhN@J%WxF eB=>ENcI0UTVE+<ȵ)A5mX^-ۑ 7&*Sr\ +E};-={m<=osDzdתžlw8ocC=dm1I\'L\(BnA&0O|LپF 1n;7@<;6DsvlWQR9mfQݸ{5S醢<=X»5$ )=[VH;5ST75+i;U8|CR݋FP C MOJtDjX}*C}/Ja(K::%xjG3 H`F^7UO}a/m/'S` SZ=A@nYl2n&#RuM4]IB)\CWjߐ?[?(IڲeV?\'}%=AɇPtj_!ǵi#}+4-NYc4 ĕ`z)ٖA Y\G mJac"ʬx"?ryDٞ2masmɴ|4v`Rd6ulGRaVP[n$)$xEA'찴^3,q鏦6lYR:|Dwc8AòBOnlͮmsߜnbd64< iY)%Ĺ)"GXP ʰgEІBR)@ JA,MF%XAͲnDXy#!-^4и Jo ;)E6cmn!|ea-8N3Źí. nRHÈ0~{f T9!R@7HZB2 TEHDj-HH;)O%t٤[cخ_ 2]J[jW@<*m /K<=Pҭ͹xJw1ķX,?U8 Xƥ{^nmTeN\H7N.Љ=s%ŨPT|U'3ƼZ5R< " XFhzƅ60iM|#-TyC!$#VT랇,sC2qKdT]`x@M*nf$Id% ' iϲR OgDAN*nS6C[vey8%<&ҕ֫'a %FVA>PvϬE1ǡ'l(XI[i@n,9B;mmD+0dӡh pm`LlZne6n$I"m Ԑ1ĘyBGѸiӷ8raIV< 6|"JBoV2g%N lcaktӵqu#,7Jaq{kHI\)D E $x±86l$kssyY{M=⩩:DE1UrN+% ED'E5u0Scx=Y.GGzmuF!_6ȲPr5ةZvq}9ok0caEhC.::H k|߿H)YM`׏0Q ${3Ғd05S$}P|s\?J@=#~2UC2@a-z9TTij;팡?FqE;dԘOtED54w )?3\#t${ocE=ha}~jTa lxakx:yߝ" dKl}x)G90YloP"Xݚm}-og$Nԥo!+m$\W02(jN}`(mI_/jP jBv( ,YmM3sMqsFu\ {+}OAlw)dxT@HodR'2WZ9E[Fhl`A0;Z!xLJ5C/k0dC 功w1gL"n}>j^R6--IZپLMX B,P|L!^L;1,SZ@ iL$oȂl.G+F aK_dL\PpX38NY .ܓlA%'F$~ja!{ZKskwS r Y{Y nb,%Ê}0Re)Ŏ ]Je%BEVEiX y$y DO2GRGP WKϤD_'ͪ\d4AX{à]e&&VT!R{bu 'eZJtJ&ȂlLHl|#0rjL9'6y'T v%&fe.mDo&e3+;2[piIRe BsI>1ChGA@MIe0x)G"$+wm]tVͰt_N' >=6)qyRS~i6'H|LL_#y%jX!-_97.l1kAmQI)%DKX:b^p^\Q)$NA҄(yu)yO2"dTE=eA/bU6\#kre:NyD6k4Ӝ2yItn 7D|RCKIft ObYvρ [+ %7%kKhFd92!Ocг`H:>Wb5wsNcx9'!rɹ0Z$* ]{#PoхyVZOq`E!pEiDTa¤IHDlMkii*}=t ~!"^]LTY%h3iV_WV0 u{jq&3έɱǦO)CZ#;­'if0ʒU7G|֕XBӥ`49~ZwR T&U4œ0ԲT~ A"쀥X۫MËΦƓ -'(&K"Jv~U _ |"Й5UK-}Ǚ~p5mgPqS*ah@ࡲwP7xWfKgZ^Ee#028ҡ:&C,AA?x\)ԋ {aڹiHiK H ۜHW]xC$X,E@S4BFɤUwH)S#11VqIQj^7+ $"iBUqv<}GjEͯ6W Q„w`* (Ѻa} VbZAS8b]TOS }s3hOxÎط1ĮT*e 9u=qPLV3^4Jd/ H5#HdC%p[2rHyoO'BJN̂M};(@/JRmqn}6<&>ML\~>mb'Z֩Yi OIy}VNX |h>Vxً_J7O,JHm]aӨC+e!`)$y1f1Bf0Ul608tRȟgcm nqܘ{ U$-A~Fqߝ)'Q1.@A6Ѳ) 윫-W0IM䩲&Iqn:G^kTb} &U=qԼ ]HMIU(YM<2JpI}+ҿ}^ N !d(e~]}OCm@pݺxm &":tÒBJV D3 ,hy@nZ<L/֔tuO-E^'xF)`}8pb^X)G * 77Df $Җjݣ%! 8$l J5fxX<0dz5]oPi)[ZX0Zy2az5'kB\i%9S7/Nk^f9'&[ SQ’ on=b-82[. >;o<Nη.ZluA(Dyw/(S &eN҂R.r|zGe&<)_E8p}.*m8ʚW_1LILueXM *|4k\'-}GmIn<i:=8G[97T]eVhf[=+F|ĿTx9ʵʗAdH _xx裙j[K5,osART /Kp#ϔ9ӱʒ'WD;%a]>i"mZ %mG7/U7ey7tLL<~_\ 9ىp9K4ʊ(#45:19xiVqIslIVRZ%I~1IN)0YaVZ 0dj\gkμ>ʘ[ u=^]tYulXؑ%529ι3N̩U['2r@ =H[XSR%u0G||uZY#Zh&)F#ʺgeL TuTTB=UQ8 2a̢ `m=R,d9G_(N 4дHMbATr*A(?r~0i99ZeU4m4u;)zx]*geK- ".Zee+ $%hx*vgZǔtO&xFQfGK-iH)/SoA(q@ 26 ǚex)"͸onpeDZs*%BMvȹ<~&O%q2]ZA[ +$@'t ^cnÉIRg[m:7{Pcک ir2r ˶@%)PVLGA*6 Qsc0fAAe&ܠh>( 43c`6jAFncU(\FUɌW;\~ϹË/KWzU $o ".?L3378pD()V?hOIMVo _raA'SoydTq9$z8fR]N"mm-`T|R=Ư-H;NiJA)TJbp@\gQ[M8mQV \W9dp2*C! >=dr4-[\7n$yy *R*>h(4:Z BDh 0V['m˜Aat. =!Mi CfvN#IU݈|a7H<=t@DJf8.B_t gWhR%Ϋ˼ǡf5j\\@%8l\wz`!;` $$jedU M%CۜsƚfFEOD-ٯ\Sԗ$eSa)T=Ek3 ^ BO_YLӠp3x}$T͹Xq-NB6:ãW5s)U(ZJlO uJ|Jmj p咢P<;f<*PMZZthtUHIf;8B#7\1#Oas(xbSGCj'0oL%z_̧I96p!9%)[Jo/xv`_iZd?|v=?PF<ЇЄ~Z4G#)jdM<xS*ߐNw((Hq[e\/o *iPՔ?I.IpGKM0@ۃ31"!i!Q!GQ."Hl `Sstp $%J#Ae串v[ii8LeC؛ їค˼Hc3ڳ,tjAF&U(`7@{X؋@< 6i8 ʅ2]ZZiZ̀f%Tk2%q!DɎ 1#u<6ԶS.ujMaӷgk iJ U0HDԻy<&jM>ön[o>Oú{3_.))yKiB.=ښ\ўs^A]Tmt'aF=K@t%][tGi=Zfku4 Owğ>zN?3`nOH¥n"dHѴ zǤܹ@MϜ/31K8꒧)@qTT7Bd]iLABbi@Zx˛Cq%X{ Q5&iMGyk^ix%WO+ Bp6jR;wFC\Ȕj^u/6~}_0q>y ʷ T ZSQ6bjKL:Pd;tH5.lz+,Xې66KO:W[hzfd .ۘH=tPIȚG]Y*̀SLc{+b.0l.i'HK&L% HxVZPD.zp\6VGѽG$5k&4y}o1Go8mI-XA*iAثvvOԧ-h\笮Rb'Us(~D?!y)(rZctaCIQC iee7GS8v×Q-收Aϭ_OUa6QDٮRyĠMT~@_ zK C#ѰZy)k?m[%G"VUtA~4''!*c T8~-,5&hE*BLj;EZ:Cg.{S-ri هҊTSOG~ \:Gjs) S].+-2[q-@sNP`!18?6!N*F/\o-jy:҇؎p7Hɲ/$ý{u< xNF5t0x Œ 1F(wbl+dܛ΋:7=ce8f1(Dwyj h5Ϥ όhɗqŨ%IR (.]e)uJ8UU+MI!- p~C9ݡMbna۟GNܽh`µ332aM>%)^)T#Oyňބ;E :mm$Vg׈sCuzmO~G-G9ꚛ'- zZRzk/ 8rPg0'FRR&Ir.!Ȳn4i}nFjNlJ@@H ]ȹi&&7nbUkrr# Q;³Np r#B"SYb*6z`UAm_x6m  ) Vց_GRv[SJKb7`'n˜zka:}2mm>Ѹ> r #lo̳8Cν-9CĒ~^fXYNV-=sZG 4p}G,]-Lk͒|oq<||㯒9Av mā";eʮ$J$Qe`+]]C-(zf)آWT8:Cd{[Aώ: gP-Ϊ\A6yĔ9ĤÚmVBүX);mY̊V^r2Zrna. 7 hymޣnmUR-O;C1mR3Fp{f~1u(nDFٞRԫnA>'7ɞgQ1OJ,/A;ķ`eTd *"@,l8eԭRm+:c x5LP䝭S]y֫HV(RL_ҨĻM'BxȺ̹9OLfP<؟iITgkơd)B:ɵ}ѮVȟ9T pFV8:n'1;L q f6;մce'~`6xP^=*LuE'Sl{~ԸCJEZgg-Z5@:lzA7nwMZ4V!Z;NhYMX0]:!1ï;Ƙl*|ac#ԃh\ ڰڊ^fP'^sm@f%8U ZrrYuo !7C6 V˺4cKCYҥ G߼JأL^,h RTv=.)9{[-.;GDeIL(!* l |?0JԮA$L+-䤳, h40$عع#%\􄩵,rvbUŨsc;$ķNd""S^r_;(џ4P}V#E:bܯô9/*0]]=h@(GHJե$Zv1s4I)ڔKiT?}--\ə9yFn6|ic݄VT2ݞˈ TSq@B䒝FX7BFƁi$lnC[k聹Gz"&VaYɊ33tLdCU'"3PNfyl,2(BD Z[Rj*a*ijDYZZJS*Z=l9ٺ%ZVO}rsҎhHZM‡ce}n<#'gUoG4 Ė#a>gٲlc0/qiSg+e$hY*iˁ}e3TɥәeX@<)y8_˶f2K,:څҤADsxs άsUSQneEz ~I.K֏nʁbwʟ<щ+?jVհPxۨkRP>ݜmZi5KvNi.k:iZMҡquF TթšUslF1&uF 'v0K0Mc:@H 5 xjYYqD ͖8"٥nWB9}~hMm?K2<6b9.JTM"Q#؞ᤍCE^wa/%dOm j?pM+1pKV2}Ө ؏dHIh&vYμuT Rئ5's܁iy6ҙ g\NFkl;\O4|ߦ6#-2`L&Uz`c@r^T˪\b׆&h @`۫#>OΙ0UÐZ=csaBxvĵd~LIo\ܸ:#͙DIr/JKEH& ;Z;[ƪJVv7e']ǚNn%IȷYK%aI&?|w;N,G5y[H LH $m`إ/MB,7'Um#@3<H$)Rî4\"qGV;1* wjD~DS90БlJqytTMwy t`l1i֝lRAwMq=񈈛eG-1D#UX#rM azSg> aCGkBT@:Q%p~/UҦNg)>S=GpzPD4e x>/M es*& 67ir=}W,rLû|CE 9S'[!mJl)dA^Z:q<6fy96? )ۄF'3+E ka' ;)*J8S`OA{|cO"ߨ>Ry-crIq2l;ާ\JXm(P-›\ u啼rE̙JC`R\3.-Z;arSӹ*UƁ;t m 6RR@{RR7S),PЙ3ry d\ m"ֹ>]a3[7Bo JTZXPiET"۬"[i "zٵؤÜj) W0wRo NċyD8&jD>zn[[@̄&sM:웩+hI,JrZX06P>qTwlRֶjt{> 0MkuDue47bd0uԒ78{7] ]USH$ |"38?JTWX$XYe U疉T))=8F֛d֥t+|_Q3 \JVѫ^(ʻֱ_KʹǶѧ%8&TztxeCmpV92xv_Zd1Fc2*v(М!-M3P?>?ܥ%fP6UǶ;R[4 JOq.ե .5RS2-x%}ۨ B/pE"=hJVb9MMV X^+P ?tGX_eJaJq6P(a|嘠Qے&@ƒJsh9c=nА|L6gMut1b:Wu${It\s_%Ft'){2*Noԥlc.JKEޙoz2TjiBg*3+qVQ&'^4BP1gNvICI0@SI%k>3iH.*Cr$YPAo^Κ2Guˑ jOiRH,:1z3ߤ_g?P?{ gM&]g"]vM;Ē ܾ軦s(6>*5n.V0n~0wMl~ ¸)b<*m1gPmd—S͹32[ut[V9oY1|0 rUB)[Z;PɲUsӧ\pTHdfтvHQ ^F($ʌfjMRy`eGs &6 CQƥPfzs FN`Fd+ǜ{5"z"wɋSz:TZ$^8|ch*;/%T=J/.l~gYӇF7%$TD4⚔y}u"9J-t$\V_R@QU6ՙ¡.rFj8TzH8zltӛ[!lR}ٚaJ&)!$n]ձ@V8NWNvv"s{@x(]eK0%A |ӓ<>dߗ:Vҵl0⬌M)soM2ʼn^ؐS(}N8.W븴4nP-h%=ԁkt<( %_Yf09Q%D 2_FƑu"S῔)d;1/{tSIji7 옮[XnT&#ժK[Z If%YcZRM￲b $O.L7!#H>•}"xel-nLuDUpHI%JF'ZͅX --nE>wK̬ aҎΐ G8Pm mP0 ֕<P:mzr5QulKp^IvfIi7\ZpiQJ %\(rIl2oMTJ-~]MR®v(SpYJK6䑤s/ZeGe$Ii݇[/\drࢽuT͸ӡƔRAyyŻ[^JÑYԀ,O( m(w^>2dQt垸1Mz$ױ95H'h܉i\M)( WTGF;ş{KjV! LjuemIR4^$哨ovjIuU9"Z-r]>%2 0%8z "MEc9F*:o y??2 J SbY:r>xv_LǑRJԆܝ&Y61'L8=Q%{1)-\qf}1;b+Y.!CY}*1Kc$6b#XNgZ҄; !;66dbEa 11MM ^];x8O쵟 WĪ5Ғ boMXuФ;u:)e{#3bBXp(86-F4=ћST8jXFhq Nuōna%i!4wT_~]*TjuC(59uTq}n|[`W+̟iR2qG-JnaP EmC/yw1:~*R&p^&eRJ3&WmAx94Paiԙfh:@DY}ɊԼe+Wy-F]B H"&}HέЬ *^4*70C:M!R\0 ᙗ]ˑ2E!"хxbq^ZmxйF5xA@ x76Џ }T H!w ׬ƉM3;M xj 1NS)m5ͳ"m𤡪jaycѻOQx ϗ㩰:4`a-f#D0e'~Cxd$ ('&5G4{,4@U% g]yIj㕡e ( ڢ1c'U;Xem |ZeX ˶ &ВQ KɊRZ̪SSǘVJ}$R}Hm|Nǩ2=_rՊuhˤA&ܗ>J R.,wn.UC$)Ek7iHB.MܽmmPN}R,\D✩8 R^؏ 3P\ˈYZ;r"u4CgѸN`..|Aw,Xt `$\D&OT @~yj`pO IF{>7Ck<. ɢ@2S CBqn^^l&::R ¹2 R@;{#F*;BVU |%${aKJP!yD}8 K&ʁ lϿqH N7:6 H 5"(Ys*JO ^ׂ_% I|@#o!h抋^)'T[ K3^;s/ӛz*NJnjFqTIK: #\_911jMIh3 E;G(̙WWtf찥l. 9SZa%VP"ֈcr7i|a&&ĩ03c$KJ 4dY.6x4A؅cii/,pN$DOIfii"FiTQ=R^îw*&mF9oTSUWjL75.)qHtPWTRܲI6j?WqKe}dU%QIRE㝎(Ddc򞬰osu~&t(,l5{Z98mh18[RMϴC˶6JJ)<)uEQGɺRk2k7j>Rv+@'KJ5ye{(qҢ 1v,he7QяӘ~,K@lJ?eK+ í[J*MʺP6cȓ۔m(M-͉0UҮFBw ۔&y.~h]ڋxUDM;b manɉQdܑ=rH*;Z%R.,nNu!*q{IJMQ]V(K ]LMm Öۜ&.4\lnm:-wxh HZrrbfv} lODQR fZIHX6 V٠È:|85\CHϑ<A"f0i;b$y*pX[P>N}®FSx§@8moV]"Ϻ"U I0AhJ6: t2sL8u` w#-3l Xh.:1U-LN25;°h~<(N/3h^4pZ#w>B)!p0C6|`f4-:rq&*$ߤm+mcs s=L1(‘kodǼCK+5>*uwGCL–~B"4Jg-iŸtjNV &|3 ! MÂBHT44dR&b:Hc1h)W,[]U\j >=D6bfZqr<ʂZ}%BX6ͭi:LN+tl2q|i('FT@(la½ i5%C0֓k;f5 h{{xKfBmXiÁonޤ%}HU -t GxyO"( VmlTtLz֤AVO8D0[y{bw-ܥ ؔWIGi,M]IS^ Tڡ^ܺm@B4zwIb$eNdz~}#tM;u>I#.zH9dyA[Of1Y,g\Īu 9ە9>1TJAŎtd= DְVmsiΕU :R?c厚#s=}۳txFtB|I? >%86Uڐ*r:F%u,m,?4Ů܄ TXRS-@7!Bǂin2RW%"cz0mPہ`r8!xެ6Ai)@=mEg5QJ%V7xh1ԛ^JuêCca\j).Wemah涙0HSI>Xn -6!lLQ (BCL ΞdEٚ72b'DɗR06(A̼bVl:6y6!(m@.mrxƘYmB IYSby匳~˃0BQsfL eY!.1kRjSOjMSeW5齏Q|g\:5"7̄"fFNMÒ Q/)(y幁5wTuHt%Cmo/*z]nNM:{ z+`R58Sn;-+Vy2zm+EO-XMYN| E# ack-2.22/t/swamp/perl.pl0000644000175000017500000000024312726365114013544 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 1; BEGIN { use_ok( 'App::Ack' ); } diag( "Testing App::Ack $App::Ack::VERSION, Perl $], $^X" ); ack-2.22/t/swamp/perl.tar.gz0000644000175000017500000000072212726365114014340 0ustar andyandy`0 J[k0_qAnph!amYC&J"FIR{]sɖ#Kp䲫{ڪ =˱C/p=v<;-+rL>?e \1XQ)JiǺT2(E8}BO<=]B{eq</O~2t ͢;6Cǟ?] N;p^o_z5wW\\wٵfBTnM;v\r#X'o BCsNf2I*..E}7*czQlYi_vST%6_vSN;9$I:&4!.Ld+O- tAAAA  F(ack-2.22/t/swamp/swamp/0000755000175000017500000000000013217305507013371 5ustar andyandyack-2.22/t/swamp/swamp/ignoreme.txt0000644000175000017500000000000512726365114015736 0ustar andyandyquux ack-2.22/t/swamp/perl.pm0000644000175000017500000000024312726365114013545 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 1; BEGIN { use_ok( 'App::Ack' ); } diag( "Testing App::Ack $App::Ack::VERSION, Perl $], $^X" ); ack-2.22/t/swamp/file.foo0000644000175000017500000000002412726365114013666 0ustar andyandyThis is a foo file. ack-2.22/t/swamp/crystallography-weenies.f0000644000175000017500000000052312726365114017301 0ustar andyandy PROGRAM FORMAT IMPLICIT NONE REAL :: X CHARACTER (LEN=11) :: FORM1 CHARACTER (LEN=*), PARAMETER :: FORM2 = "( F12.3,A )" FORM1 = "( F12.3,A )" X = 12.0 PRINT FORM1, X, ' HELLO ' WRITE (*, FORM2) 2*X, ' HI ' WRITE (*, "(F12.3,A )") 3*X, ' HI HI ' END ack-2.22/t/swamp/c-source.c0000644000175000017500000000341212726365114014132 0ustar andyandy/* A Bison parser, made from plural.y by GNU Bison version 1.28 */ #define YYBISON 1 /* Identify Bison output. */ /* Contains the magic string --noenv which can be tricky to find. */ #define yyparse __gettextparse #define yylex __gettextlex #define yyerror __gettexterror #define yylval __gettextlval #define yychar __gettextchar #define yydebug __gettextdebug #define yynerrs __gettextnerrs #define EQUOP2 257 #define CMPOP2 258 #define ADDOP2 259 #define MULOP2 260 #define NUMBER 261 #line 1 "plural.y" /* Expression parsing for plural form selection. Copyright (C) 2000, 2001 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* The bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. */ static void yyerror (str) const char *str; { /* Do nothing. We don't print error messages here. */ } ack-2.22/t/swamp/incomplete-last-line.txt0000644000175000017500000000011112726365114017025 0ustar andyandyThis is a file with three lines of text but no new line on the last line!ack-2.22/t/swamp/options-crlf.pl0000755000175000017500000000036712726365114015233 0ustar andyandy#!/usr/bin/env perl use strict; use warnings; =head1 NAME options - Test file for ack command line options =cut [abc] @Q_fields = split(/\b(?:a|b|c)\b/) __DATA__ THIS IS ALL IN UPPER CASE this is a word here notawordhere ack-2.22/t/swamp/Sample.asmx0000644000175000017500000000017712726365114014366 0ustar andyandy<%@ WebService Language="C#" Class="Sample" %> using System; using System.Web.Services; public class Sample : WebService { } ack-2.22/t/swamp/perl-without-extension0000644000175000017500000000014112726365114016642 0ustar andyandy#!/usr/bin/perl -w use strict; use warnings; print "I'm a Perl program without an extension\n"; ack-2.22/t/swamp/c-header.h0000644000175000017500000000052412726365114014070 0ustar andyandy/* perl.h * * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, * 2000, 2001, 2002, 2003, 2004, 2005, 2006, by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. * */ #ifndef H_PERL #define H_PERL 1 ack-2.22/t/swamp/#emacs-workfile.pl#0000644000175000017500000000016012726365114015616 0ustar andyandy#!/usr/bin/perl ## no critic This is a scratch emacs workfile that has a shebang line but should not get read. ack-2.22/t/swamp/minified.js.min0000644000175000017500000000006312726365114015151 0ustar andyandyvar cssDir="./Stylesheets/";var NS4CSS="wango.css" ack-2.22/t/swamp/options.pl0000644000175000017500000000034412726365114014277 0ustar andyandy#!/usr/bin/env perl use strict; use warnings; =head1 NAME options - Test file for ack command line options =cut [abc] @Q_fields = split(/\b(?:a|b|c)\b/) __DATA__ THIS IS ALL IN UPPER CASE this is a word here notawordhere ack-2.22/t/swamp/moose-andy.jpg0000644000175000017500000001720512726365114015030 0ustar andyandyJFIFHHHICC_PROFILE8appl mntrRGB XYZ  acspAPPLappl-appl cprtHdesc1wtptHrTRC\gTRC\bTRC\rXYZlgXYZbXYZvcgt0chad,dscmLdesc sRGB Profile sRGB ProfileXYZ Qcurv3XYZ o8XYZ bXYZ $vcgtHHHsf32 B&ntextCopyright 1998 - 2003 Apple Computer Inc., all rights reserved.mluc enUSesES2daDK pdeDEHfiFIfrFUitITnlNLnoNOptBR2svSEjaJP koKRzhTW zhCN^sRGB-profiilisRGB-profilProfil sRVBsRGB 000000sRGB r_icϏPerfil sRGBsRGB-ProfilsRGB cϏeNsRGB-beskrivelsesRGB-profielsRGB \ |Profilo sRGBsRGB ProfileC   CNd  :!1"AQa #2BRq3 b5 !1AQaq"#2BRb ?ir>s5QM.\Js!o>,]TĞ-7LNiEԚR~zWCR@L6gy%0(ۛXHn|ԃN&f.G}<[b cG$֕Tovo[͕ßS#qs||‚7|*'ZN)W꺗xEƕh!IUTD$ORz?jUTԦ'aNdtz]Dk%o\_̆B ʈh.-1ㇸR74aمytusƠh-RRbH=aŰJErFQbH$42qhZ~*IΨI41 wyӆDdGM|c["0#J*'b Q#sid%""8i/^.vZ5Z#Pa+tj`mԎ[pO3Ƨ0),hVhrNTv"Us'l R?n>FB{ 3&]jƵ9Eس8DT~2xyXC!rtƵF6}ןٴ=F5&O+?$#>Sseeⴶ*`[EM~;eBJ X&Fr9Qv'T(1_j? F7NʂҤ|H ~pt"8z!GΛ-w]6䋮Kr S}-yd.(r[ ֝m&N=VmClENzJqhOkCJi yKӜZSqqn9hxRu]T¼ Tv#s v3ן!PS`HiVB|(c ܬ~XDgM_1Rbl-@HFEýEĸP!~fwK@V}h%{[ƇD6@V=}˴XmrB؅ǧ0ҥFmWsgm\\h,IrJTl>syhlsCʽ-îWڭó3Je(P-nh&u[󊚏uGrZ632VvWٶYU+dB'sNKFt"ͼ|fq5sJU e.A H8mZj7h(}&kiGyk%GCsNTH^0ԍU$Ƈ,RNVgN>դ;q ϶P029{rNA2ÃCc8fRo[G5RJҩSYq+U)+-A9Fr2ьj|>`x47qgv5Uȵzt¥2D8Y҆ךq * \q|89]"S':U>Ѻdݵ}cU(LdBBi}P^TAٷ ) wKo=8C4PWnpzcUimG>ULHR7y%#Hx:eN׍*W1x$6<:}^Z}M6fe.T: 76+L!@K sٌ9f\Jixhp:>1b į~LM7F1|A_[uӦFr?vR+r;<9g:&0SE!CPl)Dt5[dRo8dJe rsEU(4H0٤ԛԨaQ?Ϋ[Ns}d:紩Ԝq3!Ki;+}:T3( u̡\ &$;]r}lbIsJq:A_- ifњ4sVitR8Dp)攝;+s*i*#c>%Qi$;A>X)kBiʘMP>!”%ӌ,*"eҮ;Bu4IɢD !)zlŽ ^zo {M,D۽6t;t r6 PIA3A1/Wk a岘kܤO}uzM6j7_y:Tj7l@cOnj D5N%YnLM"ޠzC5ֿTNu*BL%)R%)g C 0G|㝼h |rտ|XYs5I+yi-U"2 9 ;M+UZq%ҝ۪2gIJab N1aRTB?IT-rTǍyEeƚCT;ޛwS-(n$L\Tf;-M4(O%K%(p0q-;Z(/7Η{7dxl{Z_\'*u!;B yơðv]*)sYǘ׋/uIN{g ʗl?(ʗH6wRqu[KI~[uIO(zBy'=LN[z~a("۞ˬR"LڂSͣ~=P l/!`y% SjY~ZTrTIұDLM<%*9|^C=ziytpMԛΣLd¼a9T2P?6wu3(!*m5JED3a[E뱘J'ki O?Γ`[Ljԧ20ryNb[B;ct6ELkn'UʑPS6-(@((޲ou j:4KrhԢ"3i8#R8H*<t>ƸɑLTd!,r cs)n`ɥBpQܬUpj/&0S 8V0$$0▱$R,%z[Q)!4-PˊH!@d}.̡TRl1.KK(TW[rB4.X=:AS*& C2r*r=GNۜ9L6>Q*:oTH:6ĭiX]jVkF\d%HDɐ[*HC$ 9Ul'VV4/^qAtzIAZ (>B[W)c[(A<'ץDsk'a^1LbwVTp^EB  h艺4,8['s''ߏlii)T[BØHƥ1K=\c0͹)>$K?P[N}K'|wr}N{kֲJCc@Q=xGq' ee tӨ!6fT.CacG<uƟZEBcг2kA5CeS>ϥ11-- AI8*g]ޢ>'l*Yxꤔ)a! qJNq{m4VnuLSwO>-e$Ўxi*Mеܱc4`O;ԛZA ([5%';JM&9-(h^1*N͔!eʜ OU%JO:MR̙NKkR[PYQmPέʺ BRm oު70F>PZzd+f ^Je*”yGr8*:B~=S"mTu}|,,8JHG5HaխɅTZs5<0(6KB!i[L[R[n$@2%,U<+76 GrH.C~:YQ硒 X% *o_XrOM9Mq۩#<|g{+xZ#x> QKT62y ?5SҫK2GH{G}:NMbQ.(-DRZOS8=\ZK2M:IA I=0UC֧~^/;K[jd<5d ˍ`DԢAO\UR }eJ/ 8.kR7Tu0RBe= r/}ZU҈U˯~|2nq5ONc(UE>%lr' - JϬ&uR{ǨiLp  Rg DDSC ]iFIbs*qK8ZNrUQ8C'ڐ?ER)OU=VY!=dNk#IW;}֥)yiAXg!T" pխf#RjH; Fw ~Qo -TUn#3z-D[uTSP4gZ&!8!T4GG.6fր~>XU qh3dFDd!^a9ޢI4ܢRs " )FGack-2.22/t/swamp/fresh.css0000644000175000017500000011534012726365114014073 0ustar andyandyhtml,.wp-dialog{background-color:#fff;}* html input,* html .widget{border-color:#dfdfdf;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#F9F9F9;}#postcustomstuff thead th{background-color:#F1F1F1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#f9f9f9;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,.wp-tab-panel,ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-color:#dfdfdf;background-color:#fff;}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{background-color:#fff;}input.disabled,textarea.disabled{background-color:#ccc;}#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3,.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head,.sidebar-name,#nav-menu-header,#nav-menu-footer,.menu-item-handle,#fullscreen-topbar{background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec);}.widget .widget-top,.postbox h3,.stuffbox h3{border-bottom-color:#dfdfdf;text-shadow:#fff 0 1px 0;-moz-box-shadow:0 1px 0 #fff;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#464646;}.wrap .add-new-h2{background:#f1f1f1;}.subtitle{color:#777;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alternate,.alt{background-color:#fcfcfc;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}div.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}div.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#DFDFDF;}.highlight{background-color:#e4f2fd;color:#000;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#bbb;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#298cba;font-weight:bold;color:#fff;background:#21759B url(../images/button-grad.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#13455b;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#9FD0D5!important;background:#298CBA!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#side-sortables .category-tabs .tabs a,#side-sortables .add-menu-item-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}div.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#B8D3E2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th{border-top-color:#fff;border-bottom-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat td{color:#555;}.widefat p,.widefat ol,.widefat ul{color:#333;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;}th.sortable a:hover,th.sortable a:active,th.sortable a:focus{color:#333;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#21759b;}#adminmenu .awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow{background-color:#464646;color:#fff;-moz-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-khtml-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0;}#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li.current a .awaiting-mod,#adminmenu li a.wp-has-current-submenu .update-plugins{background-color:#464646;color:#fff;-moz-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-khtml-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on,.submitted-on{color:#777;}.login #nav a,.login #backtoblog a{color:#21759b!important;}.login #nav a:hover,.login #backtoblog a:hover{color:#d54e21!important;}#footer{color:#777;border-color:#dfdfdf;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fcfcfc;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#f4f4f4;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.widget,#widget-list .widget-top,.postbox,.menu-item-settings{background-color:#f5f5f5;background-image:-ms-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:-moz-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:-o-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#f5f5f5));background-image:-webkit-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:linear-gradient(top,#f9f9f9,#f5f5f5);}.postbox h3{color:#464646;}.widget .widget-top{color:#222;}.sidebar-name:hover h3,.postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag,.update-nag{background-color:#FFFBCC;border-color:#E6DB55;color:#555;}.login #backtoblog a{color:#464646;}#wphead{border-bottom:#dfdfdf 1px solid;}#wphead h1 a{color:#464646;}#user_info{color:#555;}#user_info:hover,#user_info.active{color:#222;}#user_info.active{background-color:#f1f1f1;background-image:-ms-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:-moz-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:-o-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:-webkit-gradient(linear,left bottom,left top,from(#e9e9e9),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:linear-gradient(bottom,#e9e9e9,#f9f9f9);border-color:#aaa #aaa #dfdfdf;}#user_info_arrow{background:transparent url(../images/arrows.png) no-repeat 6px 5px;}#user_info:hover #user_info_arrow,#user_info.active #user_info_arrow{background:transparent url(../images/arrows-dark.png) no-repeat 6px 5px;}#user_info_links{-moz-box-shadow:0 3px 2px -2px rgba(0,0,0,0.2);-webkit-box-shadow:0 3px 2px -2px rgba(0,0,0,0.2);box-shadow:0 3px 2px -2px rgba(0,0,0,0.2);}#user_info_links ul{background:#f1f1f1;border-color:#ccc #aaa #aaa;-moz-box-shadow:inset 0 1px 0 #f9f9f9;-webkit-box-shadow:inset 0 1px 0 #f9f9f9;box-shadow:inset 0 1px 0 #f9f9f9;}#user_info_links li:hover{background-color:#dfdfdf;}#user_info_links li:hover a,#user_info_links li a:hover{text-decoration:none;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{text-decoration:none;}#footer a:hover{color:#000;text-decoration:underline;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#ccc;background-color:#dfdfdf;background-image:url("../images/ed-bg.gif");}#ed_toolbar input{border-color:#C3C3C3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#dfdfdf;}#poststuff .wp_themeSkin .mceStatusbar *{color:#555;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f1f1f1;border-color:#dfdfdf #dfdfdf #ccc;color:#999;}#poststuff #editor-toolbar .active{border-color:#ccc #ccc #e9e9e9;background-color:#e9e9e9;color:#333;}#post-status-info{background-color:#EDEDED;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin table.mceLayout{border-color:#ccc #ccc #dfdfdf;}#editorcontainer #content,#editorcontainer .wp_themeSkin .mceIframeContainer{-moz-box-shadow:inset 1px 1px 2px rgba(0,0,0,0.1);-webkit-box-shadow:inset 1px 1px 2px rgba(0,0,0,0.1);box-shadow:inset 1px 1px 2px rgba(0,0,0,0.1);}.wp_themeSkin iframe{background:transparent;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{border-color:#ccc;background-color:#eee;background-image:-ms-linear-gradient(bottom,#ddd,#fff);background-image:-moz-linear-gradient(bottom,#ddd,#fff);background-image:-o-linear-gradient(bottom,#ddd,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#fff));background-image:-webkit-linear-gradient(bottom,#ddd,#fff);background-image:linear-gradient(bottom,#ddd,#fff);}.wp_themeSkin a.mceButtonEnabled:hover{border-color:#a0a0a0;background:#ddd;background-image:-ms-linear-gradient(bottom,#ccc,#fff);background-image:-moz-linear-gradient(bottom,#ccc,#fff);background-image:-o-linear-gradient(bottom,#ccc,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(bottom,#ccc,#fff);background-image:linear-gradient(bottom,#ccc,#fff);}.wp_themeSkin a.mceButton:active,.wp_themeSkin a.mceButtonEnabled:active,.wp_themeSkin a.mceButtonSelected:active,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonActive:active,.wp_themeSkin a.mceButtonActive:hover{background-color:#ddd;background-image:-ms-linear-gradient(bottom,#eee,#bbb);background-image:-moz-linear-gradient(bottom,#eee,#bbb);background-image:-o-linear-gradient(bottom,#eee,#bbb);background-image:-webkit-gradient(linear,left bottom,left top,from(#eee),to(#bbb));background-image:-webkit-linear-gradient(bottom,#eee,#bbb);background-image:linear-gradient(bottom,#eee,#bbb);border-color:#909090;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#ccc;background-color:#eee;background-image:-ms-linear-gradient(bottom,#ddd,#fff);background-image:-moz-linear-gradient(bottom,#ddd,#fff);background-image:-o-linear-gradient(bottom,#ddd,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#fff));background-image:-webkit-linear-gradient(bottom,#ddd,#fff);background-image:linear-gradient(bottom,#ddd,#fff);}.wp_themeSkin .mceListBox .mceOpen{border-left:0!important;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxHover:active .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText,.wp_themeSkin table.mceListBoxEnabled:active .mceText{background:#ccc;border-color:#999;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText,.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen{border-color:#909090;background-color:#eee;background-image:-ms-linear-gradient(bottom,#ccc,#fff);background-image:-moz-linear-gradient(bottom,#ccc,#fff);background-image:-o-linear-gradient(bottom,#ccc,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(bottom,#ccc,#fff);background-image:linear-gradient(bottom,#ccc,#fff);}.wp_themeSkin select.mceListBox{border-color:#B2B2B2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#ccc;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{border-color:#909090;}.wp_themeSkin table.mceSplitButton td{background-color:#eee;background-image:-ms-linear-gradient(bottom,#ddd,#fff);background-image:-moz-linear-gradient(bottom,#ddd,#fff);background-image:-o-linear-gradient(bottom,#ddd,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#fff));background-image:-webkit-linear-gradient(bottom,#ddd,#fff);background-image:linear-gradient(bottom,#ddd,#fff);}.wp_themeSkin table.mceSplitButton:hover td{background-image:-ms-linear-gradient(bottom,#ccc,#fff);background-image:-moz-linear-gradient(bottom,#ccc,#fff);background-image:-o-linear-gradient(bottom,#ccc,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(bottom,#ccc,#fff);background-image:linear-gradient(bottom,#ccc,#fff);}.wp_themeSkin .mceSplitButtonActive{background-color:#B2B2B2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0A246A;background-color:#B6BDD2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0A246A;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}.wp_themeSkin tr.mceFirst td.mceToolbar{background:#dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top;border-color:#ccc;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:3px 0 0 0;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:3px;-khtml-border-top-right-radius:3px;-webkit-border-top-right-radius:3px;-moz-border-radius:0 3px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#titlediv #title{border-color:#ccc;}#editorcontainer{border-color:#ccc #ccc #dfdfdf;}#post-status-info{border-color:#dfdfdf #ccc #ccc;}.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#ddd;}#adminmenuback,#adminmenuwrap{background-color:#ececec;border-color:#ccc;}#adminmenushadow,#adminmenuback{background-image:url(../images/menu-shadow.png);background-position:top right;background-repeat:repeat-y;}#adminmenu li.wp-menu-separator{background:#dfdfdf;border-color:#cfcfcf;}#adminmenu div.separator{border-color:#e1e1e1;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/arrows-dark.png) no-repeat -1px 6px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/arrows.png) no-repeat -2px 6px;}#adminmenu a.menu-top,.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#f9f9f9;border-bottom-color:#dfdfdf;}#adminmenu li.wp-menu-open{border-color:#dfdfdf;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,#adminmenu .wp-menu-arrow,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{text-shadow:0 -1px 0 #333;color:#fff;border-top-color:#808080;border-bottom-color:#6d6d6d;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{border-top-color:#808080;border-bottom-color:#6d6d6d;}#adminmenu .wp-submenu a:hover{background-color:#EAF2FA!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu .wp-submenu-wrap,.folded #adminmenu .wp-submenu ul{border-color:#dfdfdf;}.folded #adminmenu .wp-submenu-wrap{-moz-box-shadow:2px 2px 5px rgba(0,0,0,0.4);-webkit-box-shadow:2px 2px 5px rgba(0,0,0,0.4);box-shadow:2px 2px 5px rgba(0,0,0,0.4);}#adminmenu .wp-submenu .wp-submenu-head{border-right-color:#dfdfdf;background-color:#ececec;}#adminmenu div.wp-submenu{background-color:transparent;}#collapse-menu{color:#aaa;}#collapse-menu:hover{color:#999;}#collapse-button{border-color:#ccc;background-color:#f4f4f4;background-image:-ms-linear-gradient(bottom,#dfdfdf,#fff);background-image:-moz-linear-gradient(bottom,#dfdfdf,#fff);background-image:-o-linear-gradient(bottom,#dfdfdf,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#fff));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#fff);background-image:linear-gradient(bottom,#dfdfdf,#fff);}#collapse-menu:hover #collapse-button{border-color:#aaa;}#collapse-button div{background:transparent url(../images/arrows.png) no-repeat 0 -72px;}.folded #collapse-button div{background-position:0 -108px;}#adminmenu .menu-icon-dashboard div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -60px -33px;}#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-dashboard.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -60px -1px;}#adminmenu .menu-icon-post div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -271px -33px;}#adminmenu .menu-icon-post:hover div.wp-menu-image,#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -271px -1px;}#adminmenu .menu-icon-media div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -120px -33px;}#adminmenu .menu-icon-media:hover div.wp-menu-image,#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -120px -1px;}#adminmenu .menu-icon-links div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -90px -33px;}#adminmenu .menu-icon-links:hover div.wp-menu-image,#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -90px -1px;}#adminmenu .menu-icon-page div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -150px -33px;}#adminmenu .menu-icon-page:hover div.wp-menu-image,#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -150px -1px;}#adminmenu .menu-icon-comments div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -30px -33px;}#adminmenu .menu-icon-comments:hover div.wp-menu-image,#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-comments.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -30px -1px;}#adminmenu .menu-icon-appearance div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll 0 -33px;}#adminmenu .menu-icon-appearance:hover div.wp-menu-image,#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll 0 -1px;}#adminmenu .menu-icon-plugins div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -180px -33px;}#adminmenu .menu-icon-plugins:hover div.wp-menu-image,#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -180px -1px;}#adminmenu .menu-icon-users div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -300px -33px;}#adminmenu .menu-icon-users:hover div.wp-menu-image,#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-users.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -300px -1px;}#adminmenu .menu-icon-tools div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -210px -33px;}#adminmenu .menu-icon-tools:hover div.wp-menu-image,#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-tools.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -210px -1px;}#icon-options-general,#adminmenu .menu-icon-settings div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -240px -33px;}#adminmenu .menu-icon-settings:hover div.wp-menu-image,#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -240px -1px;}#adminmenu .menu-icon-site div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -360px -33px;}#adminmenu .menu-icon-site:hover div.wp-menu-image,#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -360px -1px;}#icon-edit,#icon-post{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -492px -5px;}#icon-ms-admin{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -659px -5px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#E4F2FD;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#D54E21;}#screen-options-wrap,#contextual-help-wrap{background-color:#f1f1f1;border-color:#dfdfdf;}#screen-options-link-wrap,#contextual-help-link-wrap{background-color:#e3e3e3;border-right:1px solid transparent;border-left:1px solid transparent;border-bottom:1px solid transparent;background-image:-ms-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-moz-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-o-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#f1f1f1));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:linear-gradient(bottom,#dfdfdf,#f1f1f1);}#screen-meta-links a.show-settings{color:#777;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#E4F2FD!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}div.star img{border-left:1px solid #fff;border-right:1px solid #fff;}.widefat div.star img{border-left:1px solid #f9f9f9;border-right:1px solid #f9f9f9;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#EAF3FA;}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#D54E21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover,.tablenav .tablenav-pages a:focus{color:#d54e21;}.tablenav .tablenav-pages a.disabled,.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:focus{color:#aaa;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-top-color:#fff;border-bottom-color:#dfdfdf;}#minor-publishing{border-bottom-color:#dfdfdf;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a,body.press-this ul.category-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{border-color:#c0c0c0;background:#f1f1f1;background:-moz-linear-gradient(bottom,#e7e7e7,#fff);background:-webkit-gradient(linear,left bottom,left top,from(#e7e7e7),to(#fff));}#favorite-inside{border-color:#c0c0c0;background-color:#fff;}#favorite-toggle{background:transparent url(../images/arrows.png) no-repeat 4px 2px;border-color:#dfdfdf;-moz-box-shadow:inset 1px 0 0 #fff;-webkit-box-shadow:inset 1px 0 0 #fff;box-shadow:inset 1px 0 0 #fff;}#favorite-actions a{color:#464646;}#favorite-actions a:hover{color:#000;}#favorite-inside a:hover{text-decoration:underline;}#screen-meta a.show-settings,.toggle-arrow{background:transparent url(../images/arrows.png) no-repeat right 3px;}#screen-meta .screen-meta-active a.show-settings{background:transparent url(../images/arrows.png) no-repeat right -33px;}.view-switch #view-switch-list{background:transparent url(../images/list.png) no-repeat 0 0;}.view-switch .current #view-switch-list{background:transparent url(../images/list.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -20px 0;}.view-switch .current #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo.png?ver=20110504) no-repeat scroll center center;}.popular-tags,.feature-filter{background-color:#fff;border-color:#DFDFDF;}#theme-information .action-button{border-top-color:#DFDFDF;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#fcfcfc;border-color:#dfdfdf;}#available-widgets .widget-holder{background-color:#fcfcfc;border-color:#dfdfdf;}#available-widgets .widget-description{color:#555;}.sidebar-name{color:#464646;text-shadow:#fff 0 1px 0;border-color:#dfdfdf;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}.sidebar-name-arrow{background:transparent url(../images/arrows.png) no-repeat 5px 9px;}.sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark.png) no-repeat 5px 9px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;}#menu-management .menu-edit{border-color:#dfdfdf;}#post-body{background:#fff;border-top-color:#fff;border-bottom-color:#dfdfdf;}#nav-menu-header{border-bottom-color:#dfdfdf;}#nav-menu-footer{border-top-color:#fff;}#menu-management .nav-tabs-arrow a{color:#C1C1C1;}#menu-management .nav-tabs-arrow a:hover{color:#D54E21;}#menu-management .nav-tabs-arrow a:active{color:#464646;}#menu-management .nav-tab-active{border-color:#dfdfdf;}#menu-management .nav-tab{background:#fbfbfb;border-color:#dfdfdf;}.js .input-with-default-title{color:#aaa;}#cancel-save{color:#f00;}#cancel-save:hover{background-color:#F00;color:#fff;}.list-container{border-color:#DFDFDF;}.menu-item-handle{border-color:#dfdfdf;}.menu li.deleting .menu-item-handle{background-color:#f66;text-shadow:#ccc;}.item-type{color:#999;}.item-controls .menu-item-delete:hover{color:#f00;}.item-edit{background:transparent url(../images/arrows.png) no-repeat 8px 10px;border-bottom-color:#eee;}.item-edit:hover{background:transparent url(../images/arrows-dark.png) no-repeat 8px 10px;}.menu-item-settings{border-color:#dfdfdf;}.link-to-original{color:#777;border-color:#dfdfdf;}#cancel-save:hover{color:#fff!important;}#update-menu-item{color:#fff!important;}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important;}.submitbox .submitcancel{color:#21759B;border-bottom-color:#21759B;}.submitbox .submitcancel:hover{background:#21759B;color:#fff;}#menu-management .nav-tab-active,.menu-item-handle,.menu-item-settings{-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;}#menu-management .nav-tab-active{background:#f9f9f9;border-bottom-color:#f9f9f9;}#upload-form label{color:#777;}.fullscreen-overlay{background:#fff;}.wp-fullscreen-focus #wp-fullscreen-title,.wp-fullscreen-focus #wp-fullscreen-container{border-color:#ccc;}#fullscreen-topbar{border-bottom-color:#DFDFDF;}ack-2.22/t/swamp/Rakefile0000644000175000017500000000420212726365114013711 0ustar andyandyrequire 'rubygems' require 'hoe' def announce(msg='') STDERR.puts msg end PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : '' PKG_NAME = 'mechanize' PKG_VERSION = '0.6.4' + PKG_BUILD Hoe.new(PKG_NAME, PKG_VERSION) do |p| p.rubyforge_name = PKG_NAME p.author = 'Aaron Patterson' p.email = 'aaronp@rubyforge.org' p.summary = "Mechanize provides automated web-browsing" p.description = p.paragraphs_of('README.txt', 3).join("\n\n") p.url = p.paragraphs_of('README.txt', 1).first.strip p.changes = p.paragraphs_of('CHANGELOG.txt', 0..2).join("\n\n") files = (p.test_globs + ['test/**/tc_*.rb', "test/htdocs/**/*.{html,jpg}", 'test/data/server.*']).map { |x| Dir.glob(x) }.flatten + ['test/data/htpasswd'] p.extra_deps = ['hpricot'] p.spec_extras = { :test_files => files } end task :update_version do announce "Updating Mechanize Version to #{PKG_VERSION}" File.open("lib/mechanize/mech_version.rb", "w") do |f| f.puts "module WWW" f.puts " class Mechanize" f.puts " Version = '#{PKG_VERSION}'" f.puts " end" f.puts "end" end sh 'svn commit -m"updating version" lib/mechanize/mech_version.rb' end desc "Tag code" Rake::Task.define_task("tag") do |p| baseurl = "svn+ssh://#{ENV['USER']}@rubyforge.org//var/svn/#{PKG_NAME}" sh "svn cp -m 'tagged #{ PKG_VERSION }' . #{ baseurl }/tags/REL-#{ PKG_VERSION }" end desc "Branch code" Rake::Task.define_task("branch") do |p| baseurl = "svn+ssh://#{ENV['USER']}@rubyforge.org/var/svn/#{PKG_NAME}" sh "svn cp -m 'branched #{ PKG_VERSION }' #{baseurl}/trunk #{ baseurl }/branches/RB-#{ PKG_VERSION }" end desc "Update SSL Certificate" Rake::Task.define_task('ssl_cert') do |p| sh "openssl genrsa -des3 -out server.key 1024" sh "openssl req -new -key server.key -out server.csr" sh "cp server.key server.key.org" sh "openssl rsa -in server.key.org -out server.key" sh "openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt" sh "cp server.key server.pem" sh "mv server.key server.csr server.crt server.pem test/data/" sh "rm server.key.org" end ack-2.22/t/swamp/groceries/0000755000175000017500000000000013217305507014224 5ustar andyandyack-2.22/t/swamp/groceries/RCS/0000755000175000017500000000000013217305507014653 5ustar andyandyack-2.22/t/swamp/groceries/RCS/meat0000644000175000017500000000002212726365114015522 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/RCS/junk0000644000175000017500000000005212726365114015546 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/RCS/fruit0000644000175000017500000000002212726365114015725 0ustar andyandyapple pear grapes ack-2.22/t/swamp/groceries/CVS/0000755000175000017500000000000013217305507014657 5ustar andyandyack-2.22/t/swamp/groceries/CVS/meat0000644000175000017500000000002212726365114015526 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/CVS/junk0000644000175000017500000000005212726365114015552 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/CVS/fruit0000644000175000017500000000002212726365114015731 0ustar andyandyapple pear grapes ack-2.22/t/swamp/groceries/meat0000644000175000017500000000002212726365114015073 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/another_subdir/0000755000175000017500000000000013217305507017234 5ustar andyandyack-2.22/t/swamp/groceries/another_subdir/RCS/0000755000175000017500000000000013217305507017663 5ustar andyandyack-2.22/t/swamp/groceries/another_subdir/RCS/meat0000644000175000017500000000002212726365114020532 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/another_subdir/RCS/junk0000644000175000017500000000005212726365114020556 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/another_subdir/RCS/fruit0000644000175000017500000000002212726365114020735 0ustar andyandyapple pear grapes ack-2.22/t/swamp/groceries/another_subdir/CVS/0000755000175000017500000000000013217305507017667 5ustar andyandyack-2.22/t/swamp/groceries/another_subdir/CVS/meat0000644000175000017500000000002212726365114020536 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/another_subdir/CVS/junk0000644000175000017500000000005212726365114020562 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/another_subdir/CVS/fruit0000644000175000017500000000002212726365114020741 0ustar andyandyapple pear grapes ack-2.22/t/swamp/groceries/another_subdir/meat0000644000175000017500000000002212726365114020103 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/another_subdir/junk0000644000175000017500000000005212726365114020127 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/another_subdir/fruit0000644000175000017500000000002212726365114020306 0ustar andyandyapple pear grapes ack-2.22/t/swamp/groceries/dir.d/0000755000175000017500000000000013217305507015224 5ustar andyandyack-2.22/t/swamp/groceries/dir.d/RCS/0000755000175000017500000000000013217305507015653 5ustar andyandyack-2.22/t/swamp/groceries/dir.d/RCS/meat0000644000175000017500000000002212726365114016522 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/dir.d/RCS/junk0000644000175000017500000000005212726365114016546 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/dir.d/RCS/fruit0000644000175000017500000000002212726365114016725 0ustar andyandyapple pear grapes ack-2.22/t/swamp/groceries/dir.d/CVS/0000755000175000017500000000000013217305507015657 5ustar andyandyack-2.22/t/swamp/groceries/dir.d/CVS/meat0000644000175000017500000000002212726365114016526 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/dir.d/CVS/junk0000644000175000017500000000005212726365114016552 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/dir.d/CVS/fruit0000644000175000017500000000002212726365114016731 0ustar andyandyapple pear grapes ack-2.22/t/swamp/groceries/dir.d/meat0000644000175000017500000000002212726365114016073 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/dir.d/junk0000644000175000017500000000005212726365114016117 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/dir.d/fruit0000644000175000017500000000002212726365114016276 0ustar andyandyapple pear grapes ack-2.22/t/swamp/groceries/subdir/0000755000175000017500000000000013217305507015514 5ustar andyandyack-2.22/t/swamp/groceries/subdir/meat0000644000175000017500000000002212726365114016363 0ustar andyandypork beef chicken ack-2.22/t/swamp/groceries/subdir/junk0000644000175000017500000000005212726365114016407 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/subdir/fruit0000644000175000017500000000002212726365114016566 0ustar andyandyapple pear grapes ack-2.22/t/swamp/groceries/junk0000644000175000017500000000005212726365114015117 0ustar andyandyapple fritters grape jam fried pork rinds ack-2.22/t/swamp/groceries/fruit0000644000175000017500000000002212726365114015276 0ustar andyandyapple pear grapes ack-2.22/t/swamp/stuff.cmake0000644000175000017500000000003512726365114014375 0ustar andyandy# Not actually a cmake file! ack-2.22/t/swamp/blib/0000755000175000017500000000000013217305507013152 5ustar andyandyack-2.22/t/swamp/blib/ignore.pod0000644000175000017500000000024312726365114015144 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 1; BEGIN { use_ok( 'App::Ack' ); } diag( "Testing App::Ack $App::Ack::VERSION, Perl $], $^X" ); ack-2.22/t/swamp/blib/ignore.pir0000644000175000017500000000266512726365114015166 0ustar andyandy=head1 INFORMATION This example shows the usage of C. =head1 FUNCTIONS =over 4 =item _main =cut .sub _main :main .local pmc stream load_bytecode "library/Stream/Sub.pir" load_bytecode "library/Stream/Replay.pir" find_type $I0, "Stream::Sub" new $P0, $I0 # set the stream's source sub .const .Sub temp = "_hello" assign $P0, $P1 find_type $I0,"Stream::Replay" stream = new $I0 assign stream, $P0 $S0 = stream."read_bytes"( 3 ) print "'hel': [" print $S0 print "]\n" stream = clone stream $P0 = clone stream $S0 = stream."read_bytes"( 4 ) print "'lowo': [" print $S0 print "] = " $S0 = $P0."read_bytes"( 4 ) print "[" print $S0 print "]\n" $S0 = stream."read"() print "'rld!': [" print $S0 print "]\n" $S0 = stream."read_bytes"( 100 ) print "'parrotis cool': [" print $S0 print "]\n" end .end =item _hello This sub is used as the source for the stream. It just writes some text to the stream. =cut .sub _hello :method self."write"( "hello" ) self."write"( "world!" ) self."write"( "parrot" ) self."write"( "is cool" ) .end =back =head1 AUTHOR Jens Rieks Eparrot at jensbeimsurfen dot deE is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list. =head1 COPYRIGHT Copyright (C) 2004, The Perl Foundation. =cut ack-2.22/t/swamp/blib/ignore.pm0000644000175000017500000000024312726365114014776 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 1; BEGIN { use_ok( 'App::Ack' ); } diag( "Testing App::Ack $App::Ack::VERSION, Perl $], $^X" ); ack-2.22/t/swamp/sample.rake0000644000175000017500000000017312726365114014374 0ustar andyandytask :ruby_env do RUBY_APP = if RUBY_PLATFORM =~ /java/ "jruby" else "ruby" end unless defined? RUBY_APP end ack-2.22/t/swamp/00000644000175000017500000000017213067372761012335 0ustar andyandy#!/usr/bin/perl -w print "Every Perl programmer knows that 0 evaluates to false, and that it is a recipe for DANGER!\n"; ack-2.22/t/swamp/Makefile0000644000175000017500000000156012726365114013710 0ustar andyandy# This Makefile is for the ack extension to perl. # # It was generated automatically by MakeMaker version # 6.30 (Revision: Revision: 4535 ) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # # ANY CHANGES MADE HERE WILL BE LOST! # # MakeMaker ARGV: () # # MakeMaker Parameters: # ABSTRACT => q[A grep-like program specifically for large source trees] # AUTHOR => q[Andy Lester ] # EXE_FILES => [q[ack]] # MAN3PODS => { } # NAME => q[ack] # PM => { Ack.pm=>q[$(INST_LIBDIR)/App/Ack.pm] } # PREREQ_PM => { Test::More=>q[0], Getopt::Long=>q[0], Term::ANSIColor=>q[0] } # VERSION_FROM => q[Ack.pm] # clean => { FILES=>q[ack-*] } # dist => { COMPRESS=>q[gzip -9f], SUFFIX=>q[gz] } There's not really anything here. It's just to have something that starts out like a makefile. ack-2.22/t/swamp/perl.cgi0000644000175000017500000000024312726365114013673 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 1; BEGIN { use_ok( 'App::Ack' ); } diag( "Testing App::Ack $App::Ack::VERSION, Perl $], $^X" ); ack-2.22/t/swamp/fresh.min.css0000644000175000017500000011534012726365114014655 0ustar andyandyhtml,.wp-dialog{background-color:#fff;}* html input,* html .widget{border-color:#dfdfdf;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#F9F9F9;}#postcustomstuff thead th{background-color:#F1F1F1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#f9f9f9;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,.wp-tab-panel,ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-color:#dfdfdf;background-color:#fff;}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{background-color:#fff;}input.disabled,textarea.disabled{background-color:#ccc;}#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3,.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head,.sidebar-name,#nav-menu-header,#nav-menu-footer,.menu-item-handle,#fullscreen-topbar{background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec);}.widget .widget-top,.postbox h3,.stuffbox h3{border-bottom-color:#dfdfdf;text-shadow:#fff 0 1px 0;-moz-box-shadow:0 1px 0 #fff;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#464646;}.wrap .add-new-h2{background:#f1f1f1;}.subtitle{color:#777;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alternate,.alt{background-color:#fcfcfc;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}div.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}div.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#DFDFDF;}.highlight{background-color:#e4f2fd;color:#000;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#bbb;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#298cba;font-weight:bold;color:#fff;background:#21759B url(../images/button-grad.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#13455b;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#9FD0D5!important;background:#298CBA!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#side-sortables .category-tabs .tabs a,#side-sortables .add-menu-item-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}div.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#B8D3E2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th{border-top-color:#fff;border-bottom-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat td{color:#555;}.widefat p,.widefat ol,.widefat ul{color:#333;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;}th.sortable a:hover,th.sortable a:active,th.sortable a:focus{color:#333;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#21759b;}#adminmenu .awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow{background-color:#464646;color:#fff;-moz-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-khtml-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0;}#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li.current a .awaiting-mod,#adminmenu li a.wp-has-current-submenu .update-plugins{background-color:#464646;color:#fff;-moz-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-khtml-box-shadow:rgba(255,255,255,0.5) 0 1px 0;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on,.submitted-on{color:#777;}.login #nav a,.login #backtoblog a{color:#21759b!important;}.login #nav a:hover,.login #backtoblog a:hover{color:#d54e21!important;}#footer{color:#777;border-color:#dfdfdf;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fcfcfc;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#f4f4f4;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.widget,#widget-list .widget-top,.postbox,.menu-item-settings{background-color:#f5f5f5;background-image:-ms-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:-moz-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:-o-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#f5f5f5));background-image:-webkit-linear-gradient(top,#f9f9f9,#f5f5f5);background-image:linear-gradient(top,#f9f9f9,#f5f5f5);}.postbox h3{color:#464646;}.widget .widget-top{color:#222;}.sidebar-name:hover h3,.postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag,.update-nag{background-color:#FFFBCC;border-color:#E6DB55;color:#555;}.login #backtoblog a{color:#464646;}#wphead{border-bottom:#dfdfdf 1px solid;}#wphead h1 a{color:#464646;}#user_info{color:#555;}#user_info:hover,#user_info.active{color:#222;}#user_info.active{background-color:#f1f1f1;background-image:-ms-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:-moz-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:-o-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:-webkit-gradient(linear,left bottom,left top,from(#e9e9e9),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#e9e9e9,#f9f9f9);background-image:linear-gradient(bottom,#e9e9e9,#f9f9f9);border-color:#aaa #aaa #dfdfdf;}#user_info_arrow{background:transparent url(../images/arrows.png) no-repeat 6px 5px;}#user_info:hover #user_info_arrow,#user_info.active #user_info_arrow{background:transparent url(../images/arrows-dark.png) no-repeat 6px 5px;}#user_info_links{-moz-box-shadow:0 3px 2px -2px rgba(0,0,0,0.2);-webkit-box-shadow:0 3px 2px -2px rgba(0,0,0,0.2);box-shadow:0 3px 2px -2px rgba(0,0,0,0.2);}#user_info_links ul{background:#f1f1f1;border-color:#ccc #aaa #aaa;-moz-box-shadow:inset 0 1px 0 #f9f9f9;-webkit-box-shadow:inset 0 1px 0 #f9f9f9;box-shadow:inset 0 1px 0 #f9f9f9;}#user_info_links li:hover{background-color:#dfdfdf;}#user_info_links li:hover a,#user_info_links li a:hover{text-decoration:none;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{text-decoration:none;}#footer a:hover{color:#000;text-decoration:underline;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#ccc;background-color:#dfdfdf;background-image:url("../images/ed-bg.gif");}#ed_toolbar input{border-color:#C3C3C3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#dfdfdf;}#poststuff .wp_themeSkin .mceStatusbar *{color:#555;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f1f1f1;border-color:#dfdfdf #dfdfdf #ccc;color:#999;}#poststuff #editor-toolbar .active{border-color:#ccc #ccc #e9e9e9;background-color:#e9e9e9;color:#333;}#post-status-info{background-color:#EDEDED;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin table.mceLayout{border-color:#ccc #ccc #dfdfdf;}#editorcontainer #content,#editorcontainer .wp_themeSkin .mceIframeContainer{-moz-box-shadow:inset 1px 1px 2px rgba(0,0,0,0.1);-webkit-box-shadow:inset 1px 1px 2px rgba(0,0,0,0.1);box-shadow:inset 1px 1px 2px rgba(0,0,0,0.1);}.wp_themeSkin iframe{background:transparent;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{border-color:#ccc;background-color:#eee;background-image:-ms-linear-gradient(bottom,#ddd,#fff);background-image:-moz-linear-gradient(bottom,#ddd,#fff);background-image:-o-linear-gradient(bottom,#ddd,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#fff));background-image:-webkit-linear-gradient(bottom,#ddd,#fff);background-image:linear-gradient(bottom,#ddd,#fff);}.wp_themeSkin a.mceButtonEnabled:hover{border-color:#a0a0a0;background:#ddd;background-image:-ms-linear-gradient(bottom,#ccc,#fff);background-image:-moz-linear-gradient(bottom,#ccc,#fff);background-image:-o-linear-gradient(bottom,#ccc,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(bottom,#ccc,#fff);background-image:linear-gradient(bottom,#ccc,#fff);}.wp_themeSkin a.mceButton:active,.wp_themeSkin a.mceButtonEnabled:active,.wp_themeSkin a.mceButtonSelected:active,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonActive:active,.wp_themeSkin a.mceButtonActive:hover{background-color:#ddd;background-image:-ms-linear-gradient(bottom,#eee,#bbb);background-image:-moz-linear-gradient(bottom,#eee,#bbb);background-image:-o-linear-gradient(bottom,#eee,#bbb);background-image:-webkit-gradient(linear,left bottom,left top,from(#eee),to(#bbb));background-image:-webkit-linear-gradient(bottom,#eee,#bbb);background-image:linear-gradient(bottom,#eee,#bbb);border-color:#909090;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#ccc;background-color:#eee;background-image:-ms-linear-gradient(bottom,#ddd,#fff);background-image:-moz-linear-gradient(bottom,#ddd,#fff);background-image:-o-linear-gradient(bottom,#ddd,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#fff));background-image:-webkit-linear-gradient(bottom,#ddd,#fff);background-image:linear-gradient(bottom,#ddd,#fff);}.wp_themeSkin .mceListBox .mceOpen{border-left:0!important;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxHover:active .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText,.wp_themeSkin table.mceListBoxEnabled:active .mceText{background:#ccc;border-color:#999;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText,.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen{border-color:#909090;background-color:#eee;background-image:-ms-linear-gradient(bottom,#ccc,#fff);background-image:-moz-linear-gradient(bottom,#ccc,#fff);background-image:-o-linear-gradient(bottom,#ccc,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(bottom,#ccc,#fff);background-image:linear-gradient(bottom,#ccc,#fff);}.wp_themeSkin select.mceListBox{border-color:#B2B2B2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#ccc;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{border-color:#909090;}.wp_themeSkin table.mceSplitButton td{background-color:#eee;background-image:-ms-linear-gradient(bottom,#ddd,#fff);background-image:-moz-linear-gradient(bottom,#ddd,#fff);background-image:-o-linear-gradient(bottom,#ddd,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#fff));background-image:-webkit-linear-gradient(bottom,#ddd,#fff);background-image:linear-gradient(bottom,#ddd,#fff);}.wp_themeSkin table.mceSplitButton:hover td{background-image:-ms-linear-gradient(bottom,#ccc,#fff);background-image:-moz-linear-gradient(bottom,#ccc,#fff);background-image:-o-linear-gradient(bottom,#ccc,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(bottom,#ccc,#fff);background-image:linear-gradient(bottom,#ccc,#fff);}.wp_themeSkin .mceSplitButtonActive{background-color:#B2B2B2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0A246A;background-color:#B6BDD2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0A246A;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}.wp_themeSkin tr.mceFirst td.mceToolbar{background:#dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top;border-color:#ccc;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:3px 0 0 0;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:3px;-khtml-border-top-right-radius:3px;-webkit-border-top-right-radius:3px;-moz-border-radius:0 3px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#titlediv #title{border-color:#ccc;}#editorcontainer{border-color:#ccc #ccc #dfdfdf;}#post-status-info{border-color:#dfdfdf #ccc #ccc;}.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#ddd;}#adminmenuback,#adminmenuwrap{background-color:#ececec;border-color:#ccc;}#adminmenushadow,#adminmenuback{background-image:url(../images/menu-shadow.png);background-position:top right;background-repeat:repeat-y;}#adminmenu li.wp-menu-separator{background:#dfdfdf;border-color:#cfcfcf;}#adminmenu div.separator{border-color:#e1e1e1;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/arrows-dark.png) no-repeat -1px 6px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/arrows.png) no-repeat -2px 6px;}#adminmenu a.menu-top,.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#f9f9f9;border-bottom-color:#dfdfdf;}#adminmenu li.wp-menu-open{border-color:#dfdfdf;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,#adminmenu .wp-menu-arrow,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{text-shadow:0 -1px 0 #333;color:#fff;border-top-color:#808080;border-bottom-color:#6d6d6d;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{border-top-color:#808080;border-bottom-color:#6d6d6d;}#adminmenu .wp-submenu a:hover{background-color:#EAF2FA!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu .wp-submenu-wrap,.folded #adminmenu .wp-submenu ul{border-color:#dfdfdf;}.folded #adminmenu .wp-submenu-wrap{-moz-box-shadow:2px 2px 5px rgba(0,0,0,0.4);-webkit-box-shadow:2px 2px 5px rgba(0,0,0,0.4);box-shadow:2px 2px 5px rgba(0,0,0,0.4);}#adminmenu .wp-submenu .wp-submenu-head{border-right-color:#dfdfdf;background-color:#ececec;}#adminmenu div.wp-submenu{background-color:transparent;}#collapse-menu{color:#aaa;}#collapse-menu:hover{color:#999;}#collapse-button{border-color:#ccc;background-color:#f4f4f4;background-image:-ms-linear-gradient(bottom,#dfdfdf,#fff);background-image:-moz-linear-gradient(bottom,#dfdfdf,#fff);background-image:-o-linear-gradient(bottom,#dfdfdf,#fff);background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#fff));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#fff);background-image:linear-gradient(bottom,#dfdfdf,#fff);}#collapse-menu:hover #collapse-button{border-color:#aaa;}#collapse-button div{background:transparent url(../images/arrows.png) no-repeat 0 -72px;}.folded #collapse-button div{background-position:0 -108px;}#adminmenu .menu-icon-dashboard div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -60px -33px;}#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-dashboard.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -60px -1px;}#adminmenu .menu-icon-post div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -271px -33px;}#adminmenu .menu-icon-post:hover div.wp-menu-image,#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -271px -1px;}#adminmenu .menu-icon-media div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -120px -33px;}#adminmenu .menu-icon-media:hover div.wp-menu-image,#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -120px -1px;}#adminmenu .menu-icon-links div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -90px -33px;}#adminmenu .menu-icon-links:hover div.wp-menu-image,#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -90px -1px;}#adminmenu .menu-icon-page div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -150px -33px;}#adminmenu .menu-icon-page:hover div.wp-menu-image,#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -150px -1px;}#adminmenu .menu-icon-comments div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -30px -33px;}#adminmenu .menu-icon-comments:hover div.wp-menu-image,#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-comments.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -30px -1px;}#adminmenu .menu-icon-appearance div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll 0 -33px;}#adminmenu .menu-icon-appearance:hover div.wp-menu-image,#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll 0 -1px;}#adminmenu .menu-icon-plugins div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -180px -33px;}#adminmenu .menu-icon-plugins:hover div.wp-menu-image,#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -180px -1px;}#adminmenu .menu-icon-users div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -300px -33px;}#adminmenu .menu-icon-users:hover div.wp-menu-image,#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-users.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -300px -1px;}#adminmenu .menu-icon-tools div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -210px -33px;}#adminmenu .menu-icon-tools:hover div.wp-menu-image,#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-tools.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -210px -1px;}#icon-options-general,#adminmenu .menu-icon-settings div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -240px -33px;}#adminmenu .menu-icon-settings:hover div.wp-menu-image,#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -240px -1px;}#adminmenu .menu-icon-site div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -360px -33px;}#adminmenu .menu-icon-site:hover div.wp-menu-image,#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -360px -1px;}#icon-edit,#icon-post{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -492px -5px;}#icon-ms-admin{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -659px -5px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#E4F2FD;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#D54E21;}#screen-options-wrap,#contextual-help-wrap{background-color:#f1f1f1;border-color:#dfdfdf;}#screen-options-link-wrap,#contextual-help-link-wrap{background-color:#e3e3e3;border-right:1px solid transparent;border-left:1px solid transparent;border-bottom:1px solid transparent;background-image:-ms-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-moz-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-o-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#f1f1f1));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:linear-gradient(bottom,#dfdfdf,#f1f1f1);}#screen-meta-links a.show-settings{color:#777;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#E4F2FD!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}div.star img{border-left:1px solid #fff;border-right:1px solid #fff;}.widefat div.star img{border-left:1px solid #f9f9f9;border-right:1px solid #f9f9f9;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#EAF3FA;}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#D54E21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover,.tablenav .tablenav-pages a:focus{color:#d54e21;}.tablenav .tablenav-pages a.disabled,.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:focus{color:#aaa;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-top-color:#fff;border-bottom-color:#dfdfdf;}#minor-publishing{border-bottom-color:#dfdfdf;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a,body.press-this ul.category-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{border-color:#c0c0c0;background:#f1f1f1;background:-moz-linear-gradient(bottom,#e7e7e7,#fff);background:-webkit-gradient(linear,left bottom,left top,from(#e7e7e7),to(#fff));}#favorite-inside{border-color:#c0c0c0;background-color:#fff;}#favorite-toggle{background:transparent url(../images/arrows.png) no-repeat 4px 2px;border-color:#dfdfdf;-moz-box-shadow:inset 1px 0 0 #fff;-webkit-box-shadow:inset 1px 0 0 #fff;box-shadow:inset 1px 0 0 #fff;}#favorite-actions a{color:#464646;}#favorite-actions a:hover{color:#000;}#favorite-inside a:hover{text-decoration:underline;}#screen-meta a.show-settings,.toggle-arrow{background:transparent url(../images/arrows.png) no-repeat right 3px;}#screen-meta .screen-meta-active a.show-settings{background:transparent url(../images/arrows.png) no-repeat right -33px;}.view-switch #view-switch-list{background:transparent url(../images/list.png) no-repeat 0 0;}.view-switch .current #view-switch-list{background:transparent url(../images/list.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -20px 0;}.view-switch .current #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo.png?ver=20110504) no-repeat scroll center center;}.popular-tags,.feature-filter{background-color:#fff;border-color:#DFDFDF;}#theme-information .action-button{border-top-color:#DFDFDF;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#fcfcfc;border-color:#dfdfdf;}#available-widgets .widget-holder{background-color:#fcfcfc;border-color:#dfdfdf;}#available-widgets .widget-description{color:#555;}.sidebar-name{color:#464646;text-shadow:#fff 0 1px 0;border-color:#dfdfdf;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}.sidebar-name-arrow{background:transparent url(../images/arrows.png) no-repeat 5px 9px;}.sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark.png) no-repeat 5px 9px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;}#menu-management .menu-edit{border-color:#dfdfdf;}#post-body{background:#fff;border-top-color:#fff;border-bottom-color:#dfdfdf;}#nav-menu-header{border-bottom-color:#dfdfdf;}#nav-menu-footer{border-top-color:#fff;}#menu-management .nav-tabs-arrow a{color:#C1C1C1;}#menu-management .nav-tabs-arrow a:hover{color:#D54E21;}#menu-management .nav-tabs-arrow a:active{color:#464646;}#menu-management .nav-tab-active{border-color:#dfdfdf;}#menu-management .nav-tab{background:#fbfbfb;border-color:#dfdfdf;}.js .input-with-default-title{color:#aaa;}#cancel-save{color:#f00;}#cancel-save:hover{background-color:#F00;color:#fff;}.list-container{border-color:#DFDFDF;}.menu-item-handle{border-color:#dfdfdf;}.menu li.deleting .menu-item-handle{background-color:#f66;text-shadow:#ccc;}.item-type{color:#999;}.item-controls .menu-item-delete:hover{color:#f00;}.item-edit{background:transparent url(../images/arrows.png) no-repeat 8px 10px;border-bottom-color:#eee;}.item-edit:hover{background:transparent url(../images/arrows-dark.png) no-repeat 8px 10px;}.menu-item-settings{border-color:#dfdfdf;}.link-to-original{color:#777;border-color:#dfdfdf;}#cancel-save:hover{color:#fff!important;}#update-menu-item{color:#fff!important;}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important;}.submitbox .submitcancel{color:#21759B;border-bottom-color:#21759B;}.submitbox .submitcancel:hover{background:#21759B;color:#fff;}#menu-management .nav-tab-active,.menu-item-handle,.menu-item-settings{-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;}#menu-management .nav-tab-active{background:#f9f9f9;border-bottom-color:#f9f9f9;}#upload-form label{color:#777;}.fullscreen-overlay{background:#fff;}.wp-fullscreen-focus #wp-fullscreen-title,.wp-fullscreen-focus #wp-fullscreen-container{border-color:#ccc;}#fullscreen-topbar{border-bottom-color:#DFDFDF;}ack-2.22/t/swamp/not-an-#emacs-workfile#0000644000175000017500000000017712726365114016406 0ustar andyandyThis is NOT a scratch emacs workfile. It sort of looks like one, but it's not. The filename kind of matches, but not really. ack-2.22/t/swamp/notes.md0000644000175000017500000000004312726365114013715 0ustar andyandy# Notes * One * Two * Three ack-2.22/t/swamp/pipe-stress-freaks.F0000644000175000017500000000052312726365114016104 0ustar andyandy PROGRAM FORMAT IMPLICIT NONE REAL :: X CHARACTER (LEN=11) :: FORM1 CHARACTER (LEN=*), PARAMETER :: FORM2 = "( F12.3,A )" FORM1 = "( F12.3,A )" X = 12.0 PRINT FORM1, X, ' HELLO ' WRITE (*, FORM2) 2*X, ' HI ' WRITE (*, "(F12.3,A )") 3*X, ' HI HI ' END ack-2.22/t/swamp/options.pl.bak0000644000175000017500000000035612726365114015036 0ustar andyandy#!/usr/bin/env perl use strict; use warnings; =head1 NAME Backup of options - Test file for ack command line options =cut [abc] @Q_fields = split(/\b(?:a|b|c)\b/) __DATA__ THIS IS ALL IN UPPER CASE this is a word here notawordhere ack-2.22/t/ack-line.t0000644000175000017500000001160013216123637012762 0ustar andyandy#!perl -T use warnings; use strict; use Test::More; use lib 't'; use Util; if ( not has_io_pty() ) { plan skip_all => q{You need to install IO::Pty to run this test}; exit(0); } plan tests => 16; prep_environment(); LINE_6_AND_3: { my @expected = line_split( <<'HERE' ); and to petition the Government for a redress of grievances. Congress shall make no law respecting an establishment of religion, HERE my @files = qw( t/text/bill-of-rights.txt ); my @args = qw( --lines=6 --lines=3 ); ack_sets_match( [ @args, @files ], \@expected, 'Looking for lines 1 and 5' ); } LINES_WITH_A_COMMA: { my @expected = line_split( <<'HERE' ); Congress shall make no law respecting an establishment of religion, and to petition the Government for a redress of grievances. HERE my @files = qw( t/text/bill-of-rights.txt ); my @args = ( '--lines=3,6' ); ack_sets_match( [ @args, @files ], \@expected, 'Looking for lines with a comma' ); } LINES_WITH_A_RANGE: { my @expected = line_split( <<'HERE' ); Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances. HERE my @files = qw( t/text/bill-of-rights.txt ); my @args = qw( --lines=3-6 ); ack_sets_match( [ @args, @files ], \@expected, 'Looking for lines 3 to 6' ); } LINES_WITH_CONTEXT: { my @expected = line_split( <<'HERE' ); of that House shall agree to pass the Bill, it shall be sent, together with the Objections, to the other House, by which it shall likewise be reconsidered, and if approved by two thirds of that House, it shall become a Law. But in all such Cases the Votes of both Houses shall be determined by Yeas and Nays, and the Names of the Persons voting for and against the Bill shall be entered on the Journal of each House respectively. If any Bill shall not be returned by the President within ten Days (Sundays HERE my @files = qw( t/text/constitution.txt ); my @args = qw( --lines=156 -C3 ); ack_lists_match( [ @files, @args ], \@expected, 'Looking for line 3 with two lines of context' ); } LINES_THAT_MAY_BE_NON_EXISTENT: { my @expected = line_split( <<'HERE' ); "For the love of God, Montresor!" "A mason," I replied. HERE my @files = qw( t/text/amontillado.txt ); my @args = ( '--lines=309,200,1000' ); ack_sets_match( [ @args, @files ], \@expected, 'Looking for non existent line' ); } LINE_AND_PASSTHRU: { my @expected = line_split( <<'HERE' ); =head1 Dummy document =head2 There's important stuff in here! HERE my @files = qw( t/swamp/perl.pod ); my @args = qw( --lines=2 --passthru ); ack_lists_match( [ @args, @files ], \@expected, 'Checking --passthru behaviour with --line' ); } LINE_1_MULTIPLE_FILES: { my @target_file = map { reslash( $_ ) } qw( t/swamp/c-header.h t/swamp/c-source.c ); my @expected = line_split( <<"HERE" ); $target_file[0]:1:/* perl.h $target_file[1]:1:/* A Bison parser, made from plural.y HERE my @files = qw( t/swamp/ ); my @args = qw( --cc --lines=1 ); ack_sets_match( [ @args, @files ], \@expected, 'Looking for first line in multiple files' ); } LINE_1_CONTEXT: { my @target_file = map { reslash( $_ ) } qw( t/swamp/c-header.h t/swamp/c-source.c ); my @expected = line_split( <<"HERE" ); $target_file[0]:1:/* perl.h $target_file[0]-2- * $target_file[0]-3- * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, $target_file[0]-4- * 2000, 2001, 2002, 2003, 2004, 2005, 2006, by Larry Wall and others -- $target_file[1]:1:/* A Bison parser, made from plural.y $target_file[1]-2- by GNU Bison version 1.28 */ $target_file[1]-3- $target_file[1]-4-#define YYBISON 1 /* Identify Bison output. */ HERE my @files = qw( t/swamp/ ); my @args = qw( --cc --lines=1 --after=3 --sort ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for first line in multiple files' ); } LINE_NO_WARNINGS: { my @expected = ( 'Well, my daddy left home when I was three', ); my @files = qw( t/text/boy-named-sue.txt ); my @args = qw( --lines=1 ); my @output = run_ack_interactive( @args, @files ); is scalar(@output), 1, 'There must be exactly one line of output (with no warnings)'; } LINE_WITH_REGEX: { # Specifying both --line and a regex should result in an error. my @files = qw( t/text/boy-named-sue.txt ); my @args = qw( --lines=1 --match Sue ); my ($stdout, $stderr) = run_ack_with_stderr( @args, @files ); isnt( get_rc(), 0, 'Specifying both --line and --match must lead to an error RC' ); is_empty_array( $stdout, 'No normal output' ); is( scalar @{$stderr}, 1, 'One line of stderr output' ); like( $stderr->[0], qr/\Q(Sue)/, 'Error message must contain "(Sue)"' ); } done_testing(); ack-2.22/t/ack-dump.t0000644000175000017500000000130413213376747013011 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Util; use Test::More tests => 5; use App::Ack::ConfigDefault; prep_environment(); DUMP: { my @expected = App::Ack::ConfigDefault::options_clean(); my @args = qw( --dump ); my @results = run_ack( @args ); is( $results[0], 'Defaults', 'header should be Defaults' ); splice @results, 0, 2; # remove header (2 lines) s/^\s*// for @results; sets_match( \@results, \@expected, __FILE__ ); my @perl = grep { /\bperl\b/ } @results; is( scalar @perl, 2, 'Two specs for Perl' ); my @ignore_dir = grep { /ignore-dir/ } @results; is( scalar @ignore_dir, 24, 'Twenty-four specs for ignoring directories' ); } ack-2.22/t/firstlinematch-filter.t0000644000175000017500000000124513213376747015613 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use FilterTest; use Test::More tests => 1; use App::Ack::Filter::FirstLineMatch; filter_test( [ firstlinematch => '/^#!.*perl/' ], [ 't/swamp/#emacs-workfile.pl#', 't/swamp/0', 't/swamp/Makefile.PL', 't/swamp/options-crlf.pl', 't/swamp/options.pl', 't/swamp/options.pl.bak', 't/swamp/perl-test.t', 't/swamp/perl-without-extension', 't/swamp/perl.cgi', 't/swamp/perl.pl', 't/swamp/perl.pm', 't/swamp/blib/ignore.pm', 't/swamp/blib/ignore.pod', ], 'only files with "perl" in their first line should be matched' ); ack-2.22/t/lua-shebang.t0000644000175000017500000000035413213376747013502 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 1; use Util; prep_environment(); ack_sets_match( [ '--lua', '-f', 't/swamp' ], [ 't/swamp/lua-shebang-test' ], 'Lua files should be detected by shebang' ); ack-2.22/t/text/0000755000175000017500000000000013217305507012077 5ustar andyandyack-2.22/t/text/amontillado.txt0000644000175000017500000003120313212422426015135 0ustar andyandy# The Cask of Amontillado, by Edgar Allen Poe The thousand injuries of Fortunato I had borne as I best could; but when he ventured upon insult, I vowed revenge. You, who so well know the nature of my soul, will not suppose, however, that I gave utterance to a threat. At length I would be avenged; this was a point definitively settled--but the very definitiveness with which it was resolved, precluded the idea of risk. I must not only punish, but punish with impunity. A wrong is unredressed when retribution overtakes its redresser. It is equally unredressed when the avenger fails to make himself felt as such to him who has done the wrong. It must be understood, that neither by word nor deed had I given Fortunato cause to doubt my good will. I continued, as was my wont, to smile in his face, and he did not perceive that my smile now was at the thought of his immolation. He had a weak point--this Fortunato--although in other regards he was a man to be respected and even feared. He prided himself on his connoisseurship in wine. Few Italians have the true virtuoso spirit. For the most part their enthusiasm is adopted to suit the time and opportunity--to practise imposture upon the British and Austrian millionaires. In painting and gemmary Fortunato, like his countrymen, was a quack--but in the matter of old wines he was sincere. In this respect I did not differ from him materially: I was skilful in the Italian vintages myself, and bought largely whenever I could. It was about dusk, one evening during the supreme madness of the carnival season, that I encountered my friend. He accosted me with excessive warmth, for he had been drinking much. The man wore motley. He had on a tight-fitting parti-striped dress, and his head was surmounted by the conical cap and bells. I was so pleased to see him, that I thought I should never have done wringing his hand. I said to him--"My dear Fortunato, you are luckily met. How remarkably well you are looking to-day! But I have received a pipe of what passes for Amontillado, and I have my doubts." "How?" said he. "Amontillado? A pipe! Impossible! And in the middle of the carnival!" "I have my doubts," I replied; "and I was silly enough to pay the full Amontillado price without consulting you in the matter. You were not to be found, and I was fearful of losing a bargain." "Amontillado!" "I have my doubts." "Amontillado!" "And I must satisfy them." "Amontillado!" "As you are engaged, I am on my way to Luchesi. If any one has a critical turn, it is he. He will tell me--" "Luchesi cannot tell Amontillado from Sherry." "And yet some fools will have it that his taste is a match for your own." "Come, let us go." "Whither?" "To your vaults." "My friend, no; I will not impose upon your good nature. I perceive you have an engagement. Luchesi--" "I have no engagement;--come." "My friend, no. It is not the engagement, but the severe cold with which I perceive you are afflicted. The vaults are insufferably damp. They are encrusted with nitre." "Let us go, nevertheless. The cold is merely nothing. Amontillado! You have been imposed upon. And as for Luchesi, he cannot distinguish Sherry from Amontillado." Thus speaking, Fortunato possessed himself of my arm. Putting on a mask of black silk, and drawing a roquelaire closely about my person, I suffered him to hurry me to my palazzo. There were no attendants at home; they had absconded to make merry in honor of the time. I had told them that I should not return until the morning, and had given them explicit orders not to stir from the house. These orders were sufficient, I well knew, to insure their immediate disappearance, one and all, as soon as my back was turned. I took from their sconces two flambeaux, and giving one to Fortunato, bowed him through several suites of rooms to the archway that led into the vaults. I passed down a long and winding staircase, requesting him to be cautious as he followed. We came at length to the foot of the descent, and stood together on the damp ground of the catacombs of the Montresors. The gait of my friend was unsteady, and the bells upon his cap jingled as he strode. "The pipe," said he. "It is farther on," said I; "but observe the white web-work which gleams from these cavern walls." He turned towards me, and looked into my eyes with two filmy orbs that distilled the rheum of intoxication. "Nitre?" he asked, at length. "Nitre," I replied. "How long have you had that cough?" "Ugh! ugh! ugh!--ugh! ugh! ugh!--ugh! ugh! ugh!--ugh! ugh! ugh!--ugh! ugh! ugh!" My poor friend found it impossible to reply for many minutes. "It is nothing," he said, at last. "Come," I said, with decision, "we will go back; your health is precious. You are rich, respected, admired, beloved; you are happy, as once I was. You are a man to be missed. For me it is no matter. We will go back; you will be ill, and I cannot be responsible. Besides, there is Luchesi--" "Enough," he said; "the cough is a mere nothing; it will not kill me. I shall not die of a cough." "True--true," I replied; "and, indeed, I had no intention of alarming you unnecessarily--but you should use all proper caution. A draught of this Medoc will defend us from the damps." Here I knocked off the neck of a bottle which I drew from a long row of its fellows that lay upon the mould. "Drink," I said, presenting him the wine. He raised it to his lips with a leer. He paused and nodded to me familiarly, while his bells jingled. "I drink," he said, "to the buried that repose around us." "And I to your long life." He again took my arm, and we proceeded. "These vaults," he said, "are extensive." "The Montresors," I replied, "were a great and numerous family." "I forget your arms." "A huge human foot d'or, in a field azure; the foot crushes a serpent rampant whose fangs are imbedded in the heel." "And the motto?" "Nemo me impune lacessit." "Good!" he said. The wine sparkled in his eyes and the bells jingled. My own fancy grew warm with the Medoc. We had passed through walls of piled bones, with casks and puncheons intermingling, into the inmost recesses of the catacombs. I paused again, and this time I made bold to seize Fortunato by an arm above the elbow. "The nitre!" I said; "see, it increases. It hangs like moss upon the vaults. We are below the river's bed. The drops of moisture trickle among the bones. Come, we will go back ere it is too late. Your cough--" "It is nothing," he said; "let us go on. But first, another draught of the Medoc." I broke and reached him a flaçon of De Grâve. He emptied it at a breath. His eyes flashed with a fierce light. He laughed and threw the bottle upwards with a gesticulation I did not understand. I looked at him in surprise. He repeated the movement--a grotesque one. "You do not comprehend?" he said. "Not I," I replied. "Then you are not of the brotherhood." "How?" "You are not of the masons." "Yes, yes," I said, "yes, yes." "You? Impossible! A mason?" "A mason," I replied. "A sign," he said. "It is this," I answered, producing a trowel from beneath the folds of my roquelaire. "You jest," he exclaimed, recoiling a few paces. "But let us proceed to the Amontillado." "Be it so," I said, replacing the tool beneath the cloak, and again offering him my arm. He leaned upon it heavily. We continued our route in search of the Amontillado. We passed through a range of low arches, descended, passed on, and descending again, arrived at a deep crypt, in which the foulness of the air caused our flambeaux rather to glow than flame. At the most remote end of the crypt there appeared another less spacious. Its walls had been lined with human remains, piled to the vault overhead, in the fashion of the great catacombs of Paris. Three sides of this interior crypt were still ornamented in this manner. From the fourth side the bones had been thrown down, and lay promiscuously upon the earth, forming at one point a mound of some size. Within the wall thus exposed by the displacing of the bones, we perceived a still interior recess, in depth about four feet, in width three, in height six or seven. It seemed to have been constructed for no especial use within itself, but formed merely the interval between two of the colossal supports of the roof of the catacombs, and was backed by one of their circumscribing walls of solid granite. It was in vain that Fortunato, uplifting his dull torch, endeavored to pry into the depth of the recess. Its termination the feeble light did not enable us to see. "Proceed," I said; "herein is the Amontillado. As for Luchesi--" "He is an ignoramus," interrupted my friend, as he stepped unsteadily forward, while I followed immediately at his heels. In an instant he had reached the extremity of the niche, and finding his progress arrested by the rock, stood stupidly bewildered. A moment more and I had fettered him to the granite. In its surface were two iron staples, distant from each other about two feet, horizontally. From one of these depended a short chain, from the other a padlock. Throwing the links about his waist, it was but the work of a few seconds to secure it. He was too much astounded to resist. Withdrawing the key I stepped back from the recess. "Pass your hand," I said, "over the wall; you cannot help feeling the nitre. Indeed it is very damp. Once more let me implore you to return. No? Then I must positively leave you. But I must first render you all the little attentions in my power." "The Amontillado!" ejaculated my friend, not yet recovered from his astonishment. "True," I replied; "the Amontillado." As I said these words I busied myself among the pile of bones of which I have before spoken. Throwing them aside, I soon uncovered a quantity of building stone and mortar. With these materials and with the aid of my trowel, I began vigorously to wall up the entrance of the niche. I had scarcely laid the first tier of the masonry when I discovered that the intoxication of Fortunato had in a great measure worn off. The earliest indication I had of this was a low moaning cry from the depth of the recess. It was not the cry of a drunken man. There was then a long and obstinate silence. I laid the second tier, and the third, and the fourth; and then I heard the furious vibrations of the chain. The noise lasted for several minutes, during which, that I might hearken to it with the more satisfaction, I ceased my labors and sat down upon the bones. When at last the clanking subsided, I resumed the trowel, and finished without interruption the fifth, the sixth, and the seventh tier. The wall was now nearly upon a level with my breast. I again paused, and holding the flambeaux over the mason-work, threw a few feeble rays upon the figure within. A succession of loud and shrill screams, bursting suddenly from the throat of the chained form, seemed to thrust me violently back. For a brief moment I hesitated--I trembled. Unsheathing my rapier, I began to grope with it about the recess: but the thought of an instant reassured me. I placed my hand upon the solid fabric of the catacombs, and felt satisfied. I reapproached the wall. I replied to the yells of him who clamored. I re-echoed--I aided--I surpassed them in volume and in strength. I did this, and the clamorer grew still. It was now midnight, and my task was drawing to a close. I had completed the eighth, the ninth, and the tenth tier. I had finished a portion of the last and the eleventh; there remained but a single stone to be fitted and plastered in. I struggled with its weight; I placed it partially in its destined position. But now there came from out the niche a low laugh that erected the hairs upon my head. It was succeeded by a sad voice, which I had difficulty in recognising as that of the noble Fortunate. The voice said-- "Ha! ha! ha!--he! he!--a very good joke indeed--an excellent jest. We will have many a rich laugh about it at the palazzo--he! he! he!--over our wine--he! he! he!" "The Amontillado!" I said. "He! he! he!--he! he! he!--yes, the Amontillado. But is it not getting late? Will not they be awaiting us at the palazzo, the Lady Fortunato and the rest? Let us be gone." "Yes,"I said, "let us be gone." "For the love of God, Montresor!" "Yes," I said, "for the love of God!" But to these words I hearkened in vain for a reply. I grew impatient. I called aloud-- "Fortunato!" No answer. I called again-- "Fortunato!" No answer still. I thrust a torch through the remaining aperture and let it fall within. There came forth in return only a jingling of the bells. My heart grew sick--on account of the dampness of the catacombs. I hastened to make an end of my labor. I forced the last stone into its position; I plastered it up. Against the new masonry I re-erected the old rampart of bones. For the half of a century no mortal has disturbed them. In pace requiescat! ack-2.22/t/text/ozymandias.txt0000644000175000017500000000116313212422426015012 0ustar andyandyI met a traveller from an antique land Who said: Two vast and trunkless legs of stone Stand in the desert... Near them, on the sand, Half sunk, a shattered visage lies, whose frown, And wrinkled lip, and sneer of cold command, Tell that its sculptor well those passions read Which yet survive, stamped on these lifeless things, The hand that mocked them, and the heart that fed: And on the pedestal these words appear: 'My name is Ozymandias, king of kings: Look on my works, ye Mighty, and despair!' Nothing beside remains. Round the decay Of that colossal wreck, boundless and bare The lone and level sands stretch far away. ack-2.22/t/text/raven.txt0000644000175000017500000001431713212422426013754 0ustar andyandyOnce upon a midnight dreary, while I pondered, weak and weary, Over many a quaint and curious volume of forgotten lore, -- While I nodded, nearly napping, suddenly there came a tapping, As of some one gently rapping, rapping at my chamber door. "'Tis some visitor," I muttered, "tapping at my chamber door; Only this and nothing more." Ah, distinctly I remember it was in the bleak December And each separate dying ember wrought its ghost upon the floor. Eagerly I wished the morrow; -- vainly I had sought to borrow From my books surcease of sorrow -- sorrow for the lost Lenore, For the rare and radiant maiden whom the angels name Lenore: Nameless here for evermore. And the silken sad uncertain rustling of each purple curtain Thrilled me -- filled me with fantastic terrors never felt before; So that now, to still the beating of my heart, I stood repeating "'T is some visitor entreating entrance at my chamber door, Some late visitor entreating entrance at my chamber door: This it is and nothing more." Presently my soul grew stronger; hesitating then no longer, "Sir," said I, "or Madam, truly your forgiveness I implore; But the fact is I was napping, and so gently you came rapping, And so faintly you came tapping, tapping at my chamber door, That I scarce was sure I heard you" -- here I opened wide the door: -- Darkness there and nothing more. Deep into that darkness peering, long I stood there wondering, fearing, Doubting, dreaming dreams no mortals ever dared to dream before; But the silence was unbroken, and the stillness gave no token, And the only word there spoken was the whispered word, "Lenore?" This I whispered, and an echo murmured back the word, "Lenore:" Merely this and nothing more. Back into the chamber turning, all my soul within me burning, Soon again I heard a tapping somewhat louder than before. "Surely," said I, "surely that is something at my window lattice; Let me see, then, what thereat is, and this mystery explore; Let my heart be still a moment and this mystery explore: 'T is the wind and nothing more." Open here I flung the shutter, when, with many a flirt and flutter, In there stepped a stately Raven of the saintly days of yore. Not the least obeisance made he; not a minute stopped or stayed he; But, with mien of lord or lady, perched above my chamber door, Perched upon a bust of Pallas just above my chamber door: Perched, and sat, and nothing more. Then this ebony bird beguiling my sad fancy into smiling By the grave and stern decorum of the countenance it wore, "Though thy crest be shorn and shaven, thou," I said, "art sure no craven, Ghastly grim and ancient Raven wandering from the Nightly shore: Tell me what thy lordly name is on the Night's Plutonian shore!" Quoth the Raven, "Nevermore." Much I marvelled this ungainly fowl to hear discourse so plainly, Though its answer little meaning -- little relevancy bore; For we cannot help agreeing that no living human being Ever yet was blessed with seeing bird above his chamber door, Bird or beast upon the sculptured bust above his chamber door, With such name as "Nevermore." But the Raven, sitting lonely on the placid bust, spoke only That one word, as if his soul in that one word he did outpour. Nothing further then he uttered, not a feather then he fluttered, Till I scarcely more than muttered, -- "Other friends have flown before; On the morrow he will leave me, as my Hopes have flown before." Then the bird said, "Nevermore." Startled at the stillness broken by reply so aptly spoken, "Doubtless," said I, "what it utters is its only stock and store, Caught from some unhappy master whom unmerciful Disaster Followed fast and followed faster till his songs one burden bore: Till the dirges of his Hope that melancholy burden bore Of 'Never -- nevermore.' But the Raven still beguiling all my fancy into smiling, Straight I wheeled a cushioned seat in front of bird and bust and door; Then, upon the velvet sinking, I betook myself to linking Fancy unto fancy, thinking what this ominous bird of yore, What this grim, ungainly, ghastly, gaunt, and ominous bird of yore Meant in croaking "Nevermore." This I sat engaged in guessing, but no syllable expressing To the fowl whose fiery eyes now burned into my bosom's core; This and more I sat divining, with my head at ease reclining On the cushion's velvet lining that the lamplight gloated o'er, But whose velvet violet lining with the lamp-light gloating o'er She shall press, ah, nevermore! Then, methought, the air grew denser, perfumed from an unseen censer Swung by seraphim whose foot-falls tinkled on the tufted floor. "Wretch," I cried, "thy God hath lent thee -- by these angels he hath sent thee Respite-respite and nepenthe from thy memories of Lenore!" Quaff, oh quaff this kind nepenthe, and forget this lost Lenore." Quoth the Raven, "Nevermore." "Prophet!" said I, "thing of evil! prophet still, if bird or devil! Whether Tempter sent, or whether tempest tossed thee here ashore, Desolate yet all undaunted, on this desert land enchanted On this home by Horror haunted -- tell me truly, I implore: Is there -- is there balm in Gilead? -- tell me -- tell me, I implore!" Quoth the Raven, "Nevermore." "Prophet!" said I, "thing of evil -- prophet still, if bird or devil! By that Heaven that bends above us, by that God we both adore, Tell this soul with sorrow laden if, within the distant Aidenn, It shall clasp a sainted maiden whom the angels name Lenore: Clasp a rare and radiant maiden whom the angels name Lenore!" Quoth the Raven, "Nevermore." "Be that word our sign of parting, bird or fiend!" I shrieked, upstarting: "Get thee back into the tempest and the Night's Plutonian shore! Leave no black plume as a token of that lie thy soul hath spoken! Leave my loneliness unbroken! quit the bust above my door! Take thy beak from out my heart, and take thy form from off my door!" Quoth the Raven, "Nevermore." And the Raven, never flitting, still is sitting, still is sitting On the pallid bust of Pallas just above my chamber door; And his eyes have all the seeming of a demon's that is dreaming, And the lamp-light o'er him streaming throws his shadow on the floor: And my soul from out that shadow that lies floating on the floor Shall be lifted--nevermore! ack-2.22/t/text/numbered-text.txt0000644000175000017500000000050012726365114015422 0ustar andyandyThis is line 01 This is line 02 This is line 03 This is line 04 This is line 05 This is line 06 This is line 07 This is line 08 This is line 09 This is line 10 This is line 11 This is line 12 This is line 13 This is line 14 This is line 15 This is line 16 This is line 17 This is line 18 This is line 19 This is line 20 ack-2.22/t/text/number.txt0000644000175000017500000000000613066014025014116 0ustar andyandy86700 ack-2.22/t/text/gettysburg.txt0000644000175000017500000000270413212422426015035 0ustar andyandyFour score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -- that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government of the people, by the people, for the people, shall not perish from the earth. ack-2.22/t/text/bill-of-rights.txt0000644000175000017500000000541213212422426015457 0ustar andyandy# Amendment I Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances. # Amendment II A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed. # Amendment III No Soldier shall, in time of peace be quartered in any house, without the consent of the Owner, nor in time of war, but in a manner to be prescribed by law. # Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. # Amendment V No person shall be held to answer for a capital, or otherwise infamous crime, unless on a presentment or indictment of a Grand Jury, except in cases arising in the land or naval forces, or in the Militia, when in actual service in time of War or public danger; nor shall any person be subject for the same offence to be twice put in jeopardy of life or limb; nor shall be compelled in any criminal case to be a witness against himself, nor be deprived of life, liberty, or property, without due process of law; nor shall private property be taken for public use, without just compensation. # Amendment VI In all criminal prosecutions, the accused shall enjoy the right to a speedy and public trial, by an impartial jury of the State and district wherein the crime shall have been committed, which district shall have been previously ascertained by law, and to be informed of the nature and cause of the accusation; to be confronted with the witnesses against him; to have compulsory process for obtaining witnesses in his favor, and to have the Assistance of Counsel for his defence. # Amendment VII In Suits at common law, where the value in controversy shall exceed twenty dollars, the right of trial by jury shall be preserved, and no fact tried by a jury, shall be otherwise re-examined in any Court of the United States, than according to the rules of the common law. # Amendment VIII Excessive bail shall not be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted. # Amendment IX The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people. # Amendment X The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people. ack-2.22/t/text/constitution.txt0000644000175000017500000006216613212422426015410 0ustar andyandy# Preamble We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defense, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America. # Article I ## Section 1 All legislative Powers herein granted shall be vested in a Congress of the United States, which shall consist of a Senate and House of Representatives. ## Section 2 The House of Representatives shall be composed of Members chosen every second Year by the People of the several States, and the Electors in each State shall have the Qualifications requisite for Electors of the most numerous Branch of the State Legislature. No Person shall be a Representative who shall not have attained to the Age of twenty five Years, and been seven Years a Citizen of the United States, and who shall not, when elected, be an Inhabitant of that State in which he shall be chosen. Representatives and direct Taxes shall be apportioned among the several States which may be included within this Union, according to their respective Numbers, which shall be determined by adding to the whole Number of free Persons, including those bound to Service for a Term of Years, and excluding Indians not taxed, three fifths of all other Persons. The actual Enumeration shall be made within three Years after the first Meeting of the Congress of the United States, and within every subsequent Term of ten Years, in such Manner as they shall by Law direct. The Number of Representatives shall not exceed one for every thirty Thousand, but each State shall have at Least one Representative; and until such enumeration shall be made, the State of New Hampshire shall be entitled to chuse three, Massachusetts eight, Rhode-Island and Providence Plantations one, Connecticut five, New-York six, New Jersey four, Pennsylvania eight, Delaware one, Maryland six, Virginia ten, North Carolina five, South Carolina five, and Georgia three. When vacancies happen in the Representation from any State, the Executive Authority thereof shall issue Writs of Election to fill such Vacancies. The House of Representatives shall chuse their Speaker and other Officers; and shall have the sole Power of Impeachment. ## Section 3 The Senate of the United States shall be composed of two Senators from each State, chosen by the Legislature thereof, for six Years; and each Senator shall have one Vote. Immediately after they shall be assembled in Consequence of the first Election, they shall be divided as equally as may be into three Classes. The Seats of the Senators of the first Class shall be vacated at the Expiration of the second Year, of the second Class at the Expiration of the fourth Year, and of the third Class at the Expiration of the sixth Year, so that one third may be chosen every second Year; and if Vacancies happen by Resignation, or otherwise, during the Recess of the Legislature of any State, the Executive thereof may make temporary Appointments until the next Meeting of the Legislature, which shall then fill such Vacancies. No Person shall be a Senator who shall not have attained to the Age of thirty Years, and been nine Years a Citizen of the United States, and who shall not, when elected, be an Inhabitant of that State for which he shall be chosen. The Vice President of the United States shall be President of the Senate, but shall have no Vote, unless they be equally divided. The Senate shall chuse their other Officers, and also a President pro tempore, in the Absence of the Vice President, or when he shall exercise the Office of President of the United States. The Senate shall have the sole Power to try all Impeachments. When sitting for that Purpose, they shall be on Oath or Affirmation. When the President of the United States is tried, the Chief Justice shall preside: And no Person shall be convicted without the Concurrence of two thirds of the Members present. Judgment in Cases of Impeachment shall not extend further than to removal from Office, and disqualification to hold and enjoy any Office of honor, Trust or Profit under the United States: but the Party convicted shall nevertheless be liable and subject to Indictment, Trial, Judgment and Punishment, according to Law. ## Section 4 The Times, Places and Manner of holding Elections for Senators and Representatives, shall be prescribed in each State by the Legislature thereof; but the Congress may at any time by Law make or alter such Regulations, except as to the Places of chusing Senators. The Congress shall assemble at least once in every Year, and such Meeting shall be on the first Monday in December, unless they shall by Law appoint a different Day. ## Section 5 Each House shall be the Judge of the Elections, Returns and Qualifications of its own Members, and a Majority of each shall constitute a Quorum to do Business; but a smaller Number may adjourn from day to day, and may be authorized to compel the Attendance of absent Members, in such Manner, and under such Penalties as each House may provide. Each House may determine the Rules of its Proceedings, punish its Members for disorderly Behaviour, and, with the Concurrence of two thirds, expel a Member. Each House shall keep a Journal of its Proceedings, and from time to time publish the same, excepting such Parts as may in their Judgment require Secrecy; and the Yeas and Nays of the Members of either House on any question shall, at the Desire of one fifth of those Present, be entered on the Journal. Neither House, during the Session of Congress, shall, without the Consent of the other, adjourn for more than three days, nor to any other Place than that in which the two Houses shall be sitting. ## Section 6 The Senators and Representatives shall receive a Compensation for their Services, to be ascertained by Law, and paid out of the Treasury of the United States. They shall in all Cases, except Treason, Felony and Breach of the Peace, be privileged from Arrest during their Attendance at the Session of their respective Houses, and in going to and returning from the same; and for any Speech or Debate in either House, they shall not be questioned in any other Place. No Senator or Representative shall, during the Time for which he was elected, be appointed to any civil Office under the Authority of the United States, which shall have been created, or the Emoluments whereof shall have been encreased during such time; and no Person holding any Office under the United States, shall be a Member of either House during his Continuance in Office. ## Section 7 All Bills for raising Revenue shall originate in the House of Representatives; but the Senate may propose or concur with Amendments as on other Bills. Every Bill which shall have passed the House of Representatives and the Senate, shall, before it become a Law, be presented to the President of the United States: If he approve he shall sign it, but if not he shall return it, with his Objections to that House in which it shall have originated, who shall enter the Objections at large on their Journal, and proceed to reconsider it. If after such Reconsideration two thirds of that House shall agree to pass the Bill, it shall be sent, together with the Objections, to the other House, by which it shall likewise be reconsidered, and if approved by two thirds of that House, it shall become a Law. But in all such Cases the Votes of both Houses shall be determined by Yeas and Nays, and the Names of the Persons voting for and against the Bill shall be entered on the Journal of each House respectively. If any Bill shall not be returned by the President within ten Days (Sundays excepted) after it shall have been presented to him, the Same shall be a Law, in like Manner as if he had signed it, unless the Congress by their Adjournment prevent its Return, in which Case it shall not be a Law. Every Order, Resolution, or Vote to which the Concurrence of the Senate and House of Representatives may be necessary (except on a question of Adjournment) shall be presented to the President of the United States; and before the Same shall take Effect, shall be approved by him, or being disapproved by him, shall be repassed by two thirds of the Senate and House of Representatives, according to the Rules and Limitations prescribed in the Case of a Bill. ## Section 8 The Congress shall have Power To lay and collect Taxes, Duties, Imposts and Excises, to pay the Debts and provide for the common Defence and general Welfare of the United States; but all Duties, Imposts and Excises shall be uniform throughout the United States; To borrow Money on the credit of the United States; To regulate Commerce with foreign Nations, and among the several States, and with the Indian Tribes; To establish an uniform Rule of Naturalization, and uniform Laws on the subject of Bankruptcies throughout the United States; To coin Money, regulate the Value thereof, and of foreign Coin, and fix the Standard of Weights and Measures; To provide for the Punishment of counterfeiting the Securities and current Coin of the United States; To establish Post Offices and post Roads; To promote the Progress of Science and useful Arts, by securing for limited Times to Authors and Inventors the exclusive Right to their respective Writings and Discoveries; To constitute Tribunals inferior to the supreme Court; To define and punish Piracies and Felonies committed on the high Seas, and Offences against the Law of Nations; To declare War, grant Letters of Marque and Reprisal, and make Rules concerning Captures on Land and Water; To raise and support Armies, but no Appropriation of Money to that Use shall be for a longer Term than two Years; To provide and maintain a Navy; To make Rules for the Government and Regulation of the land and naval Forces; To provide for calling forth the Militia to execute the Laws of the Union, suppress Insurrections and repel Invasions; To provide for organizing, arming, and disciplining, the Militia, and for governing such Part of them as may be employed in the Service of the United States, reserving to the States respectively, the Appointment of the Officers, and the Authority of training the Militia according to the discipline prescribed by Congress; To exercise exclusive Legislation in all Cases whatsoever, over such District (not exceeding ten Miles square) as may, by Cession of particular States, and the Acceptance of Congress, become the Seat of the Government of the United States, and to exercise like Authority over all Places purchased by the Consent of the Legislature of the State in which the Same shall be, for the Erection of Forts, Magazines, Arsenals, dock-Yards, and other needful Buildings;-And To make all Laws which shall be necessary and proper for carrying into Execution the foregoing Powers, and all other Powers vested by this Constitution in the Government of the United States, or in any Department or Officer thereof. ## Section 9 The Migration or Importation of such Persons as any of the States now existing shall think proper to admit, shall not be prohibited by the Congress prior to the Year one thousand eight hundred and eight, but a Tax or duty may be imposed on such Importation, not exceeding ten dollars for each Person. The Privilege of the Writ of Habeas Corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it. No Bill of Attainder or ex post facto Law shall be passed. No Capitation, or other direct, Tax shall be laid, unless in Proportion to the Census or enumeration herein before directed to be taken. No Tax or Duty shall be laid on Articles exported from any State. No Preference shall be given by any Regulation of Commerce or Revenue to the Ports of one State over those of another; nor shall Vessels bound to, or from, one State, be obliged to enter, clear, or pay Duties in another. No Money shall be drawn from the Treasury, but in Consequence of Appropriations made by Law; and a regular Statement and Account of the Receipts and Expenditures of all public Money shall be published from time to time. No Title of Nobility shall be granted by the United States: And no Person holding any Office of Profit or Trust under them, shall, without the Consent of the Congress, accept of any present, Emolument, Office, or Title, of any kind whatever, from any King, Prince, or foreign State. ## Section 10 No State shall enter into any Treaty, Alliance, or Confederation; grant Letters of Marque and Reprisal; coin Money; emit Bills of Credit; make any Thing but gold and silver Coin a Tender in Payment of Debts; pass any Bill of Attainder, ex post facto Law, or Law impairing the Obligation of Contracts, or grant any Title of Nobility. No State shall, without the Consent of the Congress, lay any Imposts or Duties on Imports or Exports, except what may be absolutely necessary for executing its inspection Laws: and the net Produce of all Duties and Imposts, laid by any State on Imports or Exports, shall be for the Use of the Treasury of the United States; and all such Laws shall be subject to the Revision and Control of the Congress. No State shall, without the Consent of Congress, lay any Duty of Tonnage, keep Troops, or Ships of War in time of Peace, enter into any Agreement or Compact with another State, or with a foreign Power, or engage in War, unless actually invaded, or in such imminent Danger as will not admit of delay. # Article II ## Section 1 The executive Power shall be vested in a President of the United States of America. He shall hold his Office during the Term of four Years, and, together with the Vice President, chosen for the same Term, be elected, as follows: Each State shall appoint, in such Manner as the Legislature thereof may direct, a Number of Electors, equal to the whole Number of Senators and Representatives to which the State may be entitled in the Congress: but no Senator or Representative, or Person holding an Office of Trust or Profit under the United States, shall be appointed an Elector. The Electors shall meet in their respective States, and vote by Ballot for two Persons, of whom one at least shall not be an Inhabitant of the same State with themselves. And they shall make a List of all the Persons voted for, and of the Number of Votes for each; which List they shall sign and certify, and transmit sealed to the Seat of the Government of the United States, directed to the President of the Senate. The President of the Senate shall, in the Presence of the Senate and House of Representatives, open all the Certificates, and the Votes shall then be counted. The Person having the greatest Number of Votes shall be the President, if such Number be a Majority of the whole Number of Electors appointed; and if there be more than one who have such Majority, and have an equal Number of Votes, then the House of Representatives shall immediately chuse by Ballot one of them for President; and if no Person have a Majority, then from the five highest on the List the said House shall in like Manner chuse the President. But in chusing the President, the Votes shall be taken by States, the Representatives from each State having one Vote; a quorum for this Purpose shall consist of a Member or Members from two thirds of the States, and a Majority of all the States shall be necessary to a Choice. In every Case, after the Choice of the President, the Person having the greatest Number of Votes of the Electors shall be the Vice President. But if there should remain two or more who have equal Votes, the Senate shall chuse from them by Ballot the Vice-President. The Congress may determine the Time of chusing the Electors, and the Day on which they shall give their Votes; which Day shall be the same throughout the United States. No Person except a natural born Citizen, or a Citizen of the United States, at the time of the Adoption of this Constitution, shall be eligible to the Office of President; neither shall any person be eligible to that Office who shall not have attained to the Age of thirty five Years, and been fourteen Years a Resident within the United States. In Case of the Removal of the President from Office, or of his Death, Resignation, or Inability to discharge the Powers and Duties of the said Office, the Same shall devolve on the Vice President, and the Congress may by Law provide for the Case of Removal, Death, Resignation or Inability, both of the President and Vice President, declaring what Officer shall then act as President, and such Officer shall act accordingly, until the Disability be removed, or a President shall be elected. The President shall, at stated Times, receive for his Services, a Compensation, which shall neither be encreased nor diminished during the Period for which he shall have been elected, and he shall not receive within that Period any other Emolument from the United States, or any of them. Before he enter on the Execution of his Office, he shall take the following Oath or Affirmation:-"I do solemnly swear (or affirm) that I will faithfully execute the Office of President of the United States, and will to the best of my Ability, preserve, protect and defend the Constitution of the United States." ## Section 2 The President shall be Commander in Chief of the Army and Navy of the United States, and of the Militia of the several States, when called into the actual Service of the United States; he may require the Opinion, in writing, of the principal Officer in each of the executive Departments, upon any Subject relating to the Duties of their respective Offices, and he shall have Power to Grant Reprieves and Pardons for Offences against the United States, except in Cases of Impeachment. He shall have Power, by and with the Advice and Consent of the Senate, to make Treaties, provided two thirds of the Senators present concur; and he shall nominate, and by and with the Advice and Consent of the Senate, shall appoint Ambassadors, other public Ministers and Consuls, Judges of the supreme Court, and all other Officers of the United States, whose Appointments are not herein otherwise provided for, and which shall be established by Law: but the Congress may by Law vest the Appointment of such inferior Officers, as they think proper, in the President alone, in the Courts of Law, or in the Heads of Departments. The President shall have Power to fill up all Vacancies that may happen during the Recess of the Senate, by granting Commissions which shall expire at the End of their next Session. ## Section 3 He shall from time to time give to the Congress Information on the State of the Union, and recommend to their Consideration such Measures as he shall judge necessary and expedient; he may, on extraordinary Occasions, convene both Houses, or either of them, and in Case of Disagreement between them, with Respect to the Time of Adjournment, he may adjourn them to such Time as he shall think proper; he shall receive Ambassadors and other public Ministers; he shall take Care that the Laws be faithfully executed, and shall Commission all the Officers of the United States. ## Section 4 The President, Vice President and all Civil Officers of the United States, shall be removed from Office on Impeachment for, and Conviction of, Treason, Bribery, or other high Crimes and Misdemeanors. # Article III ## Section 1 The judicial Power of the United States, shall be vested in one supreme Court, and in such inferior Courts as the Congress may from time to time ordain and establish. The Judges, both of the supreme and inferior Courts, shall hold their Offices during good Behaviour, and shall, at stated Times, receive for their Services, a Compensation, which shall not be diminished during their Continuance in Office. ## Section 2 The judicial Power shall extend to all Cases, in Law and Equity, arising under this Constitution, the Laws of the United States, and Treaties made, or which shall be made, under their Authority; -- to all Cases affecting Ambassadors, other public ministers and Consuls; -- to all Cases of admiralty and maritime Jurisdiction; -- to Controversies to which the United States shall be a Party; -- to Controversies between two or more States; -- between a State and Citizens of another State; -- between Citizens of different States; -- between Citizens of the same State claiming Lands under Grants of different States, and between a State, or the Citizens thereof, and foreign States, Citizens or Subjects. In all Cases affecting Ambassadors, other public Ministers and Consuls, and those in which a State shall be Party, the supreme Court shall have original Jurisdiction. In all the other Cases before mentioned, the supreme Court shall have appellate Jurisdiction, both as to Law and Fact, with such Exceptions, and under such Regulations as the Congress shall make. The Trial of all Crimes, except in Cases of Impeachment, shall be by Jury; and such Trial shall be held in the State where the said Crimes shall have been committed; but when not committed within any State, the Trial shall be at such Place or Places as the Congress may by Law have directed. ## Section 3 Treason against the United States, shall consist only in levying War against them, or in adhering to their Enemies, giving them Aid and Comfort. No Person shall be convicted of Treason unless on the Testimony of two Witnesses to the same overt Act, or on Confession in open Court. The Congress shall have Power to declare the Punishment of Treason, but no Attainder of Treason shall work Corruption of Blood, or Forfeiture except during the Life of the Person attainted. # Article IV ## Section 1 Full Faith and Credit shall be given in each State to the public Acts, Records, and judicial Proceedings of every other State. And the Congress may by general Laws prescribe the Manner in which such Acts, Records and Proceedings shall be proved, and the Effect thereof. ## Section 2 The Citizens of each State shall be entitled to all Privileges and Immunities of Citizens in the several States. A Person charged in any State with Treason, Felony, or other Crime, who shall flee from Justice, and be found in another State, shall on Demand of the executive Authority of the State from which he fled, be delivered up, to be removed to the State having Jurisdiction of the Crime. No Person held to Service or Labour in one State, under the Laws thereof, escaping into another, shall, in Consequence of any Law or Regulation therein, be discharged from such Service or Labour, but shall be delivered up on Claim of the Party to whom such Service or Labour may be due. ## Section 3 New States may be admitted by the Congress into this Union; but no new State shall be formed or erected within the Jurisdiction of any other State; nor any State be formed by the Junction of two or more States, or Parts of States, without the Consent of the Legislatures of the States concerned as well as of the Congress. The Congress shall have Power to dispose of and make all needful Rules and Regulations respecting the Territory or other Property belonging to the United States; and nothing in this Constitution shall be so construed as to Prejudice any Claims of the United States, or of any particular State. ## Section 4 The United States shall guarantee to every State in this Union a Republican Form of Government, and shall protect each of them against Invasion; and on Application of the Legislature, or of the Executive (when the Legislature cannot be convened) against domestic Violence. # Article V The Congress, whenever two thirds of both Houses shall deem it necessary, shall propose Amendments to this Constitution, or, on the Application of the Legislatures of two thirds of the several States, shall call a Convention for proposing Amendments, which, in either Case, shall be valid to all Intents and Purposes, as Part of this Constitution, when ratified by the Legislatures of three fourths of the several States, or by Conventions in three fourths thereof, as the one or the other Mode of Ratification may be proposed by the Congress; Provided that no Amendment which may be made prior to the Year One thousand eight hundred and eight shall in any Manner affect the first and fourth Clauses in the Ninth Section of the first Article; and that no State, without its Consent, shall be deprived of its equal Suffrage in the Senate. # Article VI All Debts contracted and Engagements entered into, before the Adoption of this Constitution, shall be as valid against the United States under this Constitution, as under the Confederation. This Constitution, and the Laws of the United States which shall be made in Pursuance thereof; and all Treaties made, or which shall be made, under the Authority of the United States, shall be the supreme Law of the Land; and the Judges in every State shall be bound thereby, any Thing in the Constitution or Laws of any state to the Contrary notwithstanding. The Senators and Representatives before mentioned, and the Members of the several State Legislatures, and all executive and judicial Officers, both of the United States and of the several States, shall be bound by Oath or Affirmation, to support this Constitution; but no religious Test shall ever be required as a Qualification to any Office or public Trust under the United States. # Article VII The Ratification of the Conventions of nine States, shall be sufficient for the Establishment of this Constitution between the States so ratifying the Same. ack-2.22/t/runtests.pl0000644000175000017500000000126412726365114013346 0ustar andyandy#! /usr/bin/perl #--------------------------------------------------------------------- # Run tests for ack # # Windows makes it hard to temporarily set environment variables, and # has horrible quoting rules, so what should be a one-liner gets its # own script. #--------------------------------------------------------------------- use ExtUtils::Command::MM; $ENV{PERL_DL_NONLAZY} = 1; $ENV{ACK_TEST_STANDALONE} = shift; # Make sure the tests' standard input is *never* a pipe (messes with ack's filter detection). open STDIN, '<', '/dev/null'; printf("Running tests on %s\n", $ENV{ACK_TEST_STANDALONE} ? 'ack-standalone' : 'blib/script/ack'); test_harness(shift, shift, shift); ack-2.22/t/resource-iterator.t0000644000175000017500000000722013213376747014771 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 1; use File::Next 0.22; use lib 't'; use Util; prep_environment(); sub slurp { my $iter = shift; my @files; while ( defined ( my $file = $iter->() ) ) { push( @files, $file ); } return @files; } UNFILTERED: { my $iter = File::Next::files( { file_filter => undef, descend_filter => undef, }, 't/swamp' ); my @files = slurp( $iter ); sets_match( \@files, [qw( t/swamp/0 t/swamp/blib/ignore.pir t/swamp/blib/ignore.pm t/swamp/blib/ignore.pod t/swamp/c-header.h t/swamp/c-source.c t/swamp/crystallography-weenies.f t/swamp/example.R t/swamp/file.bar t/swamp/file.foo t/swamp/fresh.css t/swamp/fresh.css.min t/swamp/fresh.min.css t/swamp/groceries/another_subdir/CVS/fruit t/swamp/groceries/another_subdir/CVS/junk t/swamp/groceries/another_subdir/CVS/meat t/swamp/groceries/another_subdir/fruit t/swamp/groceries/another_subdir/junk t/swamp/groceries/another_subdir/meat t/swamp/groceries/another_subdir/RCS/fruit t/swamp/groceries/another_subdir/RCS/junk t/swamp/groceries/another_subdir/RCS/meat t/swamp/groceries/dir.d/CVS/fruit t/swamp/groceries/dir.d/CVS/junk t/swamp/groceries/dir.d/CVS/meat t/swamp/groceries/dir.d/fruit t/swamp/groceries/dir.d/junk t/swamp/groceries/dir.d/meat t/swamp/groceries/dir.d/RCS/fruit t/swamp/groceries/dir.d/RCS/junk t/swamp/groceries/dir.d/RCS/meat t/swamp/groceries/CVS/fruit t/swamp/groceries/CVS/junk t/swamp/groceries/CVS/meat t/swamp/groceries/fruit t/swamp/groceries/junk t/swamp/groceries/meat t/swamp/groceries/RCS/fruit t/swamp/groceries/RCS/junk t/swamp/groceries/RCS/meat t/swamp/groceries/subdir/fruit t/swamp/groceries/subdir/junk t/swamp/groceries/subdir/meat t/swamp/html.htm t/swamp/html.html t/swamp/incomplete-last-line.txt t/swamp/javascript.js t/swamp/lua-shebang-test t/swamp/Makefile t/swamp/Makefile.PL t/swamp/MasterPage.master t/swamp/minified.js.min t/swamp/minified.min.js t/swamp/moose-andy.jpg t/swamp/notaMakefile t/swamp/notaRakefile t/swamp/notes.md t/swamp/options-crlf.pl t/swamp/options.pl t/swamp/options.pl.bak t/swamp/parrot.pir t/swamp/perl-test.t t/swamp/perl-without-extension t/swamp/perl.cgi t/swamp/perl.pl t/swamp/perl.handler.pod t/swamp/perl.pm t/swamp/perl.pod t/swamp/perl.tar.gz t/swamp/perltoot.jpg t/swamp/pipe-stress-freaks.F t/swamp/Rakefile t/swamp/Sample.ascx t/swamp/Sample.asmx t/swamp/sample.asp t/swamp/sample.aspx t/swamp/sample.rake t/swamp/service.svc t/swamp/solution8.tar t/swamp/stuff.cmake t/swamp/CMakeLists.txt t/swamp/swamp/ignoreme.txt ), 't/swamp/#emacs-workfile.pl#', 't/swamp/not-an-#emacs-workfile#', ], 'UNFILTERED' ); } done_testing(); ack-2.22/t/issue522.t0000644000175000017500000000077713213402177012671 0ustar andyandy#!perl -T # https://github.com/beyondgrep/ack2/issues/522 use strict; use warnings; use Test::More tests => 4; use lib 't'; use Util; prep_environment(); my @stdout; @stdout = run_ack("use strict;\nuse warnings", 't/swamp'); is scalar(@stdout), 0, 'an embedded newline in the search regex should never match anything'; @stdout = run_ack('-A', '1', "use strict;\nuse warnings", 't/swamp'); is scalar(@stdout), 0, 'an embedded newline in the search regex should never match anything, even with context'; ack-2.22/t/issue276.t0000644000175000017500000000126313213402177012666 0ustar andyandy#!perl -T # https://github.com/beyondgrep/ack2/issues/276 use strict; use warnings; use lib 't'; use Util; use Test::More; my @regexes = ( '((foo)bar)', '((foo)(bar))', ); plan tests => scalar @regexes; prep_environment(); my $match_start = "\e[30;43m"; my $match_end = "\e[0m"; for my $regex ( @regexes ) { subtest $regex => sub { plan tests => 2; my ( $stdout, $stderr ) = pipe_into_ack_with_stderr( \'foobar', '--color', $regex ); is_empty_array( $stderr, 'Verify that no lines are printed to standard error' ); is_deeply( $stdout, [ "${match_start}foobar${match_end}" ], 'Verify a single-line output, properly colored' ); }; } ack-2.22/t/ack-color.t0000644000175000017500000000324713213402177013155 0ustar andyandy#!perl -T use warnings; use strict; use Test::More; use lib 't'; use Util; plan tests => 11; prep_environment(); my $match_start = "\e[30;43m"; my $match_end = "\e[0m"; my $line_end = "\e[0m\e[K"; NORMAL_COLOR: { my @files = qw( t/text/bill-of-rights.txt ); my @args = qw( free --color ); my @results = run_ack( @args, @files ); ok( grep { /\e/ } @results, 'normal match highlighted' ) or diag(explain(\@results)); } MATCH_WITH_BACKREF: { my @files = qw( t/text/bill-of-rights.txt ); my @args = qw( (free).*\1 --color ); my @results = run_ack( @args, @files ); is( @results, 1, 'backref pattern matches once' ); ok( grep { /\e/ } @results, 'match with backreference highlighted' ); } BRITISH_COLOR: { my @files = qw( t/text/bill-of-rights.txt ); my @args = qw( free --colour ); my @results = run_ack( @args, @files ); ok( grep { /\e/ } @results, 'normal match highlighted' ); } MULTIPLE_MATCHES: { my @files = qw( t/text/amontillado.txt ); my @args = qw( az.+?e|ser.+?nt -w --color ); my @results = run_ack( @args, @files ); is_deeply( \@results, [ "\"A huge human foot d'or, in a field ${match_start}azure${match_end}; the foot crushes a ${match_start}serpent${match_end}$line_end", ] ); } ADJACENT_CAPTURE_COLORING: { my @files = qw( t/text/raven.txt ); my @args = qw( (Temp)(ter) --color ); my @results = run_ack( @args, @files ); # The double end + start is kinda weird; this test could probably be more robust. is_deeply( \@results, [ "Whether ${match_start}Temp${match_end}${match_start}ter${match_end} sent, or whether tempest tossed thee here ashore,", ] ); } ack-2.22/t/config-finder.t0000644000175000017500000001744413213402177014021 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Util; use Cwd qw(realpath); use File::Spec; use File::Temp; use Test::Builder; use Test::More; use App::Ack::ConfigFinder; my $tmpdir = $ENV{'TMPDIR'}; my $home = $ENV{'HOME'}; for ( $tmpdir, $home ) { s{/$}{} if defined; } if ( $tmpdir && ($tmpdir =~ /^\Q$home/) ) { plan skip_all => "Your \$TMPDIR ($tmpdir) is set to a descendant directory of your home directory. This test is known to fail with such a setting. Please set your TMPDIR to something else to get this test to pass."; exit; } plan tests => 26; # Set HOME to a known value, so we get predictable results: $ENV{'HOME'} = realpath('t/home'); # Clear the users ACKRC so it doesn't throw out expect_ackrcs(). delete $ENV{'ACKRC'}; { # The tests blow up on Windows if the global files don't exist, # so here we create them if they don't, keeping track of the ones # we make so we can delete them later. my @created_globals; sub set_up_globals { my (@files) = @_; foreach my $path (@files) { my $filename = $path->{path}; if ( not -e $filename ) { touch_ackrc( $filename ); push @created_globals, $path; } } return; } sub clean_up_globals { foreach my $path (@created_globals) { my $filename = $path->{path}; unlink $filename or warn "Couldn't unlink $path"; } return; } } sub no_home (&) { ## no critic (ProhibitSubroutinePrototypes) my ( $fn ) = @_; my $home = delete $ENV{'HOME'}; # Localized delete isn't supported in earlier Perls. $fn->(); $ENV{'HOME'} = $home; # XXX this won't work on exceptions... return; } my $finder; sub expect_ackrcs { local $Test::Builder::Level = $Test::Builder::Level + 1; my $expected = shift; my $name = shift; my @got = $finder->find_config_files; my @expected = @{$expected}; foreach my $element (@got, @expected) { $element->{'path'} = realpath($element->{'path'}); } is_deeply( \@got, \@expected, $name ) or diag(explain(\@got)); return; } my @global_files; if ( is_windows() ) { require Win32; @global_files = map { +{ path => File::Spec->catfile($_, 'ackrc') } } ( Win32::GetFolderPath(Win32::CSIDL_COMMON_APPDATA()), Win32::GetFolderPath(Win32::CSIDL_APPDATA()), ); } else { @global_files = ( { path => '/etc/ackrc' }, ); } if ( is_windows() || is_cygwin() ) { set_up_globals( @global_files ); } my @std_files = (@global_files, { path => File::Spec->catfile($ENV{'HOME'}, '.ackrc') }); my $wd = getcwd_clean(); my $tempdir = File::Temp->newdir; safe_chdir( $tempdir->dirname ); $finder = App::Ack::ConfigFinder->new; expect_ackrcs \@std_files, 'having no project file should return only the top level files'; no_home { expect_ackrcs \@global_files, 'only system-wide ackrc is returned if HOME is not defined with no project files'; }; safe_mkdir( 'foo' ); safe_mkdir( File::Spec->catdir('foo', 'bar') ); safe_mkdir( File::Spec->catdir('foo', 'bar', 'baz') ); safe_chdir( File::Spec->catdir('foo', 'bar', 'baz') ); touch_ackrc( '.ackrc' ); expect_ackrcs [ @std_files, { project => 1, path => File::Spec->rel2abs('.ackrc') }], 'a project file in the same directory should be detected'; no_home { expect_ackrcs [ @global_files, { project => 1, path => File::Spec->rel2abs('.ackrc') } ], 'a project file in the same directory should be detected'; }; unlink '.ackrc'; my $project_file = File::Spec->catfile($tempdir->dirname, 'foo', 'bar', '.ackrc'); touch_ackrc( $project_file ); expect_ackrcs [ @std_files, { project => 1, path => $project_file } ], 'a project file in the parent directory should be detected'; no_home { expect_ackrcs [ @global_files, { project => 1, path => $project_file } ], 'a project file in the parent directory should be detected'; }; unlink $project_file; $project_file = File::Spec->catfile($tempdir->dirname, 'foo', '.ackrc'); touch_ackrc( $project_file ); expect_ackrcs [ @std_files, { project => 1, path => $project_file } ], 'a project file in the grandparent directory should be detected'; no_home { expect_ackrcs [ @global_files, { project => 1, path => $project_file } ], 'a project file in the grandparent directory should be detected'; }; touch_ackrc( '.ackrc' ); expect_ackrcs [ @std_files, { project => 1, path => File::Spec->rel2abs('.ackrc') } ], 'a project file in the same directory should be detected, even with another one above it'; no_home { expect_ackrcs [ @global_files, { project => 1, path => File::Spec->rel2abs('.ackrc') } ], 'a project file in the same directory should be detected, even with another one above it'; }; unlink '.ackrc'; unlink $project_file; touch_ackrc( '_ackrc' ); expect_ackrcs [ @std_files, { project => 1, path => File::Spec->rel2abs('_ackrc') } ], 'a project file in the same directory should be detected'; no_home { expect_ackrcs [ @global_files, { project => 1, path => File::Spec->rel2abs('_ackrc') } ], 'a project file in the same directory should be detected'; }; unlink '_ackrc'; $project_file = File::Spec->catfile($tempdir->dirname, 'foo', '_ackrc'); touch_ackrc( $project_file ); expect_ackrcs [ @std_files, { project => 1, path => $project_file } ], 'a project file in the grandparent directory should be detected'; no_home { expect_ackrcs [ @global_files, { project => 1, path => $project_file } ], 'a project file in the grandparent directory should be detected'; }; touch_ackrc( '_ackrc' ); expect_ackrcs [ @std_files, { project => 1, path => File::Spec->rel2abs('_ackrc') } ], 'a project file in the same directory should be detected, even with another one above it'; no_home { expect_ackrcs [ @global_files, { project => 1, path => File::Spec->rel2abs('_ackrc') } ], 'a project file in the same directory should be detected, even with another one above it'; }; unlink $project_file; touch_ackrc( '.ackrc' ); my $ok = eval { $finder->find_config_files }; my $err = $@; ok( !$ok, '.ackrc + _ackrc is error' ); like( $err, qr/contains both \.ackrc and _ackrc/, 'Got the expected error' ); no_home { $ok = eval { $finder->find_config_files }; $err = $@; ok( !$ok, '.ackrc + _ackrc is error' ); like( $err, qr/contains both \.ackrc and _ackrc/, 'Got the expected error' ); }; unlink '.ackrc'; $project_file = File::Spec->catfile($tempdir->dirname, 'foo', '.ackrc'); touch_ackrc( $project_file ); expect_ackrcs [ @std_files, { project => 1, path => File::Spec->rel2abs('_ackrc') }], 'a lower-level _ackrc should be preferred to a higher-level .ackrc'; no_home { expect_ackrcs [ @global_files, { project => 1, path => File::Spec->rel2abs('_ackrc') } ], 'a lower-level _ackrc should be preferred to a higher-level .ackrc'; }; unlink '_ackrc'; do { local $ENV{'HOME'} = File::Spec->catdir($tempdir->dirname, 'foo'); my $user_file = File::Spec->catfile($tempdir->dirname, 'foo', '.ackrc'); touch_ackrc( $user_file ); expect_ackrcs [ @global_files, { path => $user_file } ], q{don't load the same ackrc file twice}; unlink($user_file); }; do { safe_chdir( $tempdir->dirname ); local $ENV{'HOME'} = File::Spec->catfile($tempdir->dirname, 'foo'); my $user_file = File::Spec->catfile($ENV{'HOME'}, '.ackrc'); touch_ackrc( $user_file ); my $ackrc = File::Temp->new; close $ackrc; local $ENV{'ACKRC'} = $ackrc->filename; expect_ackrcs [ @global_files, { path => $ackrc->filename } ], q{ACKRC overrides user's HOME ackrc}; unlink $ackrc->filename; expect_ackrcs [ @global_files, { path => $user_file } ], q{ACKRC doesn't override if it doesn't exist}; touch_ackrc( $ackrc->filename ); safe_chdir( 'foo' ); expect_ackrcs [ @global_files, { path => $ackrc->filename}, { project => 1, path => $user_file } ], q{~/.ackrc should still be found as a project ackrc}; unlink $ackrc->filename; }; safe_chdir( $wd ); clean_up_globals(); ack-2.22/t/bad-ackrc-opt.t0000644000175000017500000000065113213376747013723 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Util; use Test::More tests => 4; prep_environment(); my ( $stdout, $stderr ) = run_ack_with_stderr( '--noenv', '--ackrc=./bad-ackrc', 'the', 't/text' ); is_empty_array( $stdout, 'Nothing to stdout' ); is( @{$stderr}, 1, 'only one line to stderr' ); like( $stderr->[0], qr/Unable to load ackrc/, 'Got the right message' ); isnt( get_rc(), 0, 'Non-zero return code' ); ack-2.22/t/command-line-files.t0000644000175000017500000000354613216123637014754 0ustar andyandy#!perl -T # This file validates behaviors of specifying files on the command line. use warnings; use strict; use Test::More tests => 4; use lib 't'; use Util; prep_environment(); my @source_files = map { reslash($_) } qw( t/swamp/options-crlf.pl t/swamp/options.pl t/swamp/options.pl.bak ); JUST_THE_DIR: { my @expected = line_split( <<"HERE" ); $source_files[0]:19:notawordhere $source_files[1]:19:notawordhere HERE my @files = qw( t/swamp ); my @args = qw( notaword ); ack_sets_match( [ @args, @files ], \@expected, q{One hit for specifying a dir} ); } # Even a .bak file gets searched if you specify it on the command line. SPECIFYING_A_BAK_FILE: { my @expected = line_split( <<"HERE" ); $source_files[1]:19:notawordhere $source_files[2]:19:notawordhere HERE my @files = qw( t/swamp/options.pl t/swamp/options.pl.bak ); my @args = qw( notaword ); ack_sets_match( [ @args, @files ], \@expected, q{Two hits for specifying the file} ); } FILE_NOT_THERE: { my $file = reslash( 't/swamp/perl.pod' ); my @expected_stderr; # I don't care for this, but it's the least of the evils I could think of if ( $ENV{'ACK_TEST_STANDALONE'} ) { @expected_stderr = line_split( <<'HERE' ); ack-standalone: non-existent-file.txt: No such file or directory HERE } else { @expected_stderr = line_split( <<'HERE' ); ack: non-existent-file.txt: No such file or directory HERE } my @expected_stdout = line_split( <<"HERE" ); ${file}:3:=head2 There's important stuff in here! HERE my @files = ( 'non-existent-file.txt', $file ); my @args = qw( head2 ); my ($stdout, $stderr) = run_ack_with_stderr( @args, @files ); lists_match( $stderr, \@expected_stderr, q{Error if there's no file} ); lists_match( $stdout, \@expected_stdout, 'Find the one file that has a hit' ); } ack-2.22/t/ext-filter.t0000644000175000017500000000104213213376747013372 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use FilterTest; use Test::More tests => 1; use App::Ack::Filter::Extension; filter_test( [ ext => qw/pl pod pm t/ ], [ 't/swamp/Makefile.PL', 't/swamp/blib/ignore.pm', 't/swamp/blib/ignore.pod', 't/swamp/options-crlf.pl', 't/swamp/options.pl', 't/swamp/perl-test.t', 't/swamp/perl.handler.pod', 't/swamp/perl.pl', 't/swamp/perl.pm', 't/swamp/perl.pod', ], 'only the given extensions should be matched' ); ack-2.22/t/illegal-regex.t0000644000175000017500000000154313215622023014015 0ustar andyandy#!perl -T use warnings; use strict; use Test::More; use lib 't'; use Util; prep_environment(); # test for behavior with illegal regexes my @tests = ( [ 'illegal pattern', '?foo', 't/' ], [ 'illegal -g regex', '-g', '?foo', 't/' ], ); plan tests => scalar @tests; for ( @tests ) { test_ack_with( @{$_} ); } sub test_ack_with { my $testcase = shift; my @args = @_; return subtest "test_ack_with( $testcase: @args )" => sub { my ( $stdout, $stderr ) = run_ack_with_stderr( @args ); is_empty_array( $stdout, "No STDOUT for $testcase" ); is( scalar @{$stderr}, 2, "Two lines of STDERR for $testcase" ); like( $stderr->[0], qr/Invalid regex/, "Correct ack error message for $testcase" ); like( $stderr->[1], qr/^\s+Quantifier follows nothing/, "Correct type of error for $testcase" ); }; } ack-2.22/t/ack-show-types.t0000644000175000017500000000130613213376747014170 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 6; use lib 't'; use Util; prep_environment(); my @exp_types = qw{ rake ruby }; sub get_types { my $line = shift; $line =~ s/.* => //; my @types = split( /,/, $line ); return \@types; } sub do_test { local $Test::Builder::Level = $Test::Builder::Level + 1; my @args = @_; my @results = run_ack( @args ); is( scalar @results, 1, "Only one file should be returned from 'ack @args'" ); sets_match( get_types( $results[0] ), \@exp_types , "'ack @args' must return all the expected types" ); return; } do_test( qw{ -f --show-types t/swamp/Rakefile } ); do_test( qw{ -g \bRakef --show-types t/swamp } ); ack-2.22/t/ack-m.t0000644000175000017500000000302513216123637012271 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 6; use lib 't'; use Util; prep_environment(); LIMIT_MATCHES_RETURNED: { my @text = sort map { untaint($_) } glob( 't/text/[bc]*.txt' ); my $bill_ = reslash( 't/text/bill-of-rights.txt' ); my $const = reslash( 't/text/constitution.txt' ); my @expected = line_split( <<"HERE" ); $bill_:4:or prohibiting the free exercise thereof; or abridging the freedom of $bill_:5:speech, or of the press; or the right of the people peaceably to assemble, $bill_:6:and to petition the Government for a redress of grievances. $const:3:We the People of the United States, in Order to form a more perfect $const:4:Union, establish Justice, insure domestic Tranquility, provide for the $const:5:common defense, promote the general Welfare, and secure the Blessings HERE ack_lists_match( [ '-m', 3, '-w', 'the', @text ], \@expected, 'Should show only 3 lines per file' ); @expected = line_split( <<"HERE" ); $bill_:4:or prohibiting the free exercise thereof; or abridging the freedom of HERE ack_lists_match( [ '-1', '-w', 'the', @text ], \@expected, 'We should only get one line back for the entire run, not just per file.' ); } DASH_L: { my $target = 'the'; my @files = reslash( 't/text' ); my @args = ( '-m', 3, '-l', '--sort-files', $target ); my @results = run_ack( @args, @files ); my @expected = map { reslash( "t/text/$_" ) } ( 'amontillado.txt', 'bill-of-rights.txt', 'constitution.txt' ); is_deeply(\@results, \@expected); } ack-2.22/t/noackrc.t0000644000175000017500000000065113213376747012734 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 1; use Util; prep_environment(); my @expected = ( 't/swamp/Makefile.PL', 't/swamp/options-crlf.pl', 't/swamp/options.pl', 't/swamp/perl.pl', ); my @args = ( '--ignore-ack-defaults', '--type-add=perl:ext:pl', '--perl', '-f' ); my @files = ( 't/swamp' ); ack_sets_match( [ @args, @files ], \@expected, __FILE__ ); done_testing(); ack-2.22/t/zero.t0000644000175000017500000000121713213402177012255 0ustar andyandy#!perl -T =pod Long ago there was a problem where ack would ignore a file named "0" because 0 is a false value in Perl. Here we check to make sure we don't fall prey to that again. =cut use warnings; use strict; use Test::More tests => 1; use lib 't'; use Util; prep_environment(); my $swamp = 't/swamp'; my @actual_swamp_perl = map { "$swamp/$_" } qw( 0 Makefile.PL options.pl options-crlf.pl perl.cgi perl.handler.pod perl.pl perl.pm perl.pod perl-test.t perl-without-extension ); DASH_F: { my @args = qw( -f --perl ); ack_sets_match( [ @args, $swamp ], \@actual_swamp_perl, 'DASH_F' ); } ack-2.22/t/mutex-options.t0000644000175000017500000005411413216123637014141 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 250; use lib 't'; use Util; prep_environment(); ## no critic ( ValuesAndExpressions::RequireInterpolationOfMetachars ) Way too many metacharacters in this file my $file = 't/text/raven.txt'; my $word = 'nevermore'; # --line are_mutually_exclusive('--line', '-l', ['--line=1', '-l', $file]); are_mutually_exclusive('--line', '-l', ['--line', 1, '-l', $file]); are_mutually_exclusive('--line', '--files-with-matches', ['--line=1', '--files-with-matches', $file]); are_mutually_exclusive('--line', '--files-with-matches', ['--line', 1, '--files-with-matches', $file]); are_mutually_exclusive('--line', '-L', ['--line=1', '-L', $file]); are_mutually_exclusive('--line', '-L', ['--line', 1, '-L', $file]); are_mutually_exclusive('--line', '--files-without-matches', ['--line=1', '--files-without-matches', $file]); are_mutually_exclusive('--line', '--files-without-matches', ['--line', 1, '--files-without-matches', $file]); are_mutually_exclusive('--line', '-o', ['--line=1', '-o', $file]); are_mutually_exclusive('--line', '-o', ['--line', 1, '-o', $file]); are_mutually_exclusive('--line', '--passthru', ['--line=1', '--passthru', $file]); are_mutually_exclusive('--line', '--passthru', ['--line', 1, '--passthru', $file]); are_mutually_exclusive('--line', '--match', ['--line=1', '--match', $file]); are_mutually_exclusive('--line', '--match', ['--line', 1, '--match', $file]); are_mutually_exclusive('--line', '-m', ['--line=1', '-m', 1, $file]); are_mutually_exclusive('--line', '-m', ['--line', 1, '-m', 1, $file]); are_mutually_exclusive('--line', '-m', ['--line', 1, '-m1', $file]); are_mutually_exclusive('--line', '--max-count', ['--line=1', '--max-count', 1, $file]); are_mutually_exclusive('--line', '--max-count', ['--line', 1, '--max-count', 1, $file]); are_mutually_exclusive('--line', '--max-count', ['--line=1', '--max-count=1', $file]); are_mutually_exclusive('--line', '--max-count', ['--line', 1, '--max-count=1', $file]); are_mutually_exclusive('--line', '-1', ['--line=1', '-1', $file]); are_mutually_exclusive('--line', '-1', ['--line', 1, '-1', $file]); are_mutually_exclusive('--line', '-H', ['--line=1', '-H', $file]); are_mutually_exclusive('--line', '-H', ['--line', 1, '-H', $file]); are_mutually_exclusive('--line', '--with-filename', ['--line=1', '--with-filename', $file]); are_mutually_exclusive('--line', '--with-filename', ['--line', 1, '--with-filename', $file]); are_mutually_exclusive('--line', '-h', ['--line=1', '-h', $file]); are_mutually_exclusive('--line', '-h', ['--line', 1, '-h', $file]); are_mutually_exclusive('--line', '--no-filename', ['--line=1', '--no-filename', $file]); are_mutually_exclusive('--line', '--no-filename', ['--line', 1, '--no-filename', $file]); are_mutually_exclusive('--line', '-c', ['--line=1', '-c', $file]); are_mutually_exclusive('--line', '-c', ['--line', 1, '-c', $file]); are_mutually_exclusive('--line', '--count', ['--line=1', '--count', $file]); are_mutually_exclusive('--line', '--count', ['--line', 1, '--count', $file]); are_mutually_exclusive('--line', '--column', ['--line=1', '--column', $file]); are_mutually_exclusive('--line', '--column', ['--line', 1, '--column', $file]); are_mutually_exclusive('--line', '-A', ['--line=1', '-A', 1, $file]); are_mutually_exclusive('--line', '-A', ['--line', 1, '-A', 1, $file]); are_mutually_exclusive('--line', '--after-context', ['--line=1', '--after-context', 1, $file]); are_mutually_exclusive('--line', '--after-context', ['--line', 1, '--after-context', 1, $file]); are_mutually_exclusive('--line', '--after-context', ['--line=1', '--after-context=1', $file]); are_mutually_exclusive('--line', '--after-context', ['--line', 1, '--after-context=1', $file]); are_mutually_exclusive('--line', '-B', ['--line=1', '-B', 1, $file]); are_mutually_exclusive('--line', '-B', ['--line', 1, '-B', 1, $file]); are_mutually_exclusive('--line', '--before-context', ['--line=1', '--before-context', 1, $file]); are_mutually_exclusive('--line', '--before-context', ['--line', 1, '--before-context', 1, $file]); are_mutually_exclusive('--line', '--before-context', ['--line=1', '--before-context=1', $file]); are_mutually_exclusive('--line', '--before-context', ['--line', 1, '--before-context=1', $file]); are_mutually_exclusive('--line', '-C', ['--line=1', '-C', 1, $file]); are_mutually_exclusive('--line', '-C', ['--line', 1, '-C', 1, $file]); are_mutually_exclusive('--line', '--context', ['--line=1', '--context', 1, $file]); are_mutually_exclusive('--line', '--context', ['--line', 1, '--context', 1, $file]); are_mutually_exclusive('--line', '--context', ['--line=1', '--context=1', $file]); are_mutually_exclusive('--line', '--context', ['--line', 1, '--context=1', $file]); are_mutually_exclusive('--line', '--print0', ['--line=1', '--print0', $file]); are_mutually_exclusive('--line', '--print0', ['--line', 1, '--print0', $file]); are_mutually_exclusive('--line', '-f', ['--line=1', '-f', $file]); are_mutually_exclusive('--line', '-f', ['--line', 1, '-f', $file]); are_mutually_exclusive('--line', '-g', ['--line=1', '-g', $file]); are_mutually_exclusive('--line', '-g', ['--line', 1, '-g', $file]); are_mutually_exclusive('--line', '--show-types', ['--line=1', '--show-types', $file]); are_mutually_exclusive('--line', '--show-types', ['--line', 1, '--show-types', $file]); # -l/--files-with-matches are_mutually_exclusive('-l', '-L', ['-l', '-L', $word, $file]); are_mutually_exclusive('-l', '-o', ['-l', '-o', $word, $file]); are_mutually_exclusive('-l', '--passthru', ['-l', '--passthru', $word, $file]); are_mutually_exclusive('-l', '--output', ['-l', '--output', '$&', $word, $file]); are_mutually_exclusive('-l', '--output', ['-l', '--output=$&', $word, $file]); are_mutually_exclusive('-l', '--max-count', ['-l', '--max-count', 1, $word, $file]); are_mutually_exclusive('-l', '--max-count', ['-l', '--max-count=1', $word, $file]); are_mutually_exclusive('-l', '-h', ['-l', '-h', $word, $file]); are_mutually_exclusive('-l', '--with-filename', ['-l', '--with-filename', $word, $file]); are_mutually_exclusive('-l', '--no-filename', ['-l', '--no-filename', $word, $file]); are_mutually_exclusive('-l', '--column', ['-l', '--column', $word, $file]); are_mutually_exclusive('-l', '-A', ['-l', '-A', 1, $word, $file]); are_mutually_exclusive('-l', '--after-context', ['-l', '--after-context', 1, $word, $file]); are_mutually_exclusive('-l', '--after-context', ['-l', '--after-context=1', $word, $file]); are_mutually_exclusive('-l', '-B', ['-l', '-B', 1, $word, $file]); are_mutually_exclusive('-l', '--before-context', ['-l', '--before-context', 1, $word, $file]); are_mutually_exclusive('-l', '--before-context', ['-l', '--before-context=1', $word, $file]); are_mutually_exclusive('-l', '-C', ['-l', '-C', 1, $word, $file]); are_mutually_exclusive('-l', '--context', ['-l', '--context', 1, $word, $file]); are_mutually_exclusive('-l', '--context', ['-l', '--context=1', $word, $file]); are_mutually_exclusive('-l', '--heading', ['-l', '--heading', $word, $file]); are_mutually_exclusive('-l', '--break', ['-l', '--break', $word, $file]); are_mutually_exclusive('-l', '--group', ['-l', '--group', $word, $file]); are_mutually_exclusive('-l', '-f', ['-l', '-f', $file]); are_mutually_exclusive('-l', '-g', ['-l', '-g', $word, $file]); are_mutually_exclusive('-l', '--show-types', ['-l', '--show-types', $word, $file]); # -L/--files-without-matches are_mutually_exclusive('-L', '-l', ['-L', '-l', $word, $file]); are_mutually_exclusive('-L', '-o', ['-L', '-o', $word, $file]); are_mutually_exclusive('-L', '--passthru', ['-L', '--passthru', $word, $file]); are_mutually_exclusive('-L', '--output', ['-L', '--output', '$&', $word, $file]); are_mutually_exclusive('-L', '--output', ['-L', '--output=$&', $word, $file]); are_mutually_exclusive('-L', '--max-count', ['-L', '--max-count', 1, $word, $file]); are_mutually_exclusive('-L', '--max-count', ['-L', '--max-count=1', $word, $file]); are_mutually_exclusive('-L', '-h', ['-L', '-h', $word, $file]); are_mutually_exclusive('-L', '--with-filename', ['-L', '--with-filename', $word, $file]); are_mutually_exclusive('-L', '--no-filename', ['-L', '--no-filename', $word, $file]); are_mutually_exclusive('-L', '--column', ['-L', '--column', $word, $file]); are_mutually_exclusive('-L', '-A', ['-L', '-A', 1, $word, $file]); are_mutually_exclusive('-L', '--after-context', ['-L', '--after-context', 1, $word, $file]); are_mutually_exclusive('-L', '--after-context', ['-L', '--after-context=1', $word, $file]); are_mutually_exclusive('-L', '-B', ['-L', '-B', 1, $word, $file]); are_mutually_exclusive('-L', '--before-context', ['-L', '--before-context', 1, $word, $file]); are_mutually_exclusive('-L', '--before-context', ['-L', '--before-context=1', $word, $file]); are_mutually_exclusive('-L', '-C', ['-L', '-C', 1, $word, $file]); are_mutually_exclusive('-L', '--context', ['-L', '--context', 1, $word, $file]); are_mutually_exclusive('-L', '--context', ['-L', '--context=1', $word, $file]); are_mutually_exclusive('-L', '--heading', ['-L', '--heading', $word, $file]); are_mutually_exclusive('-L', '--break', ['-L', '--break', $word, $file]); are_mutually_exclusive('-L', '--group', ['-L', '--group', $word, $file]); are_mutually_exclusive('-L', '-f', ['-L', '-f', $file]); are_mutually_exclusive('-L', '-g', ['-L', '-g', $word, $file]); are_mutually_exclusive('-L', '--show-types', ['-L', '--show-types', $word, $file]); are_mutually_exclusive('-L', '-c', ['-L', '-c', $word, $file]); are_mutually_exclusive('-L', '--count', ['-L', '--count', $word, $file]); # -o are_mutually_exclusive('-o', '--output', ['-o', '--output', '$&', $word, $file]); are_mutually_exclusive('-o', '--output', ['-o', '--output=$&', $word, $file]); are_mutually_exclusive('-o', '-c', ['-o', '-c', $word, $file]); are_mutually_exclusive('-o', '--count', ['-o', '--count', $word, $file]); are_mutually_exclusive('-o', '--column', ['-o', '--column', $word, $file]); are_mutually_exclusive('-o', '-A', ['-o', '-A', 1, $word, $file]); are_mutually_exclusive('-o', '--after-context', ['-o', '--after-context', 1, $word, $file]); are_mutually_exclusive('-o', '--after-context', ['-o', '--after-context=1', $word, $file]); are_mutually_exclusive('-o', '-B', ['-o', '-B', 1, $word, $file]); are_mutually_exclusive('-o', '--before-context', ['-o', '--before-context', 1, $word, $file]); are_mutually_exclusive('-o', '--before-context', ['-o', '--before-context=1', $word, $file]); are_mutually_exclusive('-o', '-C', ['-o', '-C', 1, $word, $file]); are_mutually_exclusive('-o', '--context', ['-o', '--context', 1, $word, $file]); are_mutually_exclusive('-o', '--context', ['-o', '--context=1', $word, $file]); are_mutually_exclusive('-o', '-f', ['-o', '-f', $word, $file]); # --passthru are_mutually_exclusive('--passthru', '--output', ['--passthru', '--output', '$&', $word, $file]); are_mutually_exclusive('--passthru', '--output', ['--passthru', '--output=$&', $word, $file]); are_mutually_exclusive('--passthru', '-m', ['--passthru', '-m', 1, $word, $file]); are_mutually_exclusive('--passthru', '--max-count', ['--passthru', '--max-count', 1, $word, $file]); are_mutually_exclusive('--passthru', '--max-count', ['--passthru', '--max-count=1', $word, $file]); are_mutually_exclusive('--passthru', '-1', ['--passthru', '-1', $word, $file]); are_mutually_exclusive('--passthru', '-c', ['--passthru', '-c', $word, $file]); are_mutually_exclusive('--passthru', '--count', ['--passthru', '--count', $word, $file]); are_mutually_exclusive('--passthru', '--count', ['--passthru', '--count', $word, $file]); are_mutually_exclusive('--passthru', '-A', ['--passthru', '-A', 1, $word, $file]); are_mutually_exclusive('--passthru', '--after-context', ['--passthru', '--after-context', 1, $word, $file]); are_mutually_exclusive('--passthru', '--after-context', ['--passthru', '--after-context=1', $word, $file]); are_mutually_exclusive('--passthru', '-B', ['--passthru', '-B', 1, $word, $file]); are_mutually_exclusive('--passthru', '--before-context', ['--passthru', '--before-context', 1, $word, $file]); are_mutually_exclusive('--passthru', '--before-context', ['--passthru', '--before-context=1', $word, $file]); are_mutually_exclusive('--passthru', '-C', ['--passthru', '-C', 1, $word, $file]); are_mutually_exclusive('--passthru', '--context', ['--passthru', '--context', 1, $word, $file]); are_mutually_exclusive('--passthru', '--context', ['--passthru', '--context=1', $word, $file]); are_mutually_exclusive('--passthru', '-f', ['--passthru', '-f', $word, $file]); are_mutually_exclusive('--passthru', '-g', ['--passthru', '-g', $word, $file]); are_mutually_exclusive('--passthru', '--column', ['--passthru', '--column', $word, $file]); # --output are_mutually_exclusive('--output', '-c', ['--output', '$&', '-c', $word, $file]); are_mutually_exclusive('--output', '--count', ['--output', '$&', '--count', $word, $file]); are_mutually_exclusive('--output', '-f', ['--output', '$&', '-f', $file]); are_mutually_exclusive('--output', '-g', ['--output', '$&', '-g', $word, $file]); are_mutually_exclusive('--output', '-c', ['--output=$&', '-c', $word, $file]); are_mutually_exclusive('--output', '--count', ['--output=$&', '--count', $word, $file]); are_mutually_exclusive('--output', '-f', ['--output=$&', '-f', $file]); are_mutually_exclusive('--output', '-g', ['--output=$&', '-g', $word, $file]); are_mutually_exclusive('--output', '-A', ['--output=$&', '-A2', $word, $file]); are_mutually_exclusive('--output', '-B', ['--output=$&', '-B2', $word, $file]); are_mutually_exclusive('--output', '-C', ['--output=$&', '-C2', $word, $file]); are_mutually_exclusive('--output', '--after-context', ['--output=$&', '--after-context=2', $word, $file]); are_mutually_exclusive('--output', '--before-context', ['--output=$&', '--before-context=2', $word, $file]); are_mutually_exclusive('--output', '--context', ['--output=$&', '--context=2', $word, $file]); # --match are_mutually_exclusive('--match', '-f', ['--match', $word, '-f', $file]); are_mutually_exclusive('--match', '-g', ['--match', $word, '-g', $file]); are_mutually_exclusive('--match', '-f', ['--match=science', '-f', $file]); are_mutually_exclusive('--match', '-g', ['--match=science', '-g', $file]); # --max-count are_mutually_exclusive('-m', '-1', ['-m', 1, '-1', $word, $file]); are_mutually_exclusive('-m', '-c', ['-m', 1, '-c', $word, $file]); are_mutually_exclusive('-m', '-f', ['-m', 1, '-f', $word, $file]); are_mutually_exclusive('-m', '-g', ['-m', 1, '-g', $word, $file]); are_mutually_exclusive('--max-count', '-1', ['--max-count', 1, '-1', $word, $file]); are_mutually_exclusive('--max-count', '-c', ['--max-count', 1, '-c', $word, $file]); are_mutually_exclusive('--max-count', '-f', ['--max-count', 1, '-f', $word, $file]); are_mutually_exclusive('--max-count', '-g', ['--max-count', 1, '-g', $word, $file]); are_mutually_exclusive('--max-count', '-1', ['--max-count=1', '-1', $word, $file]); are_mutually_exclusive('--max-count', '-c', ['--max-count=1', '-c', $word, $file]); are_mutually_exclusive('--max-count', '-f', ['--max-count=1', '-f', $word, $file]); are_mutually_exclusive('--max-count', '-g', ['--max-count=1', '-g', $word, $file]); # -h/--no-filename are_mutually_exclusive('-h', '-H', ['-h', '-H', $word, $file]); are_mutually_exclusive('-h', '--with-filename', ['-h', '--with-filename', $word, $file]); are_mutually_exclusive('-h', '-f', ['-h', '-f', $word, $file]); are_mutually_exclusive('-h', '-g', ['-h', '-g', $word, $file]); are_mutually_exclusive('-h', '--group', ['-h', '--group', $word, $file]); are_mutually_exclusive('-h', '--heading', ['-h', '--heading', $word, $file]); are_mutually_exclusive('--no-filename', '-H', ['--no-filename', '-H', $word, $file]); are_mutually_exclusive('--no-filename', '--with-filename', ['--no-filename', '--with-filename', $word, $file]); are_mutually_exclusive('--no-filename', '-f', ['--no-filename', '-f', $word, $file]); are_mutually_exclusive('--no-filename', '-g', ['--no-filename', '-g', $word, $file]); are_mutually_exclusive('--no-filename', '--group', ['--no-filename', '--group', $word, $file]); are_mutually_exclusive('--no-filename', '--heading', ['--no-filename', '--heading', $word, $file]); # -H/--with-filename are_mutually_exclusive('-H', '-h', ['-H', '-h', $word, $file]); are_mutually_exclusive('-H', '--no-filename', ['-H', '--no-filename', $word, $file]); are_mutually_exclusive('-H', '-f', ['-H', '-f', $word, $file]); are_mutually_exclusive('-H', '-g', ['-H', '-g', $word, $file]); are_mutually_exclusive('--with-filename', '-h', ['--with-filename', '-h', $word, $file]); are_mutually_exclusive('--with-filename', '--no-filename', ['--with-filename', '--no-filename', $word, $file]); are_mutually_exclusive('--with-filename', '-f', ['--with-filename', '-f', $word, $file]); are_mutually_exclusive('--with-filename', '-g', ['--with-filename', '-g', $word, $file]); # -c/--count are_mutually_exclusive('-c', '--column', ['-c', '--column', $word, $file]); are_mutually_exclusive('-c', '-A', ['-c', '-A', 1, $word, $file]); are_mutually_exclusive('-c', '--after-context', ['-c', '--after-context', 1, $word, $file]); are_mutually_exclusive('-c', '-B', ['-c', '-B', 1, $word, $file]); are_mutually_exclusive('-c', '--before-context', ['-c', '--before-context', 1, $word, $file]); are_mutually_exclusive('-c', '-C', ['-c', '-C', 1, $word, $file]); are_mutually_exclusive('-c', '--context', ['-c', '--context', 1, $word, $file]); are_mutually_exclusive('-c', '--heading', ['-c', '--heading', $word, $file]); are_mutually_exclusive('-c', '--group', ['-c', '--group', $word, $file]); are_mutually_exclusive('-c', '--break', ['-c', '--break', $word, $file]); are_mutually_exclusive('-c', '-f', ['-c', '-f', $word, $file]); are_mutually_exclusive('-c', '-g', ['-c', '-g', $word, $file]); are_mutually_exclusive('--count', '--column', ['--count', '--column', $word, $file]); are_mutually_exclusive('--count', '-A', ['--count', '-A', 1, $word, $file]); are_mutually_exclusive('--count', '--after-context', ['--count', '--after-context', 1, $word, $file]); are_mutually_exclusive('--count', '-B', ['--count', '-B', 1, $word, $file]); are_mutually_exclusive('--count', '--before-context', ['--count', '--before-context', 1, $word, $file]); are_mutually_exclusive('--count', '-C', ['--count', '-C', 1, $word, $file]); are_mutually_exclusive('--count', '--context', ['--count', '--context', 1, $word, $file]); are_mutually_exclusive('--count', '--heading', ['--count', '--heading', $word, $file]); are_mutually_exclusive('--count', '--group', ['--count', '--group', $word, $file]); are_mutually_exclusive('--count', '--break', ['--count', '--break', $word, $file]); are_mutually_exclusive('--count', '-f', ['--count', '-f', $word, $file]); are_mutually_exclusive('--count', '-g', ['--count', '-g', $word, $file]); # --column are_mutually_exclusive('--column', '-f', ['--column', '-f', $word, $file]); are_mutually_exclusive('--column', '-g', ['--column', '-g', $word, $file]); # -A/-B/-C/--after-context/--before-context/--context are_mutually_exclusive('-A', '-f', ['-A', 1, '-f', $word, $file]); are_mutually_exclusive('-A', '-g', ['-A', 1, '-g', $word, $file]); are_mutually_exclusive('--after-context', '-f', ['--after-context', 1, '-f', $word, $file]); are_mutually_exclusive('--after-context', '-g', ['--after-context', 1, '-g', $word, $file]); are_mutually_exclusive('-B', '-f', ['-B', 1, '-f', $word, $file]); are_mutually_exclusive('-B', '-g', ['-B', 1, '-g', $word, $file]); are_mutually_exclusive('--before-context', '-f', ['--before-context', 1, '-f', $word, $file]); are_mutually_exclusive('--before-context', '-g', ['--before-context', 1, '-g', $word, $file]); are_mutually_exclusive('-C', '-f', ['-C', 1, '-f', $word, $file]); are_mutually_exclusive('-C', '-g', ['-C', 1, '-g', $word, $file]); are_mutually_exclusive('--context', '-f', ['--context', 1, '-f', $word, $file]); are_mutually_exclusive('--context', '-g', ['--context', 1, '-g', $word, $file]); # -f are_mutually_exclusive('-f', '-g', ['-f', '-g', $word, $file]); are_mutually_exclusive('-f', '--group', ['-f', '--group', $word, $file]); are_mutually_exclusive('-f', '--heading', ['-f', '--heading', $word, $file]); are_mutually_exclusive('-f', '--break', ['-f', '--break', $word, $file]); # -g are_mutually_exclusive('-g', '--group', ['-g', '--group', $word, $file]); are_mutually_exclusive('-g', '--heading', ['-g', '--heading', $word, $file]); are_mutually_exclusive('-g', '--break', ['-g', '--break', $word, $file]); subtest q{Verify that "options" that follow -- aren't factored into the mutual exclusivity} => sub { my ( $stdout, $stderr ) = run_ack_with_stderr('-A', 5, $word, $file, '--', '-l'); ok(@{$stdout} > 0, 'Some lines should appear on standard output'); is(scalar(@{$stderr}), 1, 'A single line should be present on standard error'); like($stderr->[0], qr/No such file or directory/, 'The error message should indicate a missing file (-l is a filename here, not an option)'); is(get_rc(), 0, 'The ack command should not fail'); }; subtest q{Verify that mutually exclusive options in different sources don't cause a problem} => sub { my $ackrc = <<'HERE'; --group HERE my @stdout = run_ack('--count', $file, { ackrc => \$ackrc, }); ok(@stdout > 0, 'Some lines should appear on standard output'); }; done_testing(); # Do this without system(). sub are_mutually_exclusive { local $Test::Builder::Level = $Test::Builder::Level + 1; my ( $opt1, $opt2, $args ) = @_; my @args = @{$args}; my ( $stdout, $stderr ) = run_ack_with_stderr(@args); return subtest "are_mutually_exclusive( $opt1, $opt2, @args )" => sub { plan tests => 4; isnt( get_rc(), 0, 'The ack command should fail' ); is_empty_array( $stdout, 'No lines should be present on standard output' ); is( scalar(@{$stderr}), 1, 'A single line should be present on standard error' ); my $opt1_re = quotemeta($opt1); my $opt2_re = quotemeta($opt2); my $error = $stderr->[0] || ''; # avoid undef warnings if ( $error =~ /Options '$opt1_re' and '$opt2_re' are mutually exclusive/ || $error =~ /Options '$opt2_re' and '$opt1_re' are mutually exclusive/ ) { pass( qq{Error message resembles "Options '$opt1' and '$opt2' are mutually exclusive"} ); } else { fail( qq{Error message does not resemble "Options '$opt1' and '$opt2' are mutually exclusive"} ); diag("Error message: '$error'"); } }; } ack-2.22/t/FilterTest.pm0000644000175000017500000000200513215622003013522 0ustar andyandypackage FilterTest; use strict; use warnings; use base 'Exporter'; use App::Ack::Resource; use File::Next; use Util; use Test::More; our @EXPORT = qw(filter_test); sub swamp_files { my @swamp_files; my $files = File::Next::files( 't/swamp' ); while ( my $file = $files->() ) { push( @swamp_files, $file ); } return @swamp_files; } sub filter_test { local $Test::Builder::Level = $Test::Builder::Level + 1; my $filter_args = shift; my $expected_matches = shift; my $msg = shift or die 'Must pass a message to filter_test()'; return subtest "filter_test($msg)" => sub { my $filter = eval { App::Ack::Filter->create_filter(@{$filter_args}); }; ok($filter) or diag($@); my @matches = map { $_->name } grep { $filter->filter($_) } map { App::Ack::Resource->new($_) } swamp_files(); sets_match(\@matches, $expected_matches, $msg); }; } 1; ack-2.22/t/ack-1.t0000644000175000017500000000326513213402177012177 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 12; use lib 't'; use Util; prep_environment(); SINGLE_TEXT_MATCH: { my @expected = ( 'the catacombs of the Montresors.' ); my @files = qw( t/text ); my @args = qw( Montresor -1 -h --sort-files ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Looking for first instance of Montresor!' ); } DASH_V: { my @expected = ( ' Only this and nothing more."' ); my @files = qw( t/text/raven.txt ); my @args = qw( c -1 -h -v ); my @results = run_ack( @args, @files ); lists_match( \@results, \@expected, 'Looking for first non-match' ); } DASH_F: { my @files = qw( t/swamp ); my @args = qw( -1 -f ); my @results = run_ack( @args, @files ); my $test_path = reslash( 't/swamp/' ); is( scalar @results, 1, 'Should only get one file back' ); like( $results[0], qr{^\Q$test_path\E}, 'One of the files from the swamp' ); } DASH_G: { my $regex = '\bMakefile\b'; my @files = qw( t/ ); my @args = ( '-1', '-g', $regex ); my @results = run_ack( @args, @files ); my $test_path = reslash( 't/swamp/Makefile' ); is( scalar @results, 1, "Should only get one file back from $regex" ); like( $results[0], qr{^\Q$test_path\E(?:[.]PL)?$}, 'The one file matches one of the two Makefile files' ); } DASH_L: { my $target = 'the'; my @files = reslash( 't/text' ); my @args = ( '-1', '-l', '--sort-files', $target ); my @results = run_ack( @args, @files ); my $expected = reslash( 't/text/amontillado.txt' ); is_deeply( \@results, [$expected], 'Should only get one matching file back' ); } ack-2.22/t/ack-w.t0000644000175000017500000001440213213402177012300 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 16; use lib 't'; use Util; prep_environment(); TRAILING_PUNC: { my @expected = line_split( <<'HERE' ); Respite-respite and nepenthe from thy memories of Lenore!" Clasp a rare and radiant maiden whom the angels name Lenore!" HERE my @files = qw( t/text ); my @args = qw( Lenore! -w -h --sort-files ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for Lenore!' ); } TRAILING_METACHAR_BACKSLASH_W: { my @expected = line_split( <<'HERE' ); be a Majority of the whole Number of Electors appointed; and if there be President. But if there should remain two or more who have equal Votes, HERE my @files = qw( t/text/constitution.txt ); my @args = qw( ther\w -w --sort-files ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for ther\\w, with -w, so no thereofs or thereins' ); } TRAILING_METACHAR_DOT: { # Because the . at the end of the regular expression is not a word # character, a word boundary is not required after the match. my @expected = line_split( <<'HERE' ); speech, or of the press; or the right of the people peaceably to assemble, the right of the people to keep and bear Arms, shall not be infringed. The right of the people to be secure in their persons, houses, papers, In all criminal prosecutions, the accused shall enjoy the right to a twenty dollars, the right of trial by jury shall be preserved, and no The enumeration in the Constitution, of certain rights, shall not be limited Times to Authors and Inventors the exclusive Right to their HERE my @files = qw( t/text ); my @args = ( 'right.', qw( -i -w -h --sort-files ) ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for right.' ); } BEGINS_AND_ENDS_WITH_WORD_CHAR: { # Normal case of whole word match. my @expected = line_split( <<'HERE' ); Each House shall be the Judge of the Elections, Returns and Qualifications shall judge necessary and expedient; he may, on extraordinary Occasions, HERE my @files = qw( t/text ); my @args = ( 'judge', qw( -w -h -i --sort-files ) ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for two "judge" as whole word, not five "judge/judges"' ); } BEGINS_BUT_NOT_ENDS_WITH_WORD_CHAR: { # The last character of the regexp is not a word, disabling the word boundary check at the end of the match. my @expected = line_split( <<'HERE' ); All legislative Powers herein granted shall be vested in a Congress and shall have the sole Power of Impeachment. The Senate shall have the sole Power to try all Impeachments. When The Congress shall have Power To lay and collect Taxes, Duties, Imposts Execution the foregoing Powers, and all other Powers vested by this or Compact with another State, or with a foreign Power, or engage in War, The executive Power shall be vested in a President of the United States Resignation, or Inability to discharge the Powers and Duties of the said and he shall have Power to Grant Reprieves and Pardons for Offences He shall have Power, by and with the Advice and Consent of the Senate, The President shall have Power to fill up all Vacancies that may happen The judicial Power of the United States, shall be vested in one supreme The judicial Power shall extend to all Cases, in Law and Equity, The Congress shall have Power to declare the Punishment of Treason, but The Congress shall have Power to dispose of and make all needful Rules and HERE my @files = qw( t/text/constitution.txt ); my @args = ( 'pow()', qw( -w -h -i ) ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for "pow()" with word flag, but regexp does not end with word char' ); } ENDS_BUT_NOT_BEGINS_WITH_WORD_CHAR: { # The first character of the regexp is not a word, disabling the word boundary check at the start of the match. my @expected = line_split( <<'HERE' ); each State shall have the Qualifications requisite for Electors of the Providence Plantations one, Connecticut five, New-York six, New Jersey The Times, Places and Manner of holding Elections for Senators and Regulations, except as to the Places of chusing Senators. Each House shall be the Judge of the Elections, Returns and Qualifications return it, with his Objections to that House in which it shall have originated, who shall enter the Objections at large on their Journal, with the Objections, to the other House, by which it shall likewise be and House of Representatives, according to the Rules and Limitations To regulate Commerce with foreign Nations, and among the several States, and Offences against the Law of Nations; suppress Insurrections and repel Invasions; Appropriations made by Law; and a regular Statement and Account of the Fact, with such Exceptions, and under such Regulations as the Congress Regulations respecting the Territory or other Property belonging to the by Conventions in three fourths thereof, as the one or the other Mode of The Ratification of the Conventions of nine States, shall be sufficient HERE my @files = qw( t/text/constitution.txt ); my @args = ( '()tions', qw( -w -h --sort-files ) ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for "()tions" with word flag, but regexp does not begin with word char' ); } NEITHER_BEGINS_NOR_ENDS_WITH_WORD_CHAR: { # Because the regular expression doesn't begin or end with a word character, the 'words mode' doesn't affect the match. my @expected = line_split( <<'HERE' ); Each House shall be the Judge of the Elections, Returns and Qualifications Session of their respective Houses, and in going to and returning from return it, with his Objections to that House in which it shall have any Bill shall not be returned by the President within ten Days (Sundays their Adjournment prevent its Return, in which Case it shall not be a Law. HERE my @files = qw( t/text/constitution.txt ); my @args = ( '(return)', qw( -w -i -h ) ); ack_lists_match( [ @args, @files ], \@expected, 'Looking for "return" with word flag, but regexp does not begin or end with word char' ); } # Test for issue #443 ALTERNATING_NUMBERS: { my @expected = (); my @files = qw( t/text/number.txt ); my @args = ( '650|660|670|680', '-w' ); ack_lists_match( [ @args, @files ], \@expected, 'Alternations should also respect boundaries when using -w' ); } done_testing(); ack-2.22/t/ack-print0.t0000644000175000017500000000461713213402177013255 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 15; use lib 't'; use Util; prep_environment(); G_NO_PRINT0: { my @expected = qw( t/text/amontillado.txt t/text/bill-of-rights.txt t/text/constitution.txt t/text/ozymandias.txt ); my $filename_regex = 'i'; my @files = qw( t/text/ ); my @args = ( '-g', $filename_regex ); my @results = run_ack( @args, @files ); sets_match( \@results, \@expected, 'Files found with -g and without --print0' ); is_empty_array( [ grep { /\0/ } @results ], ' ... no null byte in output' ); } G_PRINT0: { my $expected = join( "\0", map { reslash($_) } qw( t/text/amontillado.txt t/text/bill-of-rights.txt t/text/constitution.txt t/text/ozymandias.txt ) ) . "\0"; # string of filenames separated and concluded with null byte my $filename_regex = 'i'; my @files = qw( t/text ); my @args = ( '-g', $filename_regex, '--sort-files', '--print0' ); my @results = run_ack( @args, @files ); is_deeply( \@results, [$expected], 'Files found with -g and with --print0' ); } F_PRINT0: { my @files = qw( t/text/ ); my @args = qw( -f --print0 ); my @results = run_ack( @args, @files ); # Checking for exact files is fragile, so just see whether we have \0 in output. is( scalar @results, 1, 'Only one line of output with -f and --print0' ); is_nonempty_array( [ grep { /\0/ } @results ], ' ... and null bytes in output' ); } L_PRINT0: { my $regex = 'of'; my @files = qw( t/text/ ); my @args = ( '-l', '--print0', $regex ); my @results = run_ack( @args, @files ); # Checking for exact files is fragile, so just see whether we have \0 in output. is( scalar @results, 1, 'Only one line of output with -l and --print0' ); is_nonempty_array( [ grep { /\0/ } @results ], ' ... and null bytes in output' ); } COUNT_PRINT0: { my $regex = 'of'; my @files = qw( t/text/ ); my @args = ( '--count', '--print0', $regex ); my @results = run_ack( @args, @files ); # Checking for exact files is fragile, so just see whether we have \0 in output. is( scalar @results, 1, 'Only one line of output with --count and --print0' ); is_nonempty_array( [ grep { /\0/ } @results ], ' ... and null bytes in output' ); is_nonempty_array( [ grep { /:\d+/ } @results ], ' ... and ":\d+" in output, so the counting also works' ); } ack-2.22/t/ack-f.t0000644000175000017500000000532413213376747012277 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 6; use lib 't'; use Util; prep_environment(); DEFAULT_DIR_EXCLUSIONS: { my @expected = ( qw( t/swamp/0 t/swamp/c-header.h t/swamp/c-source.c t/swamp/crystallography-weenies.f t/swamp/example.R t/swamp/file.bar t/swamp/file.foo t/swamp/fresh.css t/swamp/groceries/another_subdir/fruit t/swamp/groceries/another_subdir/junk t/swamp/groceries/another_subdir/meat t/swamp/groceries/dir.d/fruit t/swamp/groceries/dir.d/junk t/swamp/groceries/dir.d/meat t/swamp/groceries/fruit t/swamp/groceries/junk t/swamp/groceries/meat t/swamp/groceries/subdir/fruit t/swamp/groceries/subdir/junk t/swamp/groceries/subdir/meat t/swamp/html.htm t/swamp/html.html t/swamp/incomplete-last-line.txt t/swamp/javascript.js t/swamp/lua-shebang-test t/swamp/Makefile t/swamp/Makefile.PL t/swamp/MasterPage.master t/swamp/notaMakefile t/swamp/notaRakefile t/swamp/notes.md t/swamp/options-crlf.pl t/swamp/options.pl t/swamp/parrot.pir t/swamp/perl-test.t t/swamp/perl-without-extension t/swamp/perl.cgi t/swamp/perl.handler.pod t/swamp/perl.pl t/swamp/perl.pm t/swamp/perl.pod t/swamp/pipe-stress-freaks.F t/swamp/Rakefile t/swamp/Sample.ascx t/swamp/Sample.asmx t/swamp/sample.asp t/swamp/sample.aspx t/swamp/sample.rake t/swamp/service.svc t/swamp/stuff.cmake t/swamp/CMakeLists.txt t/swamp/swamp/ignoreme.txt ), 't/swamp/not-an-#emacs-workfile#', ); my @args = qw( -f t/swamp ); ack_sets_match( [ @args ], \@expected, 'DEFAULT_DIR_EXCLUSIONS' ); is( get_rc(), 0, '-f with matches exits with 0' ); } COMBINED_FILTERS: { my @expected = qw( t/swamp/0 t/swamp/perl.pm t/swamp/Rakefile t/swamp/options-crlf.pl t/swamp/options.pl t/swamp/perl-without-extension t/swamp/perl.cgi t/swamp/Makefile.PL t/swamp/perl-test.t t/swamp/perl.handler.pod t/swamp/perl.pl t/swamp/perl.pod ); my @args = qw( -f t/swamp --perl --rake ); ack_sets_match( [ @args ], \@expected, 'COMBINED_FILTERS' ); is( get_rc(), 0, '-f with matches exits with 0' ); } EXIT_CODE: { my @expected; my @args = qw( -f t/swamp --type-add=baz:ext:baz --baz ); ack_sets_match( \@args, \@expected, 'EXIT_CODE' ); is( get_rc(), 1, '-f with no matches exits with 1' ); } done_testing(); ack-2.22/t/ack-s.t0000644000175000017500000000201413213402177012270 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 4; use lib 't'; use Util; use File::Temp; prep_environment(); WITHOUT_S: { my @files = qw( non-existent-file.txt ); my @args = qw( search-term ); my (undef, $stderr) = run_ack_with_stderr( @args, @files ); is( @{$stderr}, 1 ); like( $stderr->[0], qr/\Qnon-existent-file.txt: No such file or directory\E/, q{Error if there's no file} ); } WITH_S: { my @files = qw( non-existent-file.txt ); my @args = qw( search-term -s ); my (undef, $stderr) = run_ack_with_stderr( @args, @files ); is_empty_array( $stderr ); } WITH_RESTRICTED_DIR: { my @args = qw( hello -s ); my $dir = File::Temp->newdir; my $wd = getcwd_clean(); safe_chdir( $dir->dirname ); safe_mkdir( 'foo' ); write_file 'foo/bar' => "hello\n"; write_file 'baz' => "hello\n"; chmod 0000, 'foo'; chmod 0000, 'baz'; my (undef, $stderr) = run_ack_with_stderr( @args ); is_empty_array( $stderr ); safe_chdir( $wd ); } ack-2.22/t/lib/0000755000175000017500000000000013217305507011661 5ustar andyandyack-2.22/t/lib/FirstLineMatch.t0000644000175000017500000000031412726365114014724 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::FirstLineMatch; pass( 'App::Ack::Filter::FirstLineMatch loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/IsGroup.t0000644000175000017500000000027612726365114013447 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::IsGroup; pass( 'App::Ack::Filter::IsGroup loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Default.t0000644000175000017500000000027612726365114013443 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::Default; pass( 'App::Ack::Filter::Default loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Filter.t0000644000175000017500000000025412726365114013300 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter; pass( 'App::Ack::Filter loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Extension.t0000644000175000017500000000030212726365114014021 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::Extension; pass( 'App::Ack::Filter::Extension loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Is.t0000644000175000017500000000026412726365114012427 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::Is; pass( 'App::Ack::Filter::Is loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/00-coverage.t0000644000175000017500000000074413066014025014055 0ustar andyandy#!perl -T # Make sure we have a .t file each *.pm. This prevents a forgetful # developer from creating a .pm without making the test, too. # If you've made this test fail, it's because you need a t/lib/*.t # file to test your new module. use warnings; use strict; use Test::More; my @pms = glob( '*.pm' ); plan tests => scalar @pms; for my $pm ( @pms ) { my $t = $pm; $t =~ s/\.pm$/.t/ or die; ok( -r "t/lib/$t", "$pm has a corresponding $t" ); } done_testing(); ack-2.22/t/lib/ConfigLoader.t0000644000175000017500000000027012726365114014405 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::ConfigLoader; pass( 'App::Ack::ConfigLoader loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/ExtensionGroup.t0000644000175000017500000000031412726365114015041 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::ExtensionGroup; pass( 'App::Ack::Filter::ExtensionGroup loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Resources.t0000644000175000017500000000026212726365114014024 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Resources; pass( 'App::Ack::Resources loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/ConfigDefault.t0000644000175000017500000000027212726365114014565 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::ConfigDefault; pass( 'App::Ack::ConfigDefault loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/MatchGroup.t0000644000175000017500000000030412726365114014120 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::MatchGroup; pass( 'App::Ack::Filter::MatchGroup loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/ConfigFinder.t0000644000175000017500000000027012726365114014406 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::ConfigFinder; pass( 'App::Ack::ConfigFinder loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Inverse.t0000644000175000017500000000027612726365114013472 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::Inverse; pass( 'App::Ack::Filter::Inverse loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/IsPath.t0000644000175000017500000000027412726365114013245 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::IsPath; pass( 'App::Ack::Filter::IsPath loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Ack.t0000644000175000017500000000023412726365114012547 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack; pass( 'App::Ack loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Collection.t0000644000175000017500000000030412726365114014142 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::Collection; pass( 'App::Ack::Filter::Collection loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/IsPathGroup.t0000644000175000017500000000030612726365114014256 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::IsPathGroup; pass( 'App::Ack::Filter::IsPathGroup loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Match.t0000644000175000017500000000027212726365114013107 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Filter::Match; pass( 'App::Ack::Filter::Match loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/lib/Resource.t0000644000175000017500000000026012726365114013637 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 1; use App::Ack::Resource; pass( 'App::Ack::Resource loaded with nothing else loaded first' ); done_testing(); ack-2.22/t/issue491.t0000644000175000017500000000137213213402177012666 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 4; use File::Temp; use Util; prep_environment(); my $dir = File::Temp->newdir; my $wd = getcwd_clean(); safe_chdir( $dir->dirname ); write_file('space-newline.txt', " \n"); write_file('space-newline-newline.txt', " \n\n"); my @results = run_ack('-l', ' $', 'space-newline.txt', 'space-newline-newline.txt'); sets_match(\@results, [ 'space-newline.txt', 'space-newline-newline.txt', ], 'both files should be in -l output'); @results = run_ack('-c', ' $', 'space-newline.txt', 'space-newline-newline.txt'); sets_match(\@results, [ 'space-newline.txt:1', 'space-newline-newline.txt:1', ], 'both files should be in -c output with correct counts'); safe_chdir( $wd ); ack-2.22/t/filter.t0000644000175000017500000000144713213376747012605 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 5; use App::Ack::Filter; my $filter; $filter = eval { App::Ack::Filter->create_filter('test'); }; ok( !$filter, 'Creating an unknown filter should fail' ); like( $@, qr/unknown filter/i, 'Got the expected error' ); App::Ack::Filter->register_filter(test => 'TestFilter'); $filter = eval { App::Ack::Filter->create_filter('test', qw/foo bar/); }; ok( $filter, 'Creating a registered filter should succeed' ) or diag($@); isa_ok( $filter, 'TestFilter', 'Creating a test filter should be a TestFilter' ); is_deeply( $filter, [qw/foo bar/], 'Extra arguments should get passed through to constructor' ); package TestFilter; use strict; use warnings; sub new { my ( $class, @args ) = @_; return bless \@args, $class; } 1; ack-2.22/t/process-substitution.t0000644000175000017500000000220313213376747015537 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Test::More; use Util; my @expected = ( 'THIS IS ALL IN UPPER CASE', 'this is a word here', ); prep_environment(); if ( is_windows() ) { plan skip_all => 'Test unreliable on Windows.'; } system 'bash', '-c', 'exit'; if ( $? ) { plan skip_all => 'You need bash to run this test'; exit; } plan tests => 1; my ( $read, $write ); pipe( $read, $write ); my $pid = fork(); my @output; if ( $pid ) { close $write; while(<$read>) { chomp; push @output, $_; } waitpid $pid, 0; } else { close $read; open STDOUT, '>&', $write or die "Can't open: $!"; open STDERR, '>&', $write or die "Can't open: $!"; my @args = build_ack_invocation( qw( --noenv --nocolor --smart-case this ) ); # XXX doing this by hand here eq '=(' my $perl = caret_X(); if ( $ENV{'ACK_TEST_STANDALONE'} ) { unshift( @args, $perl ); } else { unshift( @args, $perl, '-Mblib' ); } my $args = join( ' ', @args ); exec 'bash', '-c', "$args <(cat t/swamp/options.pl)"; } lists_match( \@output, \@expected, __FILE__ ); ack-2.22/t/ack-c.t0000644000175000017500000000603713213376747012276 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 12; use lib 't'; use Util; prep_environment(); DASH_L: { my @expected = qw( t/text/amontillado.txt t/text/gettysburg.txt t/text/raven.txt ); my @args = qw( God -i -l --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'Looking for God with -l' ); } DASH_CAPITAL_L: { my @expected = qw( t/text/bill-of-rights.txt t/text/constitution.txt t/text/number.txt t/text/numbered-text.txt t/text/ozymandias.txt ); my @switches = ( ['-L'], ['--files-without-matches'], ); for my $switches ( @switches ) { my @files = qw( t/text ); my @args = ( 'God', @{$switches}, '--sort-files' ); ack_sets_match( [ @args, @files ], \@expected, "Looking for God with @{$switches}" ); } } DASH_LV: { my @expected = qw( t/text/amontillado.txt t/text/bill-of-rights.txt t/text/constitution.txt t/text/gettysburg.txt t/text/number.txt t/text/numbered-text.txt t/text/ozymandias.txt t/text/raven.txt ); my @switches = ( ['-l','-v'], ['-l','--invert-match'], ['--files-with-matches','-v'], ['--files-with-matches','--invert-match'], ); for my $switches ( @switches ) { my @files = qw( t/text ); my @args = ( 'religion', @{$switches}, '--sort-files' ); ack_sets_match( [ @args, @files ], \@expected, '-l -v will match all input files because "religion" will not be on every line' ); } } DASH_C: { my @expected = qw( t/text/amontillado.txt:2 t/text/bill-of-rights.txt:0 t/text/constitution.txt:0 t/text/gettysburg.txt:1 t/text/number.txt:0 t/text/numbered-text.txt:0 t/text/ozymandias.txt:0 t/text/raven.txt:2 ); my @args = qw( God -c --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'God counts' ); } DASH_LC: { my @expected = qw( t/text/bill-of-rights.txt:1 t/text/constitution.txt:29 ); my @args = qw( congress -i -l -c --sort-files ); my @files = qw( t/text ); ack_sets_match( [ @args, @files ], \@expected, 'congress counts with -l -c' ); } PIPE_INTO_C: { my $file = 't/text/raven.txt'; my @args = qw( nevermore -i -c ); my @results = pipe_into_ack( $file, @args ); is_deeply( \@results, [ 11 ], 'Piping into ack --count should return one line of results' ); } DASH_HC: { my @args = qw( Montresor -c -h ); my @files = qw( t/text ); my @expected = ( '3' ); ack_sets_match( [ @args, @files ], \@expected, 'ack -c -h should return one line of results' ); } SINGLE_FILE_COUNT: { my @args = qw( Montresor -c -h ); my @files = ( 't/text/amontillado.txt' ); my @expected = ( '3' ); ack_sets_match( [ @args, @files ], \@expected, 'ack -c -h should return one line of results' ); } done_testing(); ack-2.22/t/ack-match.t0000644000175000017500000000645013216123637013136 0ustar andyandy#!perl -T use strict; use warnings; use File::Spec (); use File::Temp (); use Test::More; use lib 't'; use Util; prep_environment(); my @tests = ( [ qw/Sue/ ], [ qw/boy -i/ ], # case-insensitive is handled correctly with --match [ qw/ll+ -Q/ ], # quotemeta is handled correctly with --match [ qw/gon -w/ ], # words is handled correctly with --match ); plan tests => @tests + 11; test_match( @{$_} ) for @tests; # Giving only the --match argument (and no other args) should not result in an error. run_ack( '--match', 'Sue' ); # Not giving a regex when piping into ack should result in an error. my ($stdout, $stderr) = pipe_into_ack_with_stderr( 't/text/amontillado.txt', '--perl' ); isnt( get_rc(), 0, 'ack should return an error when piped into without a regex' ); is_empty_array( $stdout, 'ack should return no STDOUT when piped into without a regex' ); cmp_ok( scalar @{$stderr}, '>', 0, 'Has to have at least one line of error message, but could have more under Appveyor' ); my $name = $ENV{ACK_TEST_STANDALONE} ? 'ack-standalone' : 'ack'; is( $stderr->[0], "$name: No regular expression found.", 'Error message matches' ); my $wd = getcwd_clean(); my $tempdir = File::Temp->newdir; safe_mkdir( File::Spec->catdir($tempdir->dirname, 'subdir') ); PROJECT_ACKRC_MATCH_FORBIDDEN: { my @files = untaint( File::Spec->rel2abs('t/text/') ); my @args = qw/ --env /; safe_chdir( $tempdir->dirname ); write_file '.ackrc', "--match=question\n"; my ( $stdout, $stderr ) = run_ack_with_stderr(@args, @files); is_empty_array( $stdout ); first_line_like( $stderr, qr/\QOptions --output, --pager and --match are forbidden in project .ackrc files/ ); safe_chdir( $wd ); } HOME_ACKRC_MATCH_PERMITTED: { my @files = untaint( File::Spec->rel2abs('t/text/') ); my @args = qw/ --env /; write_file(File::Spec->catfile($tempdir->dirname, '.ackrc'), "--match=question\n"); safe_chdir( File::Spec->catdir($tempdir->dirname, 'subdir') ); local $ENV{'HOME'} = $tempdir->dirname; my ( $stdout, $stderr ) = run_ack_with_stderr(@args, @files); is_nonempty_array( $stdout ); is_empty_array( $stderr ); safe_chdir( $wd ); } ACKRC_ACKRC_MATCH_PERMITTED: { my @files = untaint( File::Spec->rel2abs('t/text/') ); my @args = qw/ --env /; write_file(File::Spec->catfile($tempdir->dirname, '.ackrc'), "--match=question\n"); safe_chdir( File::Spec->catdir($tempdir->dirname, 'subdir') ); local $ENV{'ACKRC'} = File::Spec->catfile($tempdir->dirname, '.ackrc'); my ( $stdout, $stderr ) = run_ack_with_stderr(@args, @files); is_nonempty_array( $stdout ); is_empty_array( $stderr ); safe_chdir( $wd ); } done_testing; # Call ack normally and compare output to calling with --match regex. # # Due to 2 calls to run_ack, this sub runs altogether 3 tests. sub test_match { local $Test::Builder::Level = $Test::Builder::Level + 1; my $regex = shift; my @args = @_; push @args, '--sort-files'; return subtest "test_match( @args )" => sub { my @files = ( 't/text' ); my @results_normal = run_ack( @args, $regex, @files ); my @results_match = run_ack( @args, @files, '--match', $regex ); return sets_match( \@results_normal, \@results_match, "Same output for regex '$regex'." ); }; } ack-2.22/t/ack-files-from.t0000644000175000017500000000347013216123637014104 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use File::Temp; use Test::More tests => 3; use Util; prep_environment(); subtest 'Basic reading from files, no switches' => sub { plan tests => 2; my $target_file = reslash( 't/swamp/options.pl' ); my @expected = line_split( <<"HERE" ); $target_file:2:use strict; HERE my $tempfile = fill_temp_file( qw( t/swamp/options.pl t/swamp/pipe-stress-freaks.F ) ); ack_lists_match( [ '--files-from=' . $tempfile->filename, 'strict' ], \@expected, 'Looking for strict in multiple files' ); unlink $tempfile->filename; }; subtest 'Non-existent file specified' => sub { plan tests => 3; my @args = qw( strict ); my ( $stdout, $stderr ) = run_ack_with_stderr( '--files-from=non-existent-file', @args); is_empty_array( $stdout, 'No STDOUT for non-existent file' ); is( scalar @{$stderr}, 1, 'One line of STDERR for non-existent file' ); like( $stderr->[0], qr/Unable to open non-existent-file:/, 'Correct warning message for non-existent file' ); }; subtest 'Source file exists, but non-existent files mentioned in the file' => sub { plan tests => 4; my $tempfile = fill_temp_file( qw( t/swamp/options.pl file-that-isnt-there ) ); my ( $stdout, $stderr ) = run_ack_with_stderr( '--files-from=' . $tempfile->filename, 'CASE'); is( scalar @{$stdout}, 1, 'One hit found' ); like( $stdout->[0], qr/THIS IS ALL IN UPPER CASE/, 'Find the one line in the file' ); is( scalar @{$stderr}, 1, 'One line of STDERR for non-existent file' ); like( $stderr->[0], qr/file-that-isnt-there: No such file/, 'Correct warning message for non-existent file' ); }; sub fill_temp_file { my @lines = @_; my $tempfile = File::Temp->new; print {$tempfile} "$_\n" for @lines; close $tempfile; return $tempfile; } ack-2.22/t/config-backwards-compat.t0000644000175000017500000000163413216123637015772 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Util; use File::Temp; use Test::More tests => 3; prep_environment(); my $old_config = <<'HERE'; # Always sort --sort-files # I'm tired of grouping --noheading --break # Handle .pmc files --type-set=pmc=.pmc # Handle .hwd files --type-set=hwd=.hwd # Handle .md files --type-set=md=.mkd --type-add=md=.md # Handle .textile files --type-set=textile=.textile # Hooray for smart-case! --smart-case --ignore-dir=nytprof HERE my $temp_config = File::Temp->new; print { $temp_config } $old_config; close $temp_config; my @args = ( '--ackrc=' . $temp_config->filename, '--md', 'One', 't/swamp/' ); my $file = reslash('t/swamp/notes.md'); my $line = 3; my ( $stdout, $stderr ) = run_ack_with_stderr( @args ); is( scalar(@{$stdout}), 1, 'Got back exactly one line' ); like $stdout->[0], qr/\Q$file:$line\E.*[*] One/; is_empty_array( $stderr, 'No output to stderr' ); ack-2.22/t/incomplete-last-line.t0000644000175000017500000000224313216123637015327 0ustar andyandy#!perl -T use warnings; use strict; use Test::More tests => 5; use lib 't'; use Util; prep_environment(); # Check that a match on the last line of a file without a proper # ending newline gets this newline appended by ack. VERIFY_LAST_LINE_IS_MISSING_NEWLINE: { # Verify that our test data file is set up the way we expect and that it hasn't had a newline # added to the end of the file by mistake. open( my $fh, '<', 't/swamp/incomplete-last-line.txt' ) or die $!; my @lines = <$fh>; close $fh; is( substr( $lines[0], -1, 1 ), "\n", 'First line ends with a newline' ); is( substr( $lines[1], -1, 1 ), "\n", 'Second line ends with a newline' ); is( substr( $lines[2], -1, 1 ), '!', 'Third line ends with a bang, not a newline' ); } INCOMPLETE_LAST_LINE: { my @expected = line_split( <<"HERE" ); but no new line on the last line! the last full measure of devotion -- that we here highly resolve that HERE my @args = qw( -h --nogroup last ); my @files = qw( t/swamp/incomplete-last-line.txt t/text/gettysburg.txt ); ack_lists_match( [ @args, @files ], \@expected, 'Incomplete line gets a newline appended.' ); } done_testing(); ack-2.22/t/ack-ignore-file.t0000644000175000017500000000031413213376747014244 0ustar andyandy#!perl -T use strict; use warnings; use Test::More skip_all => 'Not yet implemented'; # XXX look at --ignore-dir, but apply to --ignore-file # XXX is: match: ext: firstlinematch: # XXX --no-ignorefile ack-2.22/t/inverted-file-filter.t0000644000175000017500000000405213213376747015333 0ustar andyandy#!perl -T use strict; use warnings; use lib 't'; use Test::More tests => 2; use Util; prep_environment(); EXCLUDE_ONLY: { my @expected = ( qw( t/swamp/c-header.h t/swamp/c-source.c t/swamp/crystallography-weenies.f t/swamp/example.R t/swamp/file.bar t/swamp/file.foo t/swamp/fresh.css t/swamp/groceries/another_subdir/fruit t/swamp/groceries/another_subdir/junk t/swamp/groceries/another_subdir/meat t/swamp/groceries/dir.d/fruit t/swamp/groceries/dir.d/junk t/swamp/groceries/dir.d/meat t/swamp/groceries/fruit t/swamp/groceries/junk t/swamp/groceries/meat t/swamp/groceries/subdir/fruit t/swamp/groceries/subdir/junk t/swamp/groceries/subdir/meat t/swamp/html.htm t/swamp/html.html t/swamp/incomplete-last-line.txt t/swamp/javascript.js t/swamp/lua-shebang-test t/swamp/Makefile t/swamp/MasterPage.master t/swamp/notaMakefile t/swamp/notaRakefile t/swamp/notes.md t/swamp/parrot.pir t/swamp/pipe-stress-freaks.F t/swamp/Rakefile t/swamp/Sample.ascx t/swamp/Sample.asmx t/swamp/sample.asp t/swamp/sample.aspx t/swamp/sample.rake t/swamp/service.svc t/swamp/stuff.cmake t/swamp/CMakeLists.txt t/swamp/swamp/ignoreme.txt ), 't/swamp/not-an-#emacs-workfile#', ); my @args = qw( --noperl -f t/swamp ); ack_sets_match( [ @args ], \@expected, 'Exclude only' ); } INCLUDE_PLUS_EXCLUDE_ONLY: { my @expected = qw( t/swamp/0 t/swamp/perl.pm t/swamp/options-crlf.pl t/swamp/options.pl t/swamp/perl-without-extension t/swamp/perl.cgi t/swamp/Makefile.PL t/swamp/perl-test.t t/swamp/perl.pl ); my @args = ( '--type-add=pod:ext:pod', '--perl', '--nopod', '-f', 't/swamp' ); ack_sets_match( [ @args ], \@expected, 'Include plus exclude only' ); } ack-2.22/t/issue244.t0000644000175000017500000000042513213402177012660 0ustar andyandy#!perl -T # https://github.com/beyondgrep/ack2/issues/244 use strict; use warnings; use Test::More; use lib 't'; use Util; plan tests => 1; prep_environment(); my ( $stdout, $stderr ) = run_ack_with_stderr('--color', '(foo)|(bar)', 't/swamp'); is_empty_array( $stderr ); ack-2.22/t/noenv.t0000644000175000017500000000452213213402177012425 0ustar andyandy#!perl -T use strict; use warnings; use Test::More tests => 5; use lib 't'; use Util; use App::Ack::ConfigLoader; use Cwd qw( realpath ); use File::Spec (); use File::Temp (); sub is_global_file { my ( $filename ) = @_; return unless -f $filename; my ( undef, $dir ) = File::Spec->splitpath($filename); $dir = File::Spec->canonpath($dir); my (undef, $wd) = File::Spec->splitpath(getcwd_clean(), 1); $wd = File::Spec->canonpath($wd); return $wd !~ /^\Q$dir\E/; } sub remove_defaults_and_globals { my ( @sources ) = @_; return grep { $_->{name} ne 'Defaults' && !is_global_file($_->{name}) } @sources; } prep_environment(); my $wd = getcwd_clean() or die; my $tempdir = File::Temp->newdir; safe_chdir( $tempdir->dirname ); write_file( '.ackrc', <<'ACKRC' ); --type-add=perl:ext:pl,t,pm ACKRC subtest 'without --noenv' => sub { local @ARGV = ('-f', 'lib/'); local $ENV{'ACK_OPTIONS'} = '--perl'; my @sources = App::Ack::ConfigLoader::retrieve_arg_sources(); @sources = remove_defaults_and_globals(@sources); is_deeply( \@sources, [ { name => File::Spec->canonpath(realpath(File::Spec->catfile($tempdir->dirname, '.ackrc'))), contents => [ '--type-add=perl:ext:pl,t,pm' ], project => 1, }, { name => 'ACK_OPTIONS', contents => '--perl', }, { name => 'ARGV', contents => ['-f', 'lib/'], }, ], 'Get back a long list of arguments' ); }; subtest 'with --noenv' => sub { local @ARGV = ('--noenv', '-f', 'lib/'); local $ENV{'ACK_OPTIONS'} = '--perl'; my @sources = App::Ack::ConfigLoader::retrieve_arg_sources(); @sources = remove_defaults_and_globals(@sources); is_deeply( \@sources, [ { name => 'ARGV', contents => ['-f', 'lib/'], }, ], 'Short list comes back because of --noenv' ); }; NOENV_IN_CONFIG: { append_file( '.ackrc', "--noenv\n" ); local $ENV{'ACK_OPTIONS'} = '--perl'; my ( $stdout, $stderr ) = run_ack_with_stderr('--env', 'perl'); is_empty_array( $stdout ); is( @{$stderr}, 1 ); like( $stderr->[0], qr/--noenv found in (?:.*)[.]ackrc/ ) or diag(explain($stderr)); } safe_chdir( $wd ); # Go back to the original directory to avoid warnings ack-2.22/t/Util.pm0000644000175000017500000005010413216123637012367 0ustar andyandypackage Util; use parent 'Exporter'; use Carp (); use Cwd (); use File::Next (); use File::Spec (); use File::Temp (); use Term::ANSIColor (); use Test::More; our @EXPORT = qw( prep_environment touch_ackrc has_io_pty is_windows is_cygwin is_empty_array is_nonempty_array first_line_like build_ack_invocation read_file write_file append_file reslash reslash_all windows_slashify run_cmd run_ack run_ack_with_stderr run_ack_interactive pipe_into_ack pipe_into_ack_with_stderr lists_match sets_match ack_lists_match ack_sets_match untaint line_split colorize caret_X get_rc getcwd_clean safe_chdir safe_mkdir get_options ); my $orig_wd; my @temp_files; # We store temp files here to make sure they're properly reclaimed at interpreter shutdown. sub check_message { my $msg = shift; if ( !$msg ) { my (undef,undef,undef,$sub) = caller(1); Carp::croak( "You must pass a message to $sub" ); } return $msg; } sub prep_environment { my @ack_args = qw( ACK_OPTIONS ACKRC ACK_PAGER HOME ACK_COLOR_MATCH ACK_COLOR_FILENAME ACK_COLOR_LINE ); my @taint_args = qw( PATH CDPATH IFS ENV ); delete @ENV{ @ack_args, @taint_args }; if ( is_windows() ) { # To pipe, perl must be able to find cmd.exe, so add %SystemRoot%\system32 to the path. # See http://kstruct.com/2006/09/13/perl-taint-mode-and-cmdexe/ $ENV{'SystemRoot'} =~ /([A-Z]:(\\[A-Z0-9_]+)+)/i; my $system32_dir = File::Spec->catdir($1,'system32'); $ENV{'PATH'} = $system32_dir; } $orig_wd = getcwd_clean(); } sub is_windows { return $^O eq 'MSWin32'; } sub is_cygwin { return ($^O eq 'cygwin' || $^O eq 'msys'); } sub is_empty_array { local $Test::Builder::Level = $Test::Builder::Level + 1; my $aref = shift; my $msg = shift; my $ok = defined($aref) && (ref($aref) eq 'ARRAY') && (scalar(@{$aref}) == 0); if ( !ok( $ok, $msg ) ) { diag( explain( $aref ) ); } return $ok; } sub is_nonempty_array { local $Test::Builder::Level = $Test::Builder::Level + 1; my $aref = shift; my $msg = shift; my $ok = defined($aref) && (ref($aref) eq 'ARRAY') && (scalar(@{$aref}) > 0); if ( !ok( $ok, $msg ) ) { diag( explain( $aref ) ); } return $ok; } sub first_line_like { local $Test::Builder::Level = $Test::Builder::Level + 1; my $lines = shift; my $re = shift; my $msg = shift; my $ok = like( $lines->[0], $re, $msg ); diag(explain($lines)) unless $ok; return $ok; } sub build_ack_invocation { my @args = @_; my $options; foreach my $arg ( @args ) { if ( ref($arg) eq 'HASH' ) { if ( $options ) { Carp::croak('You may not specify more than one options hash'); } else { $options = $arg; } } } $options ||= {}; if ( my $ackrc = $options->{ackrc} ) { if ( ref($ackrc) eq 'SCALAR' ) { my $temp_ackrc = File::Temp->new; push @temp_files, $temp_ackrc; print { $temp_ackrc } $$ackrc, "\n"; close $temp_ackrc; $ackrc = $temp_ackrc->filename; } unshift @args, '--ackrc', $ackrc; } # The --noenv makes sure we don't pull in anything from the user # unless explicitly specified in the test if ( !grep { /^--(no)?env$/ } @args ) { unshift( @args, '--noenv' ); } if ( $ENV{'ACK_TEST_STANDALONE'} ) { unshift( @args, File::Spec->rel2abs( 'ack-standalone', $orig_wd ) ); } else { unshift( @args, File::Spec->rel2abs( 'blib/script/ack', $orig_wd ) ); } return @args; } # Use this instead of File::Slurp::read_file() sub read_file { my $filename = shift; open( my $fh, '<', $filename ) or die "Can't read $filename: \n"; my @lines = <$fh>; close $fh or die; return wantarray ? @lines : join( '', @lines ); } # Use this instead of File::Slurp::write_file() sub write_file { return _write_file( '>', 'create', @_ ); } # Use this instead of File::Slurp::append_file() sub append_file { return _write_file( '>>', 'append', @_ ); } sub _write_file { my $op = shift; my $verb = shift; my $filename = shift; my @lines = @_; open( my $fh, $op, $filename ) or die "Can't $verb $filename: \n"; for my $line ( @lines ) { print {$fh} $line; } close $fh or die; return; } sub line_split { return split( /\n/, $_[0] ); } sub reslash { return File::Next::reslash( shift ); } sub reslash_all { return map { File::Next::reslash( $_ ) } @_; } sub run_ack { local $Test::Builder::Level = $Test::Builder::Level + 1; my @args = @_; my ($stdout, $stderr) = run_ack_with_stderr( @args ); @args = grep { ref($_) ne 'HASH' } @args; if ( $TODO ) { fail( q{Automatically fail stderr check for TODO tests.} ); } else { is_empty_array( $stderr, "Should have no output to stderr: ack @args" ); } return wantarray ? @{$stdout} : join( "\n", @{$stdout} ); } { # scope for $ack_return_code; # Capture return code. our $ack_return_code; # Run the given command, assuming that the command was created with # build_ack_invocation (and thus writes its STDERR to $catcherr_file). # # Sets $ack_return_code and unlinks the $catcherr_file. # # Returns chomped STDOUT and STDERR as two array refs. sub run_cmd { my ( @cmd ) = @_; # my $cmd = join( ' ', @cmd ); # diag( "Running command: $cmd" ); my $options = {}; foreach my $arg (@cmd) { if ( ref($arg) eq 'HASH' ) { $options = $arg; } } @cmd = grep { ref($_) ne 'HASH' } @cmd; record_option_coverage(@cmd); check_command_for_taintedness( @cmd ); my ( @stdout, @stderr ); if ( is_windows() ) { require Win32::ShellQuote; # Capture stderr & stdout output into these files (only on Win32). my $catchout_file = 'stdout.log'; my $catcherr_file = 'stderr.log'; open(SAVEOUT, ">&STDOUT") or die "Can't dup STDOUT: $!"; open(SAVEERR, ">&STDERR") or die "Can't dup STDERR: $!"; open(STDOUT, '>', $catchout_file) or die "Can't open $catchout_file: $!"; open(STDERR, '>', $catcherr_file) or die "Can't open $catcherr_file: $!"; my $cmd = Win32::ShellQuote::quote_system_string(@cmd); if ( my $input = $options->{input} ) { my $input_command = Win32::ShellQuote::quote_system_string(@{$input}); $cmd = "$input_command | $cmd"; } system( $cmd ); close STDOUT; close STDERR; open(STDOUT, ">&SAVEOUT") or die "Can't restore STDOUT: $!"; open(STDERR, ">&SAVEERR") or die "Can't restore STDERR: $!"; close SAVEOUT; close SAVEERR; @stdout = read_file($catchout_file); @stderr = read_file($catcherr_file); } else { my ( $stdout_read, $stdout_write ); my ( $stderr_read, $stderr_write ); pipe $stdout_read, $stdout_write or Carp::croak( "Unable to create pipe: $!" ); pipe $stderr_read, $stderr_write or Carp::croak( "Unable to create pipe: $!" ); my $pid = fork(); if ( $pid == -1 ) { Carp::croak( "Unable to fork: $!" ); } if ( $pid ) { close $stdout_write; close $stderr_write; while ( $stdout_read || $stderr_read ) { my $rin = ''; vec( $rin, fileno($stdout_read), 1 ) = 1 if $stdout_read; vec( $rin, fileno($stderr_read), 1 ) = 1 if $stderr_read; select( $rin, undef, undef, undef ); if ( $stdout_read && vec( $rin, fileno($stdout_read), 1 ) ) { my $line = <$stdout_read>; if ( defined( $line ) ) { push @stdout, $line; } else { close $stdout_read; undef $stdout_read; } } if ( $stderr_read && vec( $rin, fileno($stderr_read), 1 ) ) { my $line = <$stderr_read>; if ( defined( $line ) ) { push @stderr, $line; } else { close $stderr_read; undef $stderr_read; } } } waitpid $pid, 0; } else { close $stdout_read; close $stderr_read; if (my $input = $options->{input}) { check_command_for_taintedness( @{$input} ); open STDIN, '-|', @{$input} or die "Can't open STDIN: $!"; } open STDOUT, '>&', $stdout_write or die "Can't open STDOUT: $!"; open STDERR, '>&', $stderr_write or die "Can't open STDERR: $!"; exec @cmd; } } # end else not Win32 my ($sig,$core,$rc) = (($? & 127), ($? & 128) , ($? >> 8)); $ack_return_code = $rc; ## XXX what to do with $core or $sig? chomp @stdout; chomp @stderr; return ( \@stdout, \@stderr ); } sub get_rc { return $ack_return_code; } } # scope for $ack_return_code sub run_ack_with_stderr { my @args = @_; my @stdout; my @stderr; my $perl = caret_X(); @args = build_ack_invocation( @args ); if ( $ENV{'ACK_TEST_STANDALONE'} ) { unshift( @args, $perl ); } else { unshift( @args, $perl, "-Mblib=$orig_wd" ); } return run_cmd( @args ); } # Pipe into ack and return STDOUT and STDERR as array refs. sub pipe_into_ack_with_stderr { my $input = shift; my @args = @_; my $tempfile; if ( ref($input) eq 'SCALAR' ) { # We could easily do this without temp files, but that would take # slightly more time than I'm willing to spend on this right now. $tempfile = File::Temp->new; print {$tempfile} $$input . "\n"; close $tempfile; $input = $tempfile->filename; } return run_ack_with_stderr(@args, { # Use Perl since we don't know that 'cat' will exist. input => [caret_X(), '-pe1', $input], }); } # Pipe into ack and return STDOUT as array, for arguments see pipe_into_ack_with_stderr. sub pipe_into_ack { my ($stdout, $stderr) = pipe_into_ack_with_stderr( @_ ); return @$stdout; } # Use this one if order is important. sub lists_match { local $Test::Builder::Level = $Test::Builder::Level + 1; ## no critic my @actual = @{+shift}; my @expected = @{+shift}; my $msg = check_message( shift ); # Normalize all the paths for my $path ( @expected, @actual ) { $path = File::Next::reslash( $path ); ## no critic (Variables::ProhibitPackageVars) } return subtest "lists_match( $msg )" => sub { plan tests => 1; my $rc = eval 'use Test::Differences; 1;'; if ( $rc ) { $ok = eq_or_diff( [@actual], [@expected], $msg ); } else { $ok = is_deeply( [@actual], [@expected], $msg ); } if ( !$ok ) { diag( explain( actual => [@actual], expected => [@expected] ) ); } return $ok; }; } sub ack_lists_match { local $Test::Builder::Level = $Test::Builder::Level + 1; ## no critic my $args = shift; my $expected = shift; my $message = check_message( shift ); my @args = @{$args}; my @results = run_ack( @args ); return subtest "ack_lists_match( $message )" => sub { plan tests => 1; my $ok = lists_match( \@results, $expected, $message ); $ok or diag( join( ' ', '$ ack', @args ) ); }; } # Use this one if you don't care about order of the lines. sub sets_match { local $Test::Builder::Level = $Test::Builder::Level + 1; ## no critic my @actual = @{+shift}; my @expected = @{+shift}; my $msg = check_message( shift ); return subtest "sets_match( $msg )" => sub { plan tests => 1; return lists_match( [sort @actual], [sort @expected], $msg ); }; } sub ack_sets_match { local $Test::Builder::Level = $Test::Builder::Level + 1; ## no critic my $args = shift; my $expected = shift; my $message = check_message( shift ); my @args = @{$args}; return subtest "ack_sets_match( $message )" => sub { plan tests => 2; my @results = run_ack( @args ); my $ok = sets_match( \@results, $expected, $message ); $ok or diag( join( ' ', '$ ack', @args ) ); return $ok; }; } sub record_option_coverage { my ( @command_line ) = @_; return unless $ENV{ACK_OPTION_COVERAGE}; return if $ENV{ACK_TEST_STANDALONE}; # We don't need to record the second time around. my $record_options = File::Spec->catfile($orig_wd, 'record-options'); my $perl = caret_X(); if ( @command_line == 1 ) { my $command_line = $command_line[0]; # strip the command line up until 'ack' is found $command_line =~ s/^.*ack\b//; $command_line = "$perl -T $record_options $command_line"; system $command_line; } else { while ( @command_line && $command_line[0] !~ /ack/ ) { shift @command_line; } shift @command_line; # get rid of 'ack' itself unshift @command_line, $perl, '-T', $record_options; system @command_line; } return; } =head2 colorize( $big_long_string ) Turns a multi-line input string into its corresponding array of lines, with colorized transformations. gets turned to filename color. {text} gets turned to line number color. (text) gets turned to highlight color. =cut sub colorize { my $input = shift; my @lines = split( /\n/, $input ); for my $line ( @lines ) { # File name $line =~ s/<(.+?)>/Term::ANSIColor::colored($1, 'bold green')/eg; # Line number $line =~ s/\{(.+?)\}/Term::ANSIColor::colored($1, 'bold yellow')/eg; # Matches my $n; $n += $line =~ s/\((.+?)\)/Term::ANSIColor::colored($1, 'black on_yellow')/eg; $line .= "\033[0m\033[K" if $n; } return @lines; } BEGIN { my $has_io_pty = eval { require IO::Pty; 1; }; sub has_io_pty { return $has_io_pty; } if ($has_io_pty) { no strict 'refs'; *run_ack_interactive = sub { my ( @args) = @_; my @cmd = build_ack_invocation(@args); @cmd = grep { ref($_) ne 'HASH' } @cmd; record_option_coverage(@cmd); my $pty = IO::Pty->new; my $pid = fork; if($pid) { $pty->close_slave(); $pty->set_raw(); if(wantarray) { my @lines; while(<$pty>) { chomp; push @lines, $_; } close $pty; waitpid $pid, 0; return @lines; } else { my $output = ''; while(<$pty>) { $output .= $_; } close $pty; waitpid $pid, 0; return $output; } } else { $pty->make_slave_controlling_terminal(); my $slave = $pty->slave(); if(-t *STDIN) { # Is there something we can fall back on? Maybe re-opening /dev/console? $slave->clone_winsize_from(\*STDIN); } $slave->set_raw(); open STDIN, '<&', $slave->fileno() or die "Can't open: $!"; open STDOUT, '>&', $slave->fileno() or die "Can't open: $!"; open STDERR, '>&', $slave->fileno() or die "Can't open: $!"; close $slave; my $perl = caret_X(); if ( $ENV{'ACK_TEST_STANDALONE'} ) { unshift( @cmd, $perl ); } else { unshift( @cmd, $perl, "-Mblib=$orig_wd" ); } exec @cmd; } }; } else { no strict 'refs'; require Test::More; *run_ack_interactive = sub { local $Test::Builder::Level = $Test::Builder::Level + 1; Test::More::fail(<<'HERE'); Your system doesn't seem to have IO::Pty, and the developers forgot to check in this test file. Please file a bug report at https://github.com/beyondgrep/ack2/issues with the name of the file that generated this failure. HERE }; } } # This should not be treated as a complete list of the available # options, but it's complete enough to rely on until we find a # more elegant way to generate this list. sub get_options { return ( '--ackrc', '--after-context', '--bar', '--before-context', '--break', '--cathy', '--color', '--color-filename', '--color-lineno', '--color-match', '--colour', '--column', '--context', '--count', '--create-ackrc', '--dump', '--env', '--files-from', '--files-with-matches', '--files-without-matches', '--filter', '--flush', '--follow', '--group', '--heading', '--help', '--help-types', '--ignore-ack-defaults', '--ignore-case', '--ignore-dir', '--ignore-directory', '--ignore-file', '--invert-match', '--lines', '--literal', '--man', '--match', '--max-count', '--no-filename', '--no-recurse', '--nobreak', '--nocolor', '--nocolour', '--nocolumn', '--noenv', '--nofilter', '--nofollow', '--nogroup', '--noheading', '--noignore-dir', '--noignore-directory', '--nopager', '--nosmart-case', '--output', '--pager', '--passthru', '--print0', '--recurse', '--show-types', '--smart-case', '--sort-files', '--thpppt', '--type', '--type-add', '--type-del', '--type-set', '--version', '--with-filename', '--word-regexp', '-1', '-?', '-A', '-B', '-C', '-H', '-L', '-Q', '-R', '-c', '-f', '-g', '-h', '-i', '-l', '-m', '-n', '-o', '-r', '-s', '-v', '-w', '-x', ); } # This is just a handy diagnostic tool. sub check_command_for_taintedness { my @args = @_; my $bad = 0; my @tainted; for my $arg ( @args ) { if ( is_tainted( $arg ) ) { push( @tainted, $arg ); } } if ( @tainted ) { die "Can't execute this command because of taintedness:\nAll args: @args\nTainted: @tainted\n"; } return; } sub is_tainted { no warnings qw(void uninitialized); return !eval { local $SIG{__DIE__} = 'DEFAULT'; join('', shift), kill 0; 1 }; } sub untaint { my ( $s ) = @_; $s =~ /\A(.*)\z/; return $1; } sub caret_X { # XXX How is it $^X can be tainted? We should not have to untaint it. $^X =~ /(.+)/; my $perl = $1; return $perl; } sub getcwd_clean { # XXX How is it that this guy is tainted? my $wd = Cwd::getcwd(); $wd =~ /(.+)/; return $1; } sub windows_slashify { my $str = shift; $str =~ s{/}{\\}g; return $str; } sub touch_ackrc { my $filename = shift or die; write_file( $filename, () ); return; } sub safe_chdir { my $dir = shift; CORE::chdir( $dir ) or die "Can't chdir to $dir: $!"; return; } sub safe_mkdir { my $dir = shift; CORE::mkdir( $dir ) or die "Can't mkdir $dir: $!"; return; } 1; ack-2.22/squash0000755000175000017500000000470413213402177012104 0ustar andyandy#!perl =pod Squashes together the parts of ack into the single ack-standalone file. The arguments to squash are either filenames from the ack distro like Ack.pm, or module names like File::Next. For modules, squash loads them and then pushes them into ack-standalone. =cut use warnings; use strict; use File::Next; # Make clear that ack is not supposed to be edited. my $NO_EDIT_COMMENT = <<'EOCOMMENT'; # # This file, ack, is generated code. # Please DO NOT EDIT or send patches for it. # # Please take a look at the source from # https://github.com/beyondgrep/ack2 # and submit patches against the individual files # that build ack. # EOCOMMENT my $debug_mode = grep { $_ eq '--debug' } @ARGV; @ARGV = grep { $_ ne '--debug' } @ARGV; my $code = "#!/usr/bin/env perl\n$NO_EDIT_COMMENT\n"; for my $arg ( @ARGV ) { my $filename = $arg; if ( $arg =~ /::/ ) { my $key = "$arg.pm"; $key =~ s{::}{/}g; $filename = $INC{$key} or die "Can't find the file for $arg"; } warn "Reading $filename\n"; open( my $fh, '<', $filename ) or die "Can't open $filename: $!"; my $was_in_pod = 0; my $in_pod = 0; $code .= "#line 1 '$filename'\n" if $debug_mode && $filename ne 'ack'; while ( <$fh> ) { next if /^use (?:File::Next|App::Ack)/; s/^use base (.+)/BEGIN {\n our \@ISA = $1\n}/; if ( $was_in_pod && !$in_pod ) { $was_in_pod = 0; if ($debug_mode) { $code .= "#line $. '$filename'\n"; } } # See if we're in module POD blocks if ( $filename ne 'ack' ) { $was_in_pod = $in_pod; if ( /^=(\w+)/ ) { $in_pod = ($1 ne 'cut'); next; } elsif ( $in_pod ) { next; } } # Replace the shebang line and append 'no edit' comment if ( s{^#!.+}{package main;} ) { # Skip the shebang line and replace it with package statement. } # Remove Perl::Critic comments. # I'd like to remove all comments, but this is a start s{\s*##.+critic.*}{}; $code .= $_; } close $fh; } # We only use two of the four constructors in File::Next, so delete the other two. for my $unused_func ( qw( dirs everything ) ) { $code =~ s/^sub $unused_func\b.*?^}//sm or die qq{Unable to find the sub "$unused_func" to remove from ack-standalone}; } print $code; exit 0; ack-2.22/Collection.pm0000644000175000017500000000264313066014025013300 0ustar andyandypackage App::Ack::Filter::Collection; =head1 NAME App::Ack::Filter::Collection =head1 DESCRIPTION The Ack::Filter::Collection class can contain filters and internally sort them into groups. The groups can then be optimized for faster filtering. Filters are grouped and replaced by a fast hash lookup. This leads to improved performance when many such filters are active, like when using the C<--known> command line option. =cut use strict; use warnings; use base 'App::Ack::Filter'; sub new { my ( $class ) = @_; return bless { groups => {}, ungrouped => [], }, $class; } sub filter { my ( $self, $resource ) = @_; for my $group (values %{$self->{'groups'}}) { if ($group->filter($resource)) { return 1; } } for my $filter (@{$self->{'ungrouped'}}) { if ($filter->filter($resource)) { return 1; } } return 0; } sub add { my ( $self, $filter ) = @_; if (exists $filter->{'groupname'}) { my $group = ($self->{groups}->{$filter->{groupname}} ||= $filter->create_group()); $group->add($filter); } else { push @{$self->{'ungrouped'}}, $filter; } return; } sub inspect { my ( $self ) = @_; return ref($self) . " - $self"; } sub to_string { my ( $self ) = @_; my $ungrouped = $self->{'ungrouped'}; return join(', ', map { "($_)" } @{$ungrouped}); } 1; ack-2.22/CONTRIBUTING.md0000644000175000017500000000311713213402177013100 0ustar andyandy# Before You Report an Issue... Before you report an issue, please consult the [FAQ](https://beyondgrep.com/documentation/ack-2.16-man.html#faq). # Asking to add a new filetype, or any enhancement From the man page: > All enhancement requests MUST first be posted to the ack-users mailing list at . I will not consider a request without it first getting seen by other ack users. This includes > requests for new filetypes. > > There is a list of enhancements I want to make to ack in the ack issues list at Github: > > Patches are always welcome, but patches with tests get the most attention. # Reporting an Issue If you have an issue with ack, please add the following to your ticket: - What OS you're on - What version of ack you're using Please try to reproduce your issue against the latest ack from git. If you are not able to reproduce the issue with ack built from git, you should probably file the issue anyway, as that probably means someone needs to make a release. =) Also appreciated with an issue are the following: - Example invocations along with expected vs received output (see [#439](https://github.com/beyondgrep/ack2/issues/439), great job!) - A `.t` test file that tests and verifies the behavior you expect - A patch that fixes your issue # Ack 1.x Keep in mind that if you're using ack 1.x, you should probably upgrade, as ack 1.x is no longer supported. # Getting Help Also, feel free to discuss your issues on the [ack mailing list](http://groups.google.com/group/ack-users)! ack-2.22/Resources.pm0000644000175000017500000000500613066014025013153 0ustar andyandypackage App::Ack::Resources; =head1 NAME App::Ack::Resources =head1 SYNOPSIS A factory object for creating a stream of L objects. =cut use App::Ack; use App::Ack::Resource; use File::Next 1.16; use Errno qw(EACCES); use warnings; use strict; sub _generate_error_handler { my $opt = shift; if ( $opt->{dont_report_bad_filenames} ) { return sub { my $msg = shift; if ( $! == EACCES ) { return; } App::Ack::warn( $msg ); }; } else { return sub { my $msg = shift; App::Ack::warn( $msg ); }; } } =head1 METHODS =head2 from_argv( \%opt, \@starting_points ) Return an iterator that does the file finding for us. =cut sub from_argv { my $class = shift; my $opt = shift; my $start = shift; my $self = bless {}, $class; my $file_filter = undef; my $descend_filter = $opt->{descend_filter}; if( $opt->{n} ) { $descend_filter = sub { return 0; }; } $self->{iter} = File::Next::files( { file_filter => $opt->{file_filter}, descend_filter => $descend_filter, error_handler => _generate_error_handler($opt), warning_handler => sub {}, sort_files => $opt->{sort_files}, follow_symlinks => $opt->{follow}, }, @{$start} ); return $self; } =head2 from_file( \%opt, $filename ) Return an iterator that reads the list of files to search from a given file. If I<$filename> is '-', then it reads from STDIN. =cut sub from_file { my $class = shift; my $opt = shift; my $file = shift; my $iter = File::Next::from_file( { error_handler => _generate_error_handler($opt), warning_handler => _generate_error_handler($opt), sort_files => $opt->{sort_files}, }, $file ) or return undef; return bless { iter => $iter, }, $class; } # This is for reading input lines from STDIN, not the list of files from STDIN sub from_stdin { my $class = shift; my $opt = shift; my $self = bless {}, $class; my $has_been_called = 0; $self->{iter} = sub { if ( !$has_been_called ) { $has_been_called = 1; return '-'; } return; }; return $self; } sub next { my $self = shift; my $file = $self->{iter}->() or return; return App::Ack::Resource->new( $file ); } 1; ack-2.22/META.yml0000664000175000017500000000212613217305507012124 0ustar andyandy--- abstract: 'A grep-like program for searching source code' author: - 'Andy Lester ' build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: ack no_index: directory: - t - inc requires: Carp: '1.04' Cwd: '3.00' Errno: '0' File::Basename: '1.00015' File::Next: '1.16' File::Spec: '3.00' File::Temp: '0.19' Getopt::Long: '2.38' Pod::Usage: '1.26' Term::ANSIColor: '1.10' Test::Harness: '2.50' Test::More: '0.98' Text::ParseWords: '3.1' perl: '5.008008' resources: MailingList: https://groups.google.com/group/ack-users bugtracker: https://github.com/beyondgrep/ack2 homepage: https://beyondgrep.com/ license: http://www.perlfoundation.org/artistic_license_2_0 repository: git://github.com/beyondgrep/ack2.git version: '2.22' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' ack-2.22/FirstLineMatch.pm0000644000175000017500000000211113066014025014047 0ustar andyandypackage App::Ack::Filter::FirstLineMatch; =head1 NAME App::Ack::Filter::FirstLineMatch =head1 DESCRIPTION The class that implements filtering resources by their first line. =cut use strict; use warnings; use base 'App::Ack::Filter'; sub new { my ( $class, $re ) = @_; $re =~ s{^/|/$}{}g; # XXX validate? $re = qr{$re}i; return bless { regex => $re, }, $class; } # This test reads the first 250 characters of a file, then just uses the # first line found in that. This prevents reading something like an entire # .min.js file (which might be only one "line" long) into memory. sub filter { my ( $self, $resource ) = @_; my $re = $self->{'regex'}; my $line = $resource->firstliney; return $line =~ /$re/; } sub inspect { my ( $self ) = @_; my $re = $self->{'regex'}; return ref($self) . " - $re"; } sub to_string { my ( $self ) = @_; (my $re = $self->{regex}) =~ s{\([^:]*:(.*)\)$}{$1}; return "first line matches /$re/"; } BEGIN { App::Ack::Filter->register_filter(firstlinematch => __PACKAGE__); } 1; ack-2.22/ack0000755000175000017500000021016413217305214011333 0ustar andyandy#!/usr/bin/perl use strict; use warnings; our $VERSION = '2.22'; # Check https://beyondgrep.com/ for updates use 5.008008; use Getopt::Long 2.38 (); use Carp 1.04 (); use File::Spec (); use File::Next (); use App::Ack (); use App::Ack::ConfigLoader (); use App::Ack::Resources; use App::Ack::Resource (); # XXX Don't make this so brute force # See also: https://github.com/beyondgrep/ack2/issues/89 use App::Ack::Filter (); use App::Ack::Filter::Default; use App::Ack::Filter::Extension; use App::Ack::Filter::FirstLineMatch; use App::Ack::Filter::Inverse; use App::Ack::Filter::Is; use App::Ack::Filter::IsPath; use App::Ack::Filter::Match; use App::Ack::Filter::Collection; our $opt_after_context; our $opt_before_context; our $opt_output; our $opt_print0; our $opt_color; our $opt_heading; our $opt_show_filename; our $opt_regex; our $opt_break; our $opt_count; our $opt_v; our $opt_m; our $opt_g; our $opt_f; our $opt_lines; our $opt_L; our $opt_l; our $opt_passthru; our $opt_column; # Flag if we need any context tracking. our $is_tracking_context; # These are all our globals. MAIN: { $App::Ack::orig_program_name = $0; $0 = join(' ', 'ack', $0); if ( $App::Ack::VERSION ne $main::VERSION ) { App::Ack::die( "Program/library version mismatch\n\t$0 is $main::VERSION\n\t$INC{'App/Ack.pm'} is $App::Ack::VERSION" ); } # Do preliminary arg checking; my $env_is_usable = 1; for my $arg ( @ARGV ) { last if ( $arg eq '--' ); # Get the --thpppt, --bar, --cathy checking out of the way. $arg =~ /^--th[pt]+t+$/ and App::Ack::thpppt($arg); $arg eq '--bar' and App::Ack::ackbar(); $arg eq '--cathy' and App::Ack::cathy(); # See if we want to ignore the environment. (Don't tell Al Gore.) $arg eq '--env' and $env_is_usable = 1; $arg eq '--noenv' and $env_is_usable = 0; } if ( !$env_is_usable ) { my @keys = ( 'ACKRC', grep { /^ACK_/ } keys %ENV ); delete @ENV{@keys}; } load_colors(); Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); Getopt::Long::Configure('pass_through', 'no_auto_abbrev'); Getopt::Long::GetOptions( 'help' => sub { App::Ack::show_help(); exit; }, 'version' => sub { App::Ack::print_version_statement(); exit; }, 'man' => sub { App::Ack::show_man(); exit; }, ); Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); if ( !@ARGV ) { App::Ack::show_help(); exit 1; } main(); } sub _compile_descend_filter { my ( $opt ) = @_; my $idirs = 0; my $dont_ignore_dirs = 0; for my $filter (@{$opt->{idirs} || []}) { if ($filter->is_inverted()) { $dont_ignore_dirs++; } else { $idirs++; } } # If we have one or more --noignore-dir directives, we can't ignore # entire subdirectory hierarchies, so we return an "accept all" # filter and scrutinize the files more in _compile_file_filter. return if $dont_ignore_dirs; return unless $idirs; $idirs = $opt->{idirs}; return sub { my $resource = App::Ack::Resource->new($File::Next::dir); return !grep { $_->filter($resource) } @{$idirs}; }; } sub _compile_file_filter { my ( $opt, $start ) = @_; my $ifiles_filters = $opt->{ifiles}; my $filters = $opt->{'filters'} || []; my $direct_filters = App::Ack::Filter::Collection->new(); my $inverse_filters = App::Ack::Filter::Collection->new(); foreach my $filter (@{$filters}) { if ($filter->is_inverted()) { # We want to check if files match the uninverted filters $inverse_filters->add($filter->invert()); } else { $direct_filters->add($filter); } } my %is_member_of_starting_set = map { (get_file_id($_) => 1) } @{$start}; my @ignore_dir_filter = @{$opt->{idirs} || []}; my @is_inverted = map { $_->is_inverted() } @ignore_dir_filter; # This depends on InverseFilter->invert returning the original filter (for optimization). @ignore_dir_filter = map { $_->is_inverted() ? $_->invert() : $_ } @ignore_dir_filter; my $dont_ignore_dir_filter = grep { $_ } @is_inverted; my $previous_dir = ''; my $previous_dir_ignore_result; return sub { if ( $opt_g ) { if ( $File::Next::name =~ /$opt_regex/ && $opt_v ) { return 0; } if ( $File::Next::name !~ /$opt_regex/ && !$opt_v ) { return 0; } } # ack always selects files that are specified on the command # line, regardless of filetype. If you want to ack a JPEG, # and say "ack foo whatever.jpg" it will do it for you. return 1 if $is_member_of_starting_set{ get_file_id($File::Next::name) }; if ( $dont_ignore_dir_filter ) { if ( $previous_dir eq $File::Next::dir ) { if ( $previous_dir_ignore_result ) { return 0; } } else { my @dirs = File::Spec->splitdir($File::Next::dir); my $is_ignoring = 0; for ( my $i = 0; $i < @dirs; $i++) { my $dir_rsrc = App::Ack::Resource->new(File::Spec->catfile(@dirs[0 .. $i])); my $j = 0; for my $filter (@ignore_dir_filter) { if ( $filter->filter($dir_rsrc) ) { $is_ignoring = !$is_inverted[$j]; } $j++; } } $previous_dir = $File::Next::dir; $previous_dir_ignore_result = $is_ignoring; if ( $is_ignoring ) { return 0; } } } # Ignore named pipes found in directory searching. Named # pipes created by subprocesses get specified on the command # line, so the rule of "always select whatever is on the # command line" wins. return 0 if -p $File::Next::name; # We can't handle unreadable filenames; report them. if ( not -r _ ) { use filetest 'access'; if ( not -R $File::Next::name ) { if ( $App::Ack::report_bad_filenames ) { App::Ack::warn( "${File::Next::name}: cannot open file for reading" ); } return 0; } } my $resource = App::Ack::Resource->new($File::Next::name); if ( $ifiles_filters && $ifiles_filters->filter($resource) ) { return 0; } my $match_found = $direct_filters->filter($resource); # Don't bother invoking inverse filters unless we consider the current resource a match if ( $match_found && $inverse_filters->filter( $resource ) ) { $match_found = 0; } return $match_found; }; } sub show_types { my $resource = shift; my $ors = shift; my @types = filetypes( $resource ); my $types = join( ',', @types ); my $arrow = @types ? ' => ' : ' =>'; App::Ack::print( $resource->name, $arrow, join( ',', @types ), $ors ); return; } # Set default colors, load Term::ANSIColor sub load_colors { eval 'use Term::ANSIColor 1.10 ()'; eval 'use Win32::Console::ANSI' if $App::Ack::is_windows; $ENV{ACK_COLOR_MATCH} ||= 'black on_yellow'; $ENV{ACK_COLOR_FILENAME} ||= 'bold green'; $ENV{ACK_COLOR_LINENO} ||= 'bold yellow'; return; } sub filetypes { my ( $resource ) = @_; my @matches; foreach my $k (keys %App::Ack::mappings) { my $filters = $App::Ack::mappings{$k}; foreach my $filter (@{$filters}) { # Clone the resource. my $clone = $resource->clone; if ( $filter->filter($clone) ) { push @matches, $k; last; } } } # http://search.cpan.org/dist/Perl-Critic/lib/Perl/Critic/Policy/Subroutines/ProhibitReturnSort.pm @matches = sort @matches; return @matches; } # Returns a (fairly) unique identifier for a file. # Use this function to compare two files to see if they're # equal (ie. the same file, but with a different path/links/etc). sub get_file_id { my ( $filename ) = @_; if ( $App::Ack::is_windows ) { return File::Next::reslash( $filename ); } else { # XXX Is this the best method? It always hits the FS. if( my ( $dev, $inode ) = (stat($filename))[0, 1] ) { return join(':', $dev, $inode); } else { # XXX This could be better. return $filename; } } } # Returns a regex object based on a string and command-line options. # Dies when the regex $str is undefined (i.e. not given on command line). sub build_regex { my $str = shift; my $opt = shift; defined $str or App::Ack::die( 'No regular expression found.' ); $str = quotemeta( $str ) if $opt->{Q}; if ( $opt->{w} ) { my $pristine_str = $str; $str = "(?:$str)"; $str = "\\b$str" if $pristine_str =~ /^\w/; $str = "$str\\b" if $pristine_str =~ /\w$/; } my $regex_is_lc = $str eq lc $str; if ( $opt->{i} || ($opt->{smart_case} && $regex_is_lc) ) { $str = "(?i)$str"; } my $re = eval { qr/$str/m }; if ( !$re ) { die "Invalid regex '$str':\n $@"; } return $re; } my $match_column_number; { # Number of context lines my $n_before_ctx_lines; my $n_after_ctx_lines; # Array to keep track of lines that might be required for a "before" context my @before_context_buf; # Position to insert next line in @before_context_buf my $before_context_pos; # Number of "after" context lines still pending my $after_context_pending; # Number of latest line that got printed my $printed_line_no; my $is_iterating; my $is_first_match; my $has_printed_something; BEGIN { $has_printed_something = 0; } # Set up context tracking variables. sub set_up_line_context { $n_before_ctx_lines = $opt_output ? 0 : ($opt_before_context || 0); $n_after_ctx_lines = $opt_output ? 0 : ($opt_after_context || 0); @before_context_buf = (undef) x $n_before_ctx_lines; $before_context_pos = 0; $is_tracking_context = $n_before_ctx_lines || $n_after_ctx_lines; $is_first_match = 1; return; } # Adjust context tracking variables when entering a new file. sub set_up_line_context_for_file { $printed_line_no = 0; $after_context_pending = 0; if ( $opt_heading && !$opt_lines ) { $is_first_match = 1; } return; } =begin Developers This subroutine jumps through a number of optimization hoops to try to be fast in the more common use cases of ack. For one thing, in non-context tracking searches (not using -A, -B, or -C), conditions that normally would be checked inside the loop happen outside, resulting in three nearly identical loops for -v, --passthru, and normal searching. Any changes that happen to one should propagate to the others if they make sense. The non-context branches also inline does_match for performance reasons; any relevant changes that happen here must also happen there. =end Developers =cut sub print_matches_in_resource { my ( $resource ) = @_; my $max_count = $opt_m || -1; my $nmatches = 0; my $filename = $resource->name; my $ors = $opt_print0 ? "\0" : "\n"; my $has_printed_for_this_resource = 0; $is_iterating = 1; my $fh = $resource->open(); if ( !$fh ) { if ( $App::Ack::report_bad_filenames ) { App::Ack::warn( "$filename: $!" ); } return 0; } my $display_filename = $filename; if ( $opt_show_filename && $opt_heading && $opt_color ) { $display_filename = Term::ANSIColor::colored($display_filename, $ENV{ACK_COLOR_FILENAME}); } # Check for context before the main loop, so we don't pay for it if we don't need it. if ( $is_tracking_context ) { $after_context_pending = 0; while ( <$fh> ) { if ( does_match( $_ ) && $max_count ) { if ( !$has_printed_for_this_resource ) { if ( $opt_break && $has_printed_something ) { App::Ack::print_blank_line(); } if ( $opt_show_filename && $opt_heading ) { App::Ack::print_filename( $display_filename, $ors ); } } print_line_with_context( $filename, $_, $. ); $has_printed_for_this_resource = 1; $nmatches++; $max_count--; } elsif ( $opt_passthru ) { chomp; # XXX Proper newline handling? # XXX Inline this call? if ( $opt_break && !$has_printed_for_this_resource && $has_printed_something ) { App::Ack::print_blank_line(); } print_line_with_options( $filename, $_, $., ':' ); $has_printed_for_this_resource = 1; } else { chomp; # XXX Proper newline handling? print_line_if_context( $filename, $_, $., '-' ); } last if ($max_count == 0) && ($after_context_pending == 0); } } else { if ( $opt_passthru ) { local $_; while ( <$fh> ) { $match_column_number = undef; if ( $opt_v ? !/$opt_regex/o : /$opt_regex/o ) { if ( !$opt_v ) { $match_column_number = $-[0] + 1; } if ( !$has_printed_for_this_resource ) { if ( $opt_break && $has_printed_something ) { App::Ack::print_blank_line(); } if ( $opt_show_filename && $opt_heading ) { App::Ack::print_filename( $display_filename, $ors ); } } print_line_with_context( $filename, $_, $. ); $has_printed_for_this_resource = 1; $nmatches++; $max_count--; } else { chomp; # XXX proper newline handling? if ( $opt_break && !$has_printed_for_this_resource && $has_printed_something ) { App::Ack::print_blank_line(); } print_line_with_options( $filename, $_, $., ':' ); $has_printed_for_this_resource = 1; } last unless $max_count != 0; } } elsif ( $opt_v ) { local $_; $match_column_number = undef; while ( <$fh> ) { if ( !/$opt_regex/o ) { if ( !$has_printed_for_this_resource ) { if ( $opt_break && $has_printed_something ) { App::Ack::print_blank_line(); } if ( $opt_show_filename && $opt_heading ) { App::Ack::print_filename( $display_filename, $ors ); } } print_line_with_context( $filename, $_, $. ); $has_printed_for_this_resource = 1; $nmatches++; $max_count--; } last unless $max_count != 0; } } else { local $_; while ( <$fh> ) { $match_column_number = undef; if ( /$opt_regex/o ) { $match_column_number = $-[0] + 1; if ( !$has_printed_for_this_resource ) { if ( $opt_break && $has_printed_something ) { App::Ack::print_blank_line(); } if ( $opt_show_filename && $opt_heading ) { App::Ack::print_filename( $display_filename, $ors ); } } s/[\r\n]+$//g; print_line_with_options( $filename, $_, $., ':' ); $has_printed_for_this_resource = 1; $nmatches++; $max_count--; } last unless $max_count != 0; } } } $is_iterating = 0; return $nmatches; } sub print_line_with_options { my ( $filename, $line, $line_no, $separator ) = @_; $has_printed_something = 1; $printed_line_no = $line_no; my $ors = $opt_print0 ? "\0" : "\n"; my @line_parts; if( $opt_color ) { $filename = Term::ANSIColor::colored($filename, $ENV{ACK_COLOR_FILENAME}); $line_no = Term::ANSIColor::colored($line_no, $ENV{ACK_COLOR_LINENO}); } if($opt_show_filename) { if( $opt_heading ) { push @line_parts, $line_no; } else { push @line_parts, $filename, $line_no; } if( $opt_column ) { push @line_parts, get_match_column(); } } if( $opt_output ) { while ( $line =~ /$opt_regex/og ) { # XXX We need to stop using eval() for --output. See https://github.com/beyondgrep/ack2/issues/421 my $output = eval $opt_output; App::Ack::print( join( $separator, @line_parts, $output ), $ors ); } } else { if ( $opt_color ) { # This match is redundant, but we need to perfom it in order to get if capture groups are set. $line =~ /$opt_regex/o; if ( @+ > 1 ) { # If we have captures... while ( $line =~ /$opt_regex/og ) { my $offset = 0; # Additional offset for when we add stuff. my $previous_match_end = 0; last if $-[0] == $+[0]; for ( my $i = 1; $i < @+; $i++ ) { my ( $match_start, $match_end ) = ( $-[$i], $+[$i] ); next unless defined($match_start); next if $match_start < $previous_match_end; my $substring = substr( $line, $offset + $match_start, $match_end - $match_start ); my $substitution = Term::ANSIColor::colored( $substring, $ENV{ACK_COLOR_MATCH} ); substr( $line, $offset + $match_start, $match_end - $match_start, $substitution ); $previous_match_end = $match_end; # Offsets do not need to be applied. $offset += length( $substitution ) - length( $substring ); } pos($line) = $+[0] + $offset; } } else { my $matched = 0; # If matched, need to escape afterwards. while ( $line =~ /$opt_regex/og ) { $matched = 1; my ( $match_start, $match_end ) = ($-[0], $+[0]); next unless defined($match_start); last if $match_start == $match_end; my $substring = substr( $line, $match_start, $match_end - $match_start ); my $substitution = Term::ANSIColor::colored( $substring, $ENV{ACK_COLOR_MATCH} ); substr( $line, $match_start, $match_end - $match_start, $substitution ); pos($line) = $match_end + (length( $substitution ) - length( $substring )); } # XXX Why do we do this? $line .= "\033[0m\033[K" if $matched; } } push @line_parts, $line; App::Ack::print( join( $separator, @line_parts ), $ors ); } return; } sub iterate { my ( $resource, $cb ) = @_; $is_iterating = 1; my $fh = $resource->open(); if ( !$fh ) { if ( $App::Ack::report_bad_filenames ) { App::Ack::warn( $resource->name . ': ' . $! ); } return; } # Check for context before the main loop, so we don't pay for it if we don't need it. if ( $is_tracking_context ) { $after_context_pending = 0; while ( <$fh> ) { last unless $cb->(); } } else { local $_; while ( <$fh> ) { last unless $cb->(); } } $is_iterating = 0; return; } sub print_line_with_context { my ( $filename, $matching_line, $line_no ) = @_; my $ors = $opt_print0 ? "\0" : "\n"; my $is_tracking_context = $opt_after_context || $opt_before_context; $matching_line =~ s/[\r\n]+$//g; # Check if we need to print context lines first. if ( $is_tracking_context ) { my $before_unprinted = $line_no - $printed_line_no - 1; if ( !$is_first_match && ( !$printed_line_no || $before_unprinted > $n_before_ctx_lines ) ) { App::Ack::print('--', $ors); } # We want at most $n_before_ctx_lines of context. if ( $before_unprinted > $n_before_ctx_lines ) { $before_unprinted = $n_before_ctx_lines; } while ( $before_unprinted > 0 ) { my $line = $before_context_buf[($before_context_pos - $before_unprinted + $n_before_ctx_lines) % $n_before_ctx_lines]; chomp $line; # Disable $opt->{column} since there are no matches in the context lines. local $opt_column = 0; print_line_with_options( $filename, $line, $line_no-$before_unprinted, '-' ); $before_unprinted--; } } print_line_with_options( $filename, $matching_line, $line_no, ':' ); # We want to get the next $n_after_ctx_lines printed. $after_context_pending = $n_after_ctx_lines; $is_first_match = 0; return; } # Print the line only if it's part of a context we need to display. sub print_line_if_context { my ( $filename, $line, $line_no, $separator ) = @_; if ( $after_context_pending ) { # Disable $opt_column since there are no matches in the context lines. local $opt_column = 0; print_line_with_options( $filename, $line, $line_no, $separator ); --$after_context_pending; } elsif ( $n_before_ctx_lines ) { # Save line for "before" context. $before_context_buf[$before_context_pos] = $_; $before_context_pos = ($before_context_pos+1) % $n_before_ctx_lines; } return; } } # does_match() MUST have an $opt_regex set. =begin Developers This subroutine is inlined a few places in print_matches_in_resource for performance reasons, so any changes here must be copied there as well. =end Developers =cut sub does_match { my ( $line ) = @_; $match_column_number = undef; if ( $opt_v ) { return ( $line !~ /$opt_regex/o ); } else { if ( $line =~ /$opt_regex/o ) { # @- = @LAST_MATCH_START # @+ = @LAST_MATCH_END $match_column_number = $-[0] + 1; return 1; } else { return; } } } sub get_match_column { return $match_column_number; } sub resource_has_match { my ( $resource ) = @_; my $has_match = 0; my $fh = $resource->open(); if ( !$fh ) { if ( $App::Ack::report_bad_filenames ) { App::Ack::warn( $resource->name . ': ' . $! ); } } else { while ( <$fh> ) { if (/$opt_regex/o xor $opt_v) { $has_match = 1; last; } } close $fh; } return $has_match; } sub count_matches_in_resource { my ( $resource ) = @_; my $nmatches = 0; my $fh = $resource->open(); if ( !$fh ) { if ( $App::Ack::report_bad_filenames ) { App::Ack::warn( $resource->name . ': ' . $! ); } } else { while ( <$fh> ) { ++$nmatches if (/$opt_regex/o xor $opt_v); } close $fh; } return $nmatches; } sub main { my @arg_sources = App::Ack::ConfigLoader::retrieve_arg_sources(); my $opt = App::Ack::ConfigLoader::process_args( @arg_sources ); $opt_after_context = $opt->{after_context}; $opt_before_context = $opt->{before_context}; $opt_output = $opt->{output}; $opt_print0 = $opt->{print0}; $opt_color = $opt->{color}; $opt_heading = $opt->{heading}; $opt_show_filename = $opt->{show_filename}; $opt_regex = $opt->{regex}; $opt_break = $opt->{break}; $opt_count = $opt->{count}; $opt_v = $opt->{v}; $opt_m = $opt->{m}; $opt_g = $opt->{g}; $opt_f = $opt->{f}; $opt_lines = $opt->{lines}; $opt_L = $opt->{L}; $opt_l = $opt->{l}; $opt_passthru = $opt->{passthru}; $opt_column = $opt->{column}; $App::Ack::report_bad_filenames = !$opt->{dont_report_bad_filenames}; if ( $opt->{flush} ) { $| = 1; } if ( !defined($opt_color) && !$opt_g ) { my $windows_color = 1; if ( $App::Ack::is_windows ) { $windows_color = eval { require Win32::Console::ANSI; }; } $opt_color = !App::Ack::output_to_pipe() && $windows_color; } if ( not defined $opt_heading and not defined $opt_break ) { $opt_heading = $opt_break = $opt->{break} = !App::Ack::output_to_pipe(); } if ( defined($opt->{H}) || defined($opt->{h}) ) { $opt_show_filename = $opt->{show_filename} = $opt->{H} && !$opt->{h}; } if ( my $output = $opt_output ) { $output =~ s{\\}{\\\\}g; $output =~ s{"}{\\"}g; $opt_output = qq{"$output"}; } my $resources; if ( $App::Ack::is_filter_mode && !$opt->{files_from} ) { # probably -x $resources = App::Ack::Resources->from_stdin( $opt ); $opt_regex = shift @ARGV if not defined $opt_regex; $opt_regex = $opt->{regex} = build_regex( $opt_regex, $opt ); } else { if ( $opt_f || $opt_lines ) { if ( $opt_regex ) { App::Ack::warn( "regex ($opt_regex) specified with -f or --lines" ); App::Ack::exit_from_ack( 0 ); # XXX the 0 is misleading } } else { $opt_regex = shift @ARGV if not defined $opt_regex; $opt_regex = $opt->{regex} = build_regex( $opt_regex, $opt ); } if ( $opt_regex && $opt_regex =~ /\n/ ) { App::Ack::exit_from_ack( 0 ); } my @start; if ( not defined $opt->{files_from} ) { @start = @ARGV; } if ( !exists($opt->{show_filename}) ) { unless(@start == 1 && !(-d $start[0])) { $opt_show_filename = $opt->{show_filename} = 1; } } if ( defined $opt->{files_from} ) { $resources = App::Ack::Resources->from_file( $opt, $opt->{files_from} ); exit 1 unless $resources; } else { @start = ('.') unless @start; foreach my $target (@start) { if ( !-e $target && $App::Ack::report_bad_filenames) { App::Ack::warn( "$target: No such file or directory" ); } } $opt->{file_filter} = _compile_file_filter($opt, \@start); $opt->{descend_filter} = _compile_descend_filter($opt); $resources = App::Ack::Resources->from_argv( $opt, \@start ); } } App::Ack::set_up_pager( $opt->{pager} ) if defined $opt->{pager}; my $ors = $opt_print0 ? "\0" : "\n"; my $only_first = $opt->{1}; my $nmatches = 0; my $total_count = 0; set_up_line_context(); RESOURCES: while ( my $resource = $resources->next ) { if ($is_tracking_context) { set_up_line_context_for_file(); } if ( $opt_f ) { if ( $opt->{show_types} ) { show_types( $resource, $ors ); } else { App::Ack::print( $resource->name, $ors ); } ++$nmatches; last RESOURCES if defined($opt_m) && $nmatches >= $opt_m; } elsif ( $opt_g ) { if ( $opt->{show_types} ) { show_types( $resource, $ors ); } else { local $opt_show_filename = 0; # XXX Why is this local? print_line_with_options( '', $resource->name, 0, $ors ); } ++$nmatches; last RESOURCES if defined($opt_m) && $nmatches >= $opt_m; } elsif ( $opt_lines ) { my %line_numbers; foreach my $line ( @{ $opt_lines } ) { my @lines = split /,/, $line; @lines = map { /^(\d+)-(\d+)$/ ? ( $1 .. $2 ) : $_ } @lines; @line_numbers{@lines} = (1) x @lines; } my $filename = $resource->name; local $opt_color = 0; iterate( $resource, sub { chomp; if ( $line_numbers{$.} ) { print_line_with_context( $filename, $_, $. ); } elsif ( $opt_passthru ) { print_line_with_options( $filename, $_, $., ':' ); } elsif ( $is_tracking_context ) { print_line_if_context( $filename, $_, $., '-' ); } return 1; }); } elsif ( $opt_count ) { my $matches_for_this_file = count_matches_in_resource( $resource ); if ( not $opt_show_filename ) { $total_count += $matches_for_this_file; next RESOURCES; } if ( !$opt_l || $matches_for_this_file > 0) { if ( $opt_show_filename ) { App::Ack::print( $resource->name, ':', $matches_for_this_file, $ors ); } else { App::Ack::print( $matches_for_this_file, $ors ); } } } elsif ( $opt_l || $opt_L ) { my $is_match = resource_has_match( $resource ); if ( $opt_L ? !$is_match : $is_match ) { App::Ack::print( $resource->name, $ors ); ++$nmatches; last RESOURCES if $only_first; last RESOURCES if defined($opt_m) && $nmatches >= $opt_m; } } else { $nmatches += print_matches_in_resource( $resource, $opt ); if ( $nmatches && $only_first ) { last RESOURCES; } } } if ( $opt_count && !$opt_show_filename ) { App::Ack::print( $total_count, "\n" ); } close $App::Ack::fh; App::Ack::exit_from_ack( $nmatches ); } =pod =encoding UTF-8 =head1 NAME ack - grep-like text finder =head1 SYNOPSIS ack [options] PATTERN [FILE...] ack -f [options] [DIRECTORY...] =head1 DESCRIPTION ack is designed as an alternative to F for programmers. ack searches the named input files or directories for lines containing a match to the given PATTERN. By default, ack prints the matching lines. If no FILE or DIRECTORY is given, the current directory will be searched. PATTERN is a Perl regular expression. Perl regular expressions are commonly found in other programming languages, but for the particulars of their behavior, please consult L. If you don't know how to use regular expression but are interested in learning, you may consult L. If you do not need or want ack to use regular expressions, please see the C<-Q>/C<--literal> option. Ack can also list files that would be searched, without actually searching them, to let you take advantage of ack's file-type filtering capabilities. =head1 FILE SELECTION If files are not specified for searching, either on the command line or piped in with the C<-x> option, I delves into subdirectories selecting files for searching. I is intelligent about the files it searches. It knows about certain file types, based on both the extension on the file and, in some cases, the contents of the file. These selections can be made with the B<--type> option. With no file selection, I searches through regular files that are not explicitly excluded by B<--ignore-dir> and B<--ignore-file> options, either present in F files or on the command line. The default options for I ignore certain files and directories. These include: =over 4 =item * Backup files: Files matching F<#*#> or ending with F<~>. =item * Coredumps: Files matching F =item * Version control directories like F<.svn> and F<.git>. =back Run I with the C<--dump> option to see what settings are set. However, I always searches the files given on the command line, no matter what type. If you tell I to search in a coredump, it will search in a coredump. =head1 DIRECTORY SELECTION I descends through the directory tree of the starting directories specified. If no directories are specified, the current working directory is used. However, it will ignore the shadow directories used by many version control systems, and the build directories used by the Perl MakeMaker system. You may add or remove a directory from this list with the B<--[no]ignore-dir> option. The option may be repeated to add/remove multiple directories from the ignore list. For a complete list of directories that do not get searched, run C. =head1 WHEN TO USE GREP I trumps I as an everyday tool 99% of the time, but don't throw I away, because there are times you'll still need it. E.g., searching through huge files looking for regexes that can be expressed with I syntax should be quicker with I. If your script or parent program uses I C<--quiet> or C<--silent> or needs exit 2 on IO error, use I. =head1 OPTIONS =over 4 =item B<--ackrc> Specifies an ackrc file to load after all others; see L. =item B<-A I>, B<--after-context=I> Print I lines of trailing context after matching lines. =item B<-B I>, B<--before-context=I> Print I lines of leading context before matching lines. =item B<--[no]break> Print a break between results from different files. On by default when used interactively. =item B<-C [I]>, B<--context[=I]> Print I lines (default 2) of context around matching lines. You can specify zero lines of context to override another context specified in an ackrc. =item B<-c>, B<--count> Suppress normal output; instead print a count of matching lines for each input file. If B<-l> is in effect, it will only show the number of lines for each file that has lines matching. Without B<-l>, some line counts may be zeroes. If combined with B<-h> (B<--no-filename>) ack outputs only one total count. =item B<--[no]color>, B<--[no]colour> B<--color> highlights the matching text. B<--nocolor> suppresses the color. This is on by default unless the output is redirected. On Windows, this option is off by default unless the L module is installed or the C environment variable is used. =item B<--color-filename=I> Sets the color to be used for filenames. =item B<--color-match=I> Sets the color to be used for matches. =item B<--color-lineno=I> Sets the color to be used for line numbers. =item B<--[no]column> Show the column number of the first match. This is helpful for editors that can place your cursor at a given position. =item B<--create-ackrc> Dumps the default ack options to standard output. This is useful for when you want to customize the defaults. =item B<--dump> Writes the list of options loaded and where they came from to standard output. Handy for debugging. =item B<--[no]env> B<--noenv> disables all environment processing. No F<.ackrc> is read and all environment variables are ignored. By default, F considers F<.ackrc> and settings in the environment. =item B<--flush> B<--flush> flushes output immediately. This is off by default unless ack is running interactively (when output goes to a pipe or file). =item B<-f> Only print the files that would be searched, without actually doing any searching. PATTERN must not be specified, or it will be taken as a path to search. =item B<--files-from=I> The list of files to be searched is specified in I. The list of files are separated by newlines. If I is C<->, the list is loaded from standard input. =item B<--[no]filter> Forces ack to act as if it were receiving input via a pipe. =item B<--[no]follow> Follow or don't follow symlinks, other than whatever starting files or directories were specified on the command line. This is off by default. =item B<-g I> Print searchable files where the relative path + filename matches I. Note that ack -g foo is exactly the same as ack -f | ack foo This means that just as ack will not search, for example, F<.jpg> files, C<-g> will not list F<.jpg> files either. ack is not intended to be a general-purpose file finder. Note also that if you have C<-i> in your .ackrc that the filenames to be matched will be case-insensitive as well. This option can be combined with B<--color> to make it easier to spot the match. =item B<--[no]group> B<--group> groups matches by file name. This is the default when used interactively. B<--nogroup> prints one result per line, like grep. This is the default when output is redirected. =item B<-H>, B<--with-filename> Print the filename for each match. This is the default unless searching a single explicitly specified file. =item B<-h>, B<--no-filename> Suppress the prefixing of filenames on output when multiple files are searched. =item B<--[no]heading> Print a filename heading above each file's results. This is the default when used interactively. =item B<--help>, B<-?> Print a short help statement. =item B<--help-types>, B<--help=types> Print all known types. =item B<-i>, B<--ignore-case> Ignore case distinctions in PATTERN =item B<--ignore-ack-defaults> Tells ack to completely ignore the default definitions provided with ack. This is useful in combination with B<--create-ackrc> if you I want to customize ack. =item B<--[no]ignore-dir=I>, B<--[no]ignore-directory=I> Ignore directory (as CVS, .svn, etc are ignored). May be used multiple times to ignore multiple directories. For example, mason users may wish to include B<--ignore-dir=data>. The B<--noignore-dir> option allows users to search directories which would normally be ignored (perhaps to research the contents of F<.svn/props> directories). The I must always be a simple directory name. Nested directories like F are NOT supported. You would need to specify B<--ignore-dir=foo> and then no files from any foo directory are taken into account by ack unless given explicitly on the command line. =item B<--ignore-file=I> Ignore files matching I. The filters are specified identically to file type filters as seen in L. =item B<-k>, B<--known-types> Limit selected files to those with types that ack knows about. This is equivalent to the default behavior found in ack 1. =item B<--lines=I> Only print line I of each file. Multiple lines can be given with multiple B<--lines> options or as a comma separated list (B<--lines=3,5,7>). B<--lines=4-7> also works. The lines are always output in ascending order, no matter the order given on the command line. =item B<-l>, B<--files-with-matches> Only print the filenames of matching files, instead of the matching text. =item B<-L>, B<--files-without-matches> Only print the filenames of files that do I match. =item B<--match I> Specify the I explicitly. This is helpful if you don't want to put the regex as your first argument, e.g. when executing multiple searches over the same set of files. # search for foo and bar in given files ack file1 t/file* --match foo ack file1 t/file* --match bar =item B<-m=I>, B<--max-count=I> Stop reading a file after I matches. =item B<--man> Print this manual page. =item B<-n>, B<--no-recurse> No descending into subdirectories. =item B<-o> Show only the part of each line matching PATTERN (turns off text highlighting) =item B<--output=I> Output the evaluation of I for each line (turns off text highlighting) If PATTERN matches more than once then a line is output for each non-overlapping match. For more information please see the section L">. =item B<--pager=I>, B<--nopager> B<--pager> directs ack's output through I. This can also be specified via the C and C environment variables. Using --pager does not suppress grouping and coloring like piping output on the command-line does. B<--nopager> cancels any setting in ~/.ackrc, C or C. No output will be sent through a pager. =item B<--passthru> Prints all lines, whether or not they match the expression. Highlighting will still work, though, so it can be used to highlight matches while still seeing the entire file, as in: # Watch a log file, and highlight a certain IP address $ tail -f ~/access.log | ack --passthru 123.45.67.89 =item B<--print0> Only works in conjunction with -f, -g, -l or -c (filename output). The filenames are output separated with a null byte instead of the usual newline. This is helpful when dealing with filenames that contain whitespace, e.g. # remove all files of type html ack -f --html --print0 | xargs -0 rm -f =item B<-Q>, B<--literal> Quote all metacharacters in PATTERN, it is treated as a literal. =item B<-r>, B<-R>, B<--recurse> Recurse into sub-directories. This is the default and just here for compatibility with grep. You can also use it for turning B<--no-recurse> off. =item B<-s> Suppress error messages about nonexistent or unreadable files. This is taken from fgrep. =item B<--[no]smart-case>, B<--no-smart-case> Ignore case in the search strings if PATTERN contains no uppercase characters. This is similar to C in vim. This option is off by default, and ignored if C<-i> is specified. B<-i> always overrides this option. =item B<--sort-files> Sorts the found files lexicographically. Use this if you want your file listings to be deterministic between runs of I. =item B<--show-types> Outputs the filetypes that ack associates with each file. Works with B<-f> and B<-g> options. =item B<--type=[no]TYPE> Specify the types of files to include or exclude from a search. TYPE is a filetype, like I or I. B<--type=perl> can also be specified as B<--perl>, and B<--type=noperl> can be done as B<--noperl>. If a file is of both type "foo" and "bar", specifying --foo and --nobar will exclude the file, because an exclusion takes precedence over an inclusion. Type specifications can be repeated and are ORed together. See I for a list of valid types. =item B<--type-add I:I:I> Files with the given FILTERARGS applied to the given FILTER are recognized as being of (the existing) type TYPE. See also L. =item B<--type-set I:I:I> Files with the given FILTERARGS applied to the given FILTER are recognized as being of type TYPE. This replaces an existing definition for type TYPE. See also L. =item B<--type-del I> The filters associated with TYPE are removed from Ack, and are no longer considered for searches. =item B<-v>, B<--invert-match> Invert match: select non-matching lines =item B<--version> Display version and copyright information. =item B<-w>, B<--word-regexp> =item B<-w>, B<--word-regexp> Turn on "words mode". This sometimes matches a whole word, but the semantics is quite subtle. If the passed regexp begins with a word character, then a word boundary is required before the match. If the passed regexp ends with a word character, or with a word character followed by newline, then a word boundary is required after the match. Thus, for example, B<-w> with the regular expression C will not match the strings C or C. However, if the regular expression is C<(ox|ass)> then it will match those strings. Because the regular expression's first character is C<(>, the B<-w> flag has no effect at the start, and because the last character is C<)>, it has no effect at the end. Force PATTERN to match only whole words. The PATTERN is wrapped with C<\b> metacharacters. =item B<-x> An abbreviation for B<--files-from=->; the list of files to search are read from standard input, with one line per file. =item B<-1> Stops after reporting first match of any kind. This is different from B<--max-count=1> or B<-m1>, where only one match per file is shown. Also, B<-1> works with B<-f> and B<-g>, where B<-m> does not. =item B<--thpppt> Display the all-important Bill The Cat logo. Note that the exact spelling of B<--thpppppt> is not important. It's checked against a regular expression. =item B<--bar> Check with the admiral for traps. =item B<--cathy> Chocolate, Chocolate, Chocolate! =back =head1 THE .ackrc FILE The F<.ackrc> file contains command-line options that are prepended to the command line before processing. Multiple options may live on multiple lines. Lines beginning with a # are ignored. A F<.ackrc> might look like this: # Always sort the files --sort-files # Always color, even if piping to another program --color # Use "less -r" as my pager --pager=less -r Note that arguments with spaces in them do not need to be quoted, as they are not interpreted by the shell. Basically, each I in the F<.ackrc> file is interpreted as one element of C<@ARGV>. F looks in several locations for F<.ackrc> files; the searching process is detailed in L. These files are not considered if B<--noenv> is specified on the command line. =head1 Defining your own types ack allows you to define your own types in addition to the predefined types. This is done with command line options that are best put into an F<.ackrc> file - then you do not have to define your types over and over again. In the following examples the options will always be shown on one command line so that they can be easily copy & pasted. File types can be specified both with the the I<--type=xxx> option, or the file type as an option itself. For example, if you create a filetype of "cobol", you can specify I<--type=cobol> or simply I<--cobol>. File types must be at least two characters long. This is why the C language is I<--cc> and the R language is I<--rr>. I searches for foo in all perl files. I tells you, that perl files are files ending in .pl, .pm, .pod or .t. So what if you would like to include .xs files as well when searching for --perl files? I does this for you. B<--type-add> appends additional extensions to an existing type. If you want to define a new type, or completely redefine an existing type, then use B<--type-set>. I defines the type I to include files with the extensions .e or .eiffel. So to search for all eiffel files containing the word Bertrand use I. As usual, you can also write B<--type=eiffel> instead of B<--eiffel>. Negation also works, so B<--noeiffel> excludes all eiffel files from a search. Redefining also works: I and I<.xs> files no longer belong to the type I. When defining your own types in the F<.ackrc> file you have to use the following: --type-set=eiffel:ext:e,eiffel or writing on separate lines --type-set eiffel:ext:e,eiffel The following does B work in the F<.ackrc> file: --type-set eiffel:ext:e,eiffel In order to see all currently defined types, use I<--help-types>, e.g. I In addition to filtering based on extension (like ack 1.x allowed), ack 2 offers additional filter types. The generic syntax is I<--type-set TYPE:FILTER:FILTERARGS>; I depends on the value of I. =over 4 =item is:I I filters match the target filename exactly. It takes exactly one argument, which is the name of the file to match. Example: --type-set make:is:Makefile =item ext:I[,I[,...]] I filters match the extension of the target file against a list of extensions. No leading dot is needed for the extensions. Example: --type-set perl:ext:pl,pm,t =item match:I I filters match the target filename against a regular expression. The regular expression is made case insensitive for the search. Example: --type-set make:match:/(gnu)?makefile/ =item firstlinematch:I I matches the first line of the target file against a regular expression. Like I, the regular expression is made case insensitive. Example: --type-add perl:firstlinematch:/perl/ =back More filter types may be made available in the future. =head1 ENVIRONMENT VARIABLES For commonly-used ack options, environment variables can make life much easier. These variables are ignored if B<--noenv> is specified on the command line. =over 4 =item ACKRC Specifies the location of the user's F<.ackrc> file. If this file doesn't exist, F looks in the default location. =item ACK_OPTIONS This variable specifies default options to be placed in front of any explicit options on the command line. =item ACK_COLOR_FILENAME Specifies the color of the filename when it's printed in B<--group> mode. By default, it's "bold green". The recognized attributes are clear, reset, dark, bold, underline, underscore, blink, reverse, concealed black, red, green, yellow, blue, magenta, on_black, on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, and on_white. Case is not significant. Underline and underscore are equivalent, as are clear and reset. The color alone sets the foreground color, and on_color sets the background color. This option can also be set with B<--color-filename>. =item ACK_COLOR_MATCH Specifies the color of the matching text when printed in B<--color> mode. By default, it's "black on_yellow". This option can also be set with B<--color-match>. See B for the color specifications. =item ACK_COLOR_LINENO Specifies the color of the line number when printed in B<--color> mode. By default, it's "bold yellow". This option can also be set with B<--color-lineno>. See B for the color specifications. =item ACK_PAGER Specifies a pager program, such as C, C or C, to which ack will send its output. Using C does not suppress grouping and coloring like piping output on the command-line does, except that on Windows ack will assume that C does not support color. C overrides C if both are specified. =item ACK_PAGER_COLOR Specifies a pager program that understands ANSI color sequences. Using C does not suppress grouping and coloring like piping output on the command-line does. If you are not on Windows, you never need to use C. =back =head1 AVAILABLE COLORS F uses the colors available in Perl's L module, which provides the following listed values. Note that case does not matter when using these values. =head2 Foreground colors black red green yellow blue magenta cyan white bright_black bright_red bright_green bright_yellow bright_blue bright_magenta bright_cyan bright_white =head2 Background colors on_black on_red on_green on_yellow on_blue on_magenta on_cyan on_white on_bright_black on_bright_red on_bright_green on_bright_yellow on_bright_blue on_bright_magenta on_bright_cyan on_bright_white =head1 ACK & OTHER TOOLS =head2 Simple vim integration F integrates easily with the Vim text editor. Set this in your F<.vimrc> to use F instead of F: set grepprg=ack\ -k That example uses C<-k> to search through only files of the types ack knows about, but you may use other default flags. Now you can search with F and easily step through the results in Vim: :grep Dumper perllib =head2 Editor integration Many users have integrated ack into their preferred text editors. For details and links, see L. =head2 Shell and Return Code For greater compatibility with I, I in normal use returns shell return or exit code of 0 only if something is found and 1 if no match is found. (Shell exit code 1 is C<$?=256> in perl with C or backticks.) The I code 2 for errors is not used. If C<-f> or C<-g> are specified, then 0 is returned if at least one file is found. If no files are found, then 1 is returned. =cut =head1 DEBUGGING ACK PROBLEMS If ack gives you output you're not expecting, start with a few simple steps. =head2 Use B<--noenv> Your environment variables and F<.ackrc> may be doing things you're not expecting, or forgotten you specified. Use B<--noenv> to ignore your environment and F<.ackrc>. =head2 Use B<-f> to see what files have been selected Ack's B<-f> was originally added as a debugging tool. If ack is not finding matches you think it should find, run F to see what files have been selected. You can also add the C<--show-types> options to show the type of each file selected. =head2 Use B<--dump> This lists the ackrc files that are loaded and the options loaded from them. So for example you can find a list of directories that do not get searched or where filetypes are defined. =head1 TIPS =head2 Use the F<.ackrc> file. The F<.ackrc> is the place to put all your options you use most of the time but don't want to remember. Put all your --type-add and --type-set definitions in it. If you like --smart-case, set it there, too. I also set --sort-files there. =head2 Use F<-f> for working with big codesets Ack does more than search files. C will create a list of all the Perl files in a tree, ideal for sending into F. For example: # Change all "this" to "that" in all Perl files in a tree. ack -f --perl | xargs perl -p -i -e's/this/that/g' or if you prefer: perl -p -i -e's/this/that/g' $(ack -f --perl) =head2 Use F<-Q> when in doubt about metacharacters If you're searching for something with a regular expression metacharacter, most often a period in a filename or IP address, add the -Q to avoid false positives without all the backslashing. See the following example for more... =head2 Use ack to watch log files Here's one I used the other day to find trouble spots for a website visitor. The user had a problem loading F, so I took the access log and scanned it with ack twice. ack -Q aa.bb.cc.dd /path/to/access.log | ack -Q -B5 troublesome.gif The first ack finds only the lines in the Apache log for the given IP. The second finds the match on my troublesome GIF, and shows the previous five lines from the log in each case. =head2 Examples of F<--output> Following variables are useful in the expansion string: =over 4 =item C<$&> The whole string matched by PATTERN. =item C<$1>, C<$2>, ... The contents of the 1st, 2nd ... bracketed group in PATTERN. =item C<$`> The string before the match. =item C<$'> The string after the match. =back For more details and other variables see L. This example shows how to add text around a particular pattern (in this case adding _ around word with "e") ack2.pl "\w*e\w*" quick.txt --output="$`_$&_$'" _The_ quick brown fox jumps over the lazy dog The quick brown fox jumps _over_ the lazy dog The quick brown fox jumps over _the_ lazy dog This shows how to pick out particular parts of a match using ( ) within regular expression. ack '=head(\d+)\s+(.*)' --output=' $1 : $2' input file contains "=head1 NAME" output "1 : NAME" =head1 COMMUNITY There are ack mailing lists and a Slack channel for ack. See L for details. =head1 FAQ =head2 Why isn't ack finding a match in (some file)? First, take a look and see if ack is even looking at the file. ack is intelligent in what files it will search and which ones it won't, but sometimes that can be surprising. Use the C<-f> switch, with no regex, to see a list of files that ack will search for you. If your file doesn't show up in the list of files that C shows, then ack never looks in it. NOTE: If you're using an old ack before 2.0, it's probably because it's of a type that ack doesn't recognize. In ack 1.x, the searching behavior is driven by filetype. B You can use the C<--show-types> switch to show which type ack thinks each file is. =head2 Wouldn't it be great if F did search & replace? No, ack will always be read-only. Perl has a perfectly good way to do search & replace in files, using the C<-i>, C<-p> and C<-n> switches. You can certainly use ack to select your files to update. For example, to change all "foo" to "bar" in all PHP files, you can do this from the Unix shell: $ perl -i -p -e's/foo/bar/g' $(ack -f --php) =head2 Can I make ack recognize F<.xyz> files? Yes! Please see L. If you think that F should recognize a type by default, please see L. =head2 There's already a program/package called ack. Yes, I know. =head2 Why is it called ack if it's called ack-grep? The name of the program is "ack". Some packagers have called it "ack-grep" when creating packages because there's already a package out there called "ack" that has nothing to do with this ack. I suggest you make a symlink named F that points to F because one of the crucial benefits of ack is having a name that's so short and simple to type. To do that, run this with F or as root: ln -s /usr/bin/ack-grep /usr/bin/ack Alternatively, you could use a shell alias: # bash/zsh alias ack=ack-grep # csh alias ack ack-grep =head2 What does F mean? Nothing. I wanted a name that was easy to type and that you could pronounce as a single syllable. =head2 Can I do multi-line regexes? No, ack does not support regexes that match multiple lines. Doing so would require reading in the entire file at a time. If you want to see lines near your match, use the C<--A>, C<--B> and C<--C> switches for displaying context. =head2 Why is ack telling me I have an invalid option when searching for C<+foo>? ack treats command line options beginning with C<+> or C<-> as options; if you would like to search for these, you may prefix your search term with C<--> or use the C<--match> option. (However, don't forget that C<+> is a regular expression metacharacter!) =head2 Why does C<"ack '.{40000,}'"> fail? Isn't that a valid regex? The Perl language limits the repetition quantifier to 32K. You can search for C<.{32767}> but not C<.{32768}>. =head2 Ack does "X" and shouldn't, should it? We try to remain as close to grep's behavior as possible, so when in doubt, see what grep does! If there's a mismatch in functionality there, please bring it up on the ack-users mailing list. =head1 ACKRC LOCATION SEMANTICS Ack can load its configuration from many sources. The following list specifies the sources Ack looks for configuration files; each one that is found is loaded in the order specified here, and each one overrides options set in any of the sources preceding it. (For example, if I set --sort-files in my user ackrc, and --nosort-files on the command line, the command line takes precedence) =over 4 =item * Defaults are loaded from App::Ack::ConfigDefaults. This can be omitted using C<--ignore-ack-defaults>. =item * Global ackrc Options are then loaded from the global ackrc. This is located at C on Unix-like systems. Under Windows XP and earlier, the global ackrc is at C Under Windows Vista/7, the global ackrc is at C The C<--noenv> option prevents all ackrc files from being loaded. =item * User ackrc Options are then loaded from the user's ackrc. This is located at C<$HOME/.ackrc> on Unix-like systems. Under Windows XP and earlier, the user's ackrc is at C. Under Windows Vista/7, the user's ackrc is at C. If you want to load a different user-level ackrc, it may be specified with the C<$ACKRC> environment variable. The C<--noenv> option prevents all ackrc files from being loaded. =item * Project ackrc Options are then loaded from the project ackrc. The project ackrc is the first ackrc file with the name C<.ackrc> or C<_ackrc>, first searching in the current directory, then the parent directory, then the grandparent directory, etc. This can be omitted using C<--noenv>. =item * --ackrc The C<--ackrc> option may be included on the command line to specify an ackrc file that can override all others. It is consulted even if C<--noenv> is present. =item * ACK_OPTIONS Options are then loaded from the environment variable C. This can be omitted using C<--noenv>. =item * Command line Options are then loaded from the command line. =back =head1 DIFFERENCES BETWEEN ACK 1.X AND ACK 2.X A lot of changes were made for ack 2; here is a list of them. =head2 GENERAL CHANGES =over 4 =item * When no selectors are specified, ack 1.x only searches through files that it can map to a file type. ack 2.x, by contrast, will search through every regular, non-binary file that is not explicitly ignored via B<--ignore-file> or B<--ignore-dir>. This is similar to the behavior of the B<-a/--all> option in ack 1.x. =item * A more flexible filter system has been added, so that more powerful file types may be created by the user. For details, please consult L. =item * ack now loads multiple ackrc files; see L for details. =item * ack's default filter definitions aren't special; you may tell ack to completely disregard them if you don't like them. =back =head2 REMOVED OPTIONS =over 4 =item * Because of the change in default search behavior, the B<-a/--all> and B<-u/--unrestricted> options have been removed. In addition, the B<-k/--known-types> option was added to cause ack to behave with the default search behavior of ack 1.x. =item * The B<-G> option has been removed. Two regular expressions on the command line was considered too confusing; to simulate B<-G>'s functionality, you may use the new B<-x> option to pipe filenames from one invocation of ack into another. =item * The B<--binary> option has been removed. =item * The B<--skipped> option has been removed. =item * The B<--text> option has been removed. =item * The B<--invert-file-match> option has been removed. Instead, you may use B<-v> with B<-g>. =back =head2 CHANGED OPTIONS =over 4 =item * The options that modify the regular expression's behavior (B<-i>, B<-w>, B<-Q>, and B<-v>) may now be used with B<-g>. =back =head2 ADDED OPTIONS =over 4 =item * B<--files-from> was added so that a user may submit a list of filenames as a list of files to search. =item * B<-x> was added to tell ack to accept a list of filenames via standard input; this list is the list of filenames that will be used for the search. =item * B<-s> was added to tell ack to suppress error messages about non-existent or unreadable files. =item * B<--ignore-directory> and B<--noignore-directory> were added as aliases for B<--ignore-dir> and B<--noignore-dir> respectively. =item * B<--ignore-file> was added so that users may specify patterns of files to ignore (ex. /.*~$/). =item * B<--dump> was added to allow users to easily find out which options are set where. =item * B<--create-ackrc> was added so that users may create custom ackrc files based on the default settings loaded by ack, and so that users may easily view those defaults. =item * B<--type-del> was added to selectively remove file type definitions. =item * B<--ignore-ack-defaults> was added so that users may ignore ack's default options in favor of their own. =item * B<--bar> was added so ack users may consult Admiral Ackbar. =back =head1 AUTHOR Andy Lester, C<< >> =head1 BUGS Please report any bugs or feature requests to the issues list at Github: L =head1 ENHANCEMENTS All enhancement requests MUST first be posted to the ack-users mailing list at L. I will not consider a request without it first getting seen by other ack users. This includes requests for new filetypes. There is a list of enhancements I want to make to F in the ack issues list at Github: L Patches are always welcome, but patches with tests get the most attention. =head1 SUPPORT Support for and information about F can be found at: =over 4 =item * The ack homepage L =item * The ack-users mailing list L =item * The ack issues list at Github L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =item * Search CPAN L =item * MetaCPAN L =item * Git source repository L =back =head1 ACKNOWLEDGEMENTS How appropriate to have Inowledgements! Thanks to everyone who has contributed to ack in any way, including Michele Campeotto, H.Merijn Brand, Duke Leto, Gerhard Poul, Ethan Mallove, Marek Kubica, Ray Donnelly, Nikolaj Schumacher, Ed Avis, Nick Morrott, Austin Chamberlin, Varadinsky, SEbastien FeugEre, Jakub Wilk, Pete Houston, Stephen Thirlwall, Jonah Bishop, Chris Rebert, Denis Howe, RaEl GundEn, James McCoy, Daniel Perrett, Steven Lee, Jonathan Perret, Fraser Tweedale, RaEl GundEn, Steffen Jaeckel, Stephan Hohe, Michael Beijen, Alexandr Ciornii, Christian Walde, Charles Lee, Joe McMahon, John Warwick, David Steinbrunner, Kara Martens, Volodymyr Medvid, Ron Savage, Konrad Borowski, Dale Sedivic, Michael McClimon, Andrew Black, Ralph Bodenner, Shaun Patterson, Ryan Olson, Shlomi Fish, Karen Etheridge, Olivier Mengue, Matthew Wild, Scott Kyle, Nick Hooey, Bo Borgerson, Mark Szymanski, Marq Schneider, Packy Anderson, JR Boyens, Dan Sully, Ryan Niebur, Kent Fredric, Mike Morearty, Ingmar Vanhassel, Eric Van Dewoestine, Sitaram Chamarty, Adam James, Richard Carlsson, Pedro Melo, AJ Schuster, Phil Jackson, Michael Schwern, Jan Dubois, Christopher J. Madsen, Matthew Wickline, David Dyck, Jason Porritt, Jjgod Jiang, Thomas Klausner, Uri Guttman, Peter Lewis, Kevin Riggle, Ori Avtalion, Torsten Blix, Nigel Metheringham, GEbor SzabE, Tod Hagan, Michael Hendricks, Evar ArnfjErE Bjarmason, Piers Cawley, Stephen Steneker, Elias Lutfallah, Mark Leighton Fisher, Matt Diephouse, Christian Jaeger, Bill Sully, Bill Ricker, David Golden, Nilson Santos F. Jr, Elliot Shank, Merijn Broeren, Uwe Voelker, Rick Scott, Ask BjErn Hansen, Jerry Gay, Will Coleda, Mike O'Regan, Slaven ReziE<0x107>, Mark Stosberg, David Alan Pisoni, Adriano Ferreira, James Keenan, Leland Johnson, Ricardo Signes, Pete Krawczyk and Rob Hoelz. =head1 COPYRIGHT & LICENSE Copyright 2005-2017 Andy Lester. This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License v2.0. See http://www.perlfoundation.org/artistic_license_2_0 or the LICENSE.md file that comes with the ack distribution. =cut ack-2.22/IsPath.pm0000644000175000017500000000140213066014025012365 0ustar andyandypackage App::Ack::Filter::IsPath; =head1 NAME App::Ack::Filter::IsPath =head1 DESCRIPTION Filters based on path. =cut use strict; use warnings; use base 'App::Ack::Filter'; use App::Ack::Filter::IsPathGroup; sub new { my ( $class, $filename ) = @_; return bless { filename => $filename, groupname => 'IsPathGroup', }, $class; } sub create_group { return App::Ack::Filter::IsPathGroup->new(); } sub filter { my ( $self, $resource ) = @_; return $resource->name eq $self->{'filename'}; } sub inspect { my ( $self ) = @_; my $filename = $self->{'filename'}; return ref($self) . " - $filename"; } sub to_string { my ( $self ) = @_; my $filename = $self->{'filename'}; return $filename; } 1; ack-2.22/ConfigLoader.pm0000644000175000017500000006056213066014025013545 0ustar andyandypackage App::Ack::ConfigLoader; use strict; use warnings; use App::Ack (); use App::Ack::ConfigDefault (); use App::Ack::ConfigFinder (); use App::Ack::Filter; use App::Ack::Filter::Collection; use App::Ack::Filter::Default; use Carp 1.04 (); use Getopt::Long 2.38 (); use Text::ParseWords 3.1 (); =head1 NAME App::Ack::ConfigLoader =head1 DESCRIPTION Logic for loading configuration files. =head1 FUNCTIONS =head2 process_args( @sources ) =cut my @INVALID_COMBINATIONS; BEGIN { my @context = qw( -A -B -C --after-context --before-context --context ); my @pretty = qw( --heading --group --break ); my @filename = qw( -h -H --with-filename --no-filename ); @INVALID_COMBINATIONS = ( # XXX normalize [qw(-l)] => [@context, @pretty, @filename, qw(-L -o --passthru --output --max-count --column -f -g --show-types)], [qw(-L)] => [@context, @pretty, @filename, qw(-l -o --passthru --output --max-count --column -f -g --show-types -c --count)], [qw(--line)] => [@context, @pretty, @filename, qw(-l --files-with-matches --files-without-matches -L -o --passthru --match -m --max-count -1 -c --count --column --print0 -f -g --show-types)], [qw(-o)] => [@context, qw(--output -c --count --column --column -f --show-types)], [qw(--passthru)] => [@context, qw(--output --column -m --max-count -1 -c --count -f -g)], [qw(--output)] => [@context, qw(-c --count -f -g)], [qw(--match)] => [qw(-f -g)], [qw(-m --max-count)] => [qw(-1 -f -g -c --count)], [qw(-h --no-filename)] => [qw(-H --with-filename -f -g --group --heading)], [qw(-H --with-filename)] => [qw(-h --no-filename -f -g)], [qw(-c --count)] => [@context, @pretty, qw(--column -f -g)], [qw(--column)] => [qw(-f -g)], [@context] => [qw(-f -g)], [qw(-f)] => [qw(-g), @pretty], [qw(-g)] => [qw(-f), @pretty], ); } sub _generate_ignore_dir { my ( $option_name, $opt ) = @_; my $is_inverted = $option_name =~ /^--no/; return sub { my ( undef, $dir ) = @_; $dir = App::Ack::remove_dir_sep( $dir ); if ( $dir !~ /:/ ) { $dir = 'is:' . $dir; } my ( $filter_type, $args ) = split /:/, $dir, 2; if ( $filter_type eq 'firstlinematch' ) { Carp::croak( qq{Invalid filter specification "$filter_type" for option '$option_name'} ); } my $filter = App::Ack::Filter->create_filter($filter_type, split(/,/, $args)); my $collection; my $previous_inversion_matches = $opt->{idirs} && !($is_inverted xor $opt->{idirs}[-1]->is_inverted()); if ( $previous_inversion_matches ) { $collection = $opt->{idirs}[-1]; if ( $is_inverted ) { # XXX this relies on invert of an inverted filter # to return the original $collection = $collection->invert() } } else { $collection = App::Ack::Filter::Collection->new(); if ( $is_inverted ) { push @{ $opt->{idirs} }, $collection->invert(); } else { push @{ $opt->{idirs} }, $collection; } } $collection->add($filter); if ( $filter_type eq 'is' ) { $collection->add(App::Ack::Filter::IsPath->new($args)); } }; } sub process_filter_spec { my ( $spec ) = @_; if ( $spec =~ /^(\w+):(\w+):(.*)/ ) { my ( $type_name, $ext_type, $arguments ) = ( $1, $2, $3 ); return ( $type_name, App::Ack::Filter->create_filter($ext_type, split(/,/, $arguments)) ); } elsif ( $spec =~ /^(\w+)=(.*)/ ) { # Check to see if we have ack1-style argument specification. my ( $type_name, $extensions ) = ( $1, $2 ); my @extensions = split(/,/, $extensions); foreach my $extension ( @extensions ) { $extension =~ s/^[.]//; } return ( $type_name, App::Ack::Filter->create_filter('ext', @extensions) ); } else { Carp::croak "invalid filter specification '$spec'"; } } sub uninvert_filter { my ( $opt, @filters ) = @_; return unless defined $opt->{filters} && @filters; # Loop through all the registered filters. If we hit one that # matches this extension and it's inverted, we need to delete it from # the options. for ( my $i = 0; $i < @{ $opt->{filters} }; $i++ ) { my $opt_filter = @{ $opt->{filters} }[$i]; # XXX Do a real list comparison? This just checks string equivalence. if ( $opt_filter->is_inverted() && "$opt_filter->{filter}" eq "@filters" ) { splice @{ $opt->{filters} }, $i, 1; $i--; } } return; } sub process_filetypes { my ( $opt, $arg_sources ) = @_; Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); # start with default options, minus some annoying ones Getopt::Long::Configure( 'no_ignore_case', 'no_auto_abbrev', 'pass_through', ); my %additional_specs; my $add_spec = sub { my ( undef, $spec ) = @_; my ( $name, $filter ) = process_filter_spec($spec); push @{ $App::Ack::mappings{$name} }, $filter; $additional_specs{$name . '!'} = sub { my ( undef, $value ) = @_; my @filters = @{ $App::Ack::mappings{$name} }; if ( not $value ) { @filters = map { $_->invert() } @filters; } else { uninvert_filter( $opt, @filters ); } push @{ $opt->{'filters'} }, @filters; }; }; my $set_spec = sub { my ( undef, $spec ) = @_; my ( $name, $filter ) = process_filter_spec($spec); $App::Ack::mappings{$name} = [ $filter ]; $additional_specs{$name . '!'} = sub { my ( undef, $value ) = @_; my @filters = @{ $App::Ack::mappings{$name} }; if ( not $value ) { @filters = map { $_->invert() } @filters; } push @{ $opt->{'filters'} }, @filters; }; }; my $delete_spec = sub { my ( undef, $name ) = @_; delete $App::Ack::mappings{$name}; delete $additional_specs{$name . '!'}; }; my %type_arg_specs = ( 'type-add=s' => $add_spec, 'type-set=s' => $set_spec, 'type-del=s' => $delete_spec, ); foreach my $source (@{$arg_sources}) { my ( $source_name, $args ) = @{$source}{qw/name contents/}; if ( ref($args) ) { # $args are modified in place, so no need to munge $arg_sources local @ARGV = @{$args}; Getopt::Long::GetOptions(%type_arg_specs); @{$args} = @ARGV; } else { ( undef, $source->{contents} ) = Getopt::Long::GetOptionsFromString($args, %type_arg_specs); } } $additional_specs{'k|known-types'} = sub { my ( undef, $value ) = @_; my @filters = map { @{$_} } values(%App::Ack::mappings); push @{ $opt->{'filters'} }, @filters; }; return \%additional_specs; } sub removed_option { my ( $option, $explanation ) = @_; $explanation ||= ''; return sub { warn "Option '$option' is not valid in ack 2.\n$explanation"; exit 1; }; } sub get_arg_spec { my ( $opt, $extra_specs ) = @_; my $dash_a_explanation = <<'EOT'; You don't need -a, ack 1.x users. This is because ack 2.x has -k/--known-types which makes it only select files of known types, rather than any text file (which is the behavior of ack 1.x). If you're surprised to see this message because you didn't put -a on the command line, you may have options in an .ackrc, or in the ACKRC_OPTIONS environment variable. Try using the --dump flag to help find it. EOT =begin Adding-Options *** IF YOU ARE MODIFYING ACK PLEASE READ THIS *** If you plan to add a new option to ack, please make sure of the following: * Your new option has a test underneath the t/ directory. * Your new option is explained when a user invokes ack --help. (See App::Ack::show_help) * Your new option is explained when a user invokes ack --man. (See the POD at the end of ./ack) * Add your option to t/config-loader.t * Add your option to t/Util.pm#get_options * Add your option's description and aliases to dev/generate-completion-scripts.pl * Go through the list of options already available, and consider whether your new option can be considered mutually exclusive with another option. =end Adding-Options =cut sub _context_value { my $val = shift; # Contexts default to 2. return (!defined($val) || ($val < 0)) ? 2 : $val; } return { 1 => sub { $opt->{1} = $opt->{m} = 1 }, 'A|after-context:-1' => sub { shift; $opt->{after_context} = _context_value(shift) }, 'B|before-context:-1' => sub { shift; $opt->{before_context} = _context_value(shift) }, 'C|context:-1' => sub { shift; $opt->{before_context} = $opt->{after_context} = _context_value(shift) }, 'a' => removed_option('-a', $dash_a_explanation), 'all' => removed_option('--all', $dash_a_explanation), 'break!' => \$opt->{break}, c => \$opt->{count}, 'color|colour!' => \$opt->{color}, 'color-match=s' => \$ENV{ACK_COLOR_MATCH}, 'color-filename=s' => \$ENV{ACK_COLOR_FILENAME}, 'color-lineno=s' => \$ENV{ACK_COLOR_LINENO}, 'column!' => \$opt->{column}, count => \$opt->{count}, 'create-ackrc' => sub { print "$_\n" for ( '--ignore-ack-defaults', App::Ack::ConfigDefault::options() ); exit; }, 'env!' => sub { my ( undef, $value ) = @_; if ( !$value ) { $opt->{noenv_seen} = 1; } }, f => \$opt->{f}, 'files-from=s' => \$opt->{files_from}, 'filter!' => \$App::Ack::is_filter_mode, flush => \$opt->{flush}, 'follow!' => \$opt->{follow}, g => \$opt->{g}, G => removed_option('-G'), 'group!' => sub { shift; $opt->{heading} = $opt->{break} = shift }, 'heading!' => \$opt->{heading}, 'h|no-filename' => \$opt->{h}, 'H|with-filename' => \$opt->{H}, 'i|ignore-case' => \$opt->{i}, 'ignore-directory|ignore-dir=s' => _generate_ignore_dir('--ignore-dir', $opt), 'ignore-file=s' => sub { my ( undef, $file ) = @_; my ( $filter_type, $args ) = split /:/, $file, 2; my $filter = App::Ack::Filter->create_filter($filter_type, split(/,/, $args)); if ( !$opt->{ifiles} ) { $opt->{ifiles} = App::Ack::Filter::Collection->new(); } $opt->{ifiles}->add($filter); }, 'lines=s' => sub { shift; my $val = shift; push @{$opt->{lines}}, $val }, 'l|files-with-matches' => \$opt->{l}, 'L|files-without-matches' => \$opt->{L}, 'm|max-count=i' => \$opt->{m}, 'match=s' => \$opt->{regex}, 'n|no-recurse' => \$opt->{n}, o => sub { $opt->{output} = '$&' }, 'output=s' => \$opt->{output}, 'pager:s' => sub { my ( undef, $value ) = @_; $opt->{pager} = $value || $ENV{PAGER}; }, 'noignore-directory|noignore-dir=s' => _generate_ignore_dir('--noignore-dir', $opt), 'nopager' => sub { $opt->{pager} = undef }, 'passthru' => \$opt->{passthru}, 'print0' => \$opt->{print0}, 'Q|literal' => \$opt->{Q}, 'r|R|recurse' => sub { $opt->{n} = 0 }, 's' => \$opt->{dont_report_bad_filenames}, 'show-types' => \$opt->{show_types}, 'smart-case!' => \$opt->{smart_case}, 'sort-files' => \$opt->{sort_files}, 'type=s' => sub { my ( $getopt, $value ) = @_; my $cb_value = 1; if ( $value =~ s/^no// ) { $cb_value = 0; } my $callback = $extra_specs->{ $value . '!' }; if ( $callback ) { $callback->( $getopt, $cb_value ); } else { Carp::croak( "Unknown type '$value'" ); } }, 'u' => removed_option('-u'), 'unrestricted' => removed_option('--unrestricted'), 'v|invert-match' => \$opt->{v}, 'w|word-regexp' => \$opt->{w}, 'x' => sub { $opt->{files_from} = '-' }, 'version' => sub { App::Ack::print_version_statement(); exit; }, 'help|?:s' => sub { shift; App::Ack::show_help(@_); exit; }, 'help-types' => sub { App::Ack::show_help_types(); exit; }, 'man' => sub { App::Ack::show_man(); exit; }, $extra_specs ? %{$extra_specs} : (), }; # arg_specs } sub process_other { my ( $opt, $extra_specs, $arg_sources ) = @_; # Start with default options, minus some annoying ones. Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); Getopt::Long::Configure( 'bundling', 'no_ignore_case', ); my $argv_source; my $is_help_types_active; foreach my $source (@{$arg_sources}) { my ( $source_name, $args ) = @{$source}{qw/name contents/}; if ( $source_name eq 'ARGV' ) { $argv_source = $args; last; } } if ( $argv_source ) { # This *should* always be true, but you never know... my @copy = @{$argv_source}; local @ARGV = @copy; Getopt::Long::Configure('pass_through'); Getopt::Long::GetOptions( 'help-types' => \$is_help_types_active, ); Getopt::Long::Configure('no_pass_through'); } my $arg_specs = get_arg_spec($opt, $extra_specs); foreach my $source (@{$arg_sources}) { my ( $source_name, $args ) = @{$source}{qw/name contents/}; my $args_for_source = $arg_specs; if ( $source->{project} ) { my $illegal = sub { die "Options --output, --pager and --match are forbidden in project .ackrc files.\n"; }; $args_for_source = { %{$args_for_source}, 'output=s' => $illegal, 'pager:s' => $illegal, 'match=s' => $illegal, }; } my $ret; if ( ref($args) ) { local @ARGV = @{$args}; $ret = Getopt::Long::GetOptions( %{$args_for_source} ); @{$args} = @ARGV; } else { ( $ret, $source->{contents} ) = Getopt::Long::GetOptionsFromString( $args, %{$args_for_source} ); } if ( !$ret ) { if ( !$is_help_types_active ) { my $where = $source_name eq 'ARGV' ? 'on command line' : "in $source_name"; App::Ack::die( "Invalid option $where" ); } } if ( $opt->{noenv_seen} ) { App::Ack::die( "--noenv found in $source_name" ); } } # XXX We need to check on a -- in the middle of a non-ARGV source return; } sub should_dump_options { my ( $sources ) = @_; foreach my $source (@{$sources}) { my ( $name, $options ) = @{$source}{qw/name contents/}; if($name eq 'ARGV') { my $dump; local @ARGV = @{$options}; Getopt::Long::Configure('default', 'pass_through', 'no_auto_help', 'no_auto_version'); Getopt::Long::GetOptions( 'dump' => \$dump, ); @{$options} = @ARGV; return $dump; } } return; } sub explode_sources { my ( $sources ) = @_; my @new_sources; Getopt::Long::Configure('default', 'pass_through', 'no_auto_help', 'no_auto_version'); my %opt; my $arg_spec = get_arg_spec(\%opt); my $add_type = sub { my ( undef, $arg ) = @_; # XXX refactor? if ( $arg =~ /(\w+)=/) { $arg_spec->{$1} = sub {}; } else { ( $arg ) = split /:/, $arg; $arg_spec->{$arg} = sub {}; } }; my $del_type = sub { my ( undef, $arg ) = @_; delete $arg_spec->{$arg}; }; foreach my $source (@{$sources}) { my ( $name, $options ) = @{$source}{qw/name contents/}; if ( ref($options) ne 'ARRAY' ) { $source->{contents} = $options = [ Text::ParseWords::shellwords($options) ]; } for my $j ( 0 .. @{$options}-1 ) { next unless $options->[$j] =~ /^-/; my @chunk = ( $options->[$j] ); push @chunk, $options->[$j] while ++$j < @{$options} && $options->[$j] !~ /^-/; $j--; my @copy = @chunk; local @ARGV = @chunk; Getopt::Long::GetOptions( 'type-add=s' => $add_type, 'type-set=s' => $add_type, 'type-del=s' => $del_type, ); Getopt::Long::GetOptions( %{$arg_spec} ); push @new_sources, { name => $name, contents => \@copy, }; } } return \@new_sources; } sub compare_opts { my ( $a, $b ) = @_; my $first_a = $a->[0]; my $first_b = $b->[0]; $first_a =~ s/^--?//; $first_b =~ s/^--?//; return $first_a cmp $first_b; } sub dump_options { my ( $sources ) = @_; $sources = explode_sources($sources); my %opts_by_source; my @source_names; foreach my $source (@{$sources}) { my ( $name, $contents ) = @{$source}{qw/name contents/}; if ( not $opts_by_source{$name} ) { $opts_by_source{$name} = []; push @source_names, $name; } push @{$opts_by_source{$name}}, $contents; } foreach my $name (@source_names) { my $contents = $opts_by_source{$name}; print $name, "\n"; print '=' x length($name), "\n"; print ' ', join(' ', @{$_}), "\n" foreach sort { compare_opts($a, $b) } @{$contents}; } return; } sub remove_default_options_if_needed { my ( $sources ) = @_; my $default_index; foreach my $index ( 0 .. $#{$sources} ) { if ( $sources->[$index]{'name'} eq 'Defaults' ) { $default_index = $index; last; } } return $sources unless defined $default_index; my $should_remove = 0; # Start with default options, minus some annoying ones. Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); Getopt::Long::Configure( 'no_ignore_case', 'no_auto_abbrev', 'pass_through', ); foreach my $index ( $default_index + 1 .. $#{$sources} ) { my ( $name, $args ) = @{$sources->[$index]}{qw/name contents/}; if (ref($args)) { local @ARGV = @{$args}; Getopt::Long::GetOptions( 'ignore-ack-defaults' => \$should_remove, ); @{$args} = @ARGV; } else { ( undef, $sources->[$index]{contents} ) = Getopt::Long::GetOptionsFromString($args, 'ignore-ack-defaults' => \$should_remove, ); } } Getopt::Long::Configure('default'); Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); return $sources unless $should_remove; my @copy = @{$sources}; splice @copy, $default_index, 1; return \@copy; } sub check_for_mutually_exclusive_options { my ( $arg_sources ) = @_; my %mutually_exclusive_with; my @copy = @{$arg_sources}; for(my $i = 0; $i < @INVALID_COMBINATIONS; $i += 2) { my ( $lhs, $rhs ) = @INVALID_COMBINATIONS[ $i, $i + 1 ]; foreach my $l_opt ( @{$lhs} ) { foreach my $r_opt ( @{$rhs} ) { push @{ $mutually_exclusive_with{ $l_opt } }, $r_opt; push @{ $mutually_exclusive_with{ $r_opt } }, $l_opt; } } } while( @copy ) { my %set_opts; my $source = shift @copy; my ( $source_name, $args ) = @{$source}{qw/name contents/}; $args = ref($args) ? [ @{$args} ] : [ Text::ParseWords::shellwords($args) ]; foreach my $opt ( @{$args} ) { next unless $opt =~ /^[-+]/; last if $opt eq '--'; if( $opt =~ /^(.*)=/ ) { $opt = $1; } elsif ( $opt =~ /^(-[^-]).+/ ) { $opt = $1; } $set_opts{ $opt } = 1; my $mutex_opts = $mutually_exclusive_with{ $opt }; next unless $mutex_opts; foreach my $mutex_opt ( @{$mutex_opts} ) { if($set_opts{ $mutex_opt }) { die "Options '$mutex_opt' and '$opt' are mutually exclusive\n"; } } } } return; } sub process_args { my $arg_sources = \@_; my %opt = ( pager => $ENV{ACK_PAGER_COLOR} || $ENV{ACK_PAGER}, ); check_for_mutually_exclusive_options($arg_sources); $arg_sources = remove_default_options_if_needed($arg_sources); if ( should_dump_options($arg_sources) ) { dump_options($arg_sources); exit(0); } my $type_specs = process_filetypes(\%opt, $arg_sources); process_other(\%opt, $type_specs, $arg_sources); while ( @{$arg_sources} ) { my $source = shift @{$arg_sources}; my ( $source_name, $args ) = @{$source}{qw/name contents/}; # All of our sources should be transformed into an array ref if ( ref($args) ) { if ( $source_name eq 'ARGV' ) { @ARGV = @{$args}; } elsif (@{$args}) { Carp::croak "source '$source_name' has extra arguments!"; } } else { Carp::croak 'The impossible has occurred!'; } } my $filters = ($opt{filters} ||= []); # Throw the default filter in if no others are selected. if ( not grep { !$_->is_inverted() } @{$filters} ) { push @{$filters}, App::Ack::Filter::Default->new(); } return \%opt; } sub retrieve_arg_sources { my @arg_sources; my $noenv; my $ackrc; Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); Getopt::Long::Configure('pass_through'); Getopt::Long::Configure('no_auto_abbrev'); Getopt::Long::GetOptions( 'noenv' => \$noenv, 'ackrc=s' => \$ackrc, ); Getopt::Long::Configure('default', 'no_auto_help', 'no_auto_version'); my @files; if ( !$noenv ) { my $finder = App::Ack::ConfigFinder->new; @files = $finder->find_config_files; } if ( $ackrc ) { # We explicitly use open so we get a nice error message. # XXX This is a potential race condition!. if(open my $fh, '<', $ackrc) { close $fh; } else { die "Unable to load ackrc '$ackrc': $!" } push( @files, { path => $ackrc } ); } push @arg_sources, { name => 'Defaults', contents => [ App::Ack::ConfigDefault::options_clean() ], }; foreach my $file ( @files) { my @lines = App::Ack::ConfigFinder::read_rcfile($file->{path}); if(@lines) { push @arg_sources, { name => $file->{path}, contents => \@lines, project => $file->{project}, }; } } if ( $ENV{ACK_OPTIONS} && !$noenv ) { push @arg_sources, { name => 'ACK_OPTIONS', contents => $ENV{ACK_OPTIONS}, }; } push @arg_sources, { name => 'ARGV', contents => [ @ARGV ], }; return @arg_sources; } 1; # End of App::Ack::ConfigLoader ack-2.22/Changes0000644000175000017500000003625713217305160012153 0ustar andyandyHistory file for ack. https://beyondgrep.com/ 2.22 Fri Dec 22 16:42:43 CST 2017 ==================================== No changes since 2.21_01. 2.21_01 Mon Dec 18 23:40:45 CST 2017 ==================================== [FIXES] Avoid a fatal error that sometimes happened if a file was unreadable. (GH#520) [ENHANCEMENTS] Added support for the Kotlin language. Sped up file type detection for certain files. 2.20 Sun Dec 10 21:54:55 CST 2017 ==================================== No changes since 2.19_01. 2.19_01 Thu Dec 7 23:35:53 CST 2017 ==================================== [FIXES] Changed a construction in the docs that Ubuntu flagged as a misspelling. [ENHANCEMENTS] When using submodules, the .git directory will be a file. Make ack ignore this by default. Thanks, Michele Campeotto. (GH#653) [INTERNALS] Replaced all the test data for the test suite with public domain documents. 2.18 Fri Mar 24 14:53:19 CDT 2017 ==================================== ack 2.18 will probably be the final release in the ack 2.x series. I'm going to be starting work on ack 3.000 in earnest. Still, if you discover problems with ack 2, please report them to https://github.com/petdance/ack2/issues If you're interested in ack 3 development, please sign up for the ack-dev mailing list and/or join the ack Slack. See https://beyondgrep.com/community/ for details. [INTERNALS] Removed the abstraction of App::Ack::Resource and its subclass App::Ack::Resource::Basic. We are abandoning the idea that we'll have plugins. 2.17_02 Thu Mar 23 22:25:13 CDT 2017 ==================================== [FIXES] ack no longer throws an undefined variable warning if it's called from a directory that doesn't exist. (GH #634) [DOCUMENTATION] Explain that filetypes must be two characters or longer. (GH #389) [INTERNALS] Removed dependency on File::Glob which isn't used. 2.17_01 Wed Mar 15 23:25:28 CDT 2017 ==================================== [FIXES] --context=0 (and its short counterpart -C 0) did not set to context of 0. This means that a command-line --context=0 couldn't override a --context=5 in your ackrc. Thanks, Ed Avis. (GH #595) t/ack-s.t would fail in non-English locales. Thanks, Olivier Mengué. (GH #485, GH #515) [ENHANCEMENTS] --after-context and --before-context (and their short counterparts -A and -B) no longer require a value to be passed. If no value is set, they default to 2. (GH #351) Added .xhtml to the --html filetype. Added .wsdl to the --xml filetype. Thanks, H.Merijn Brand. (GH #456) [DOCUMENTATION] Updated incorrect docs about how ack works. Thanks, Gerhard Poul. (GH #543) 2.16 Fri Mar 10 13:32:39 CST 2017 ==================================== No changes since 2.15_03. [CONFUSING BEHAVIOR & UPCOMING CHANGES] The -w has a confusing behavior that it's had since back to ack 1.x that will be changing in the future. It's not changing in this version, but this is a heads-up that it's coming. ack -w is "match a whole word", and ack does this by putting turning your PATTERN into \bPATTERN\b. So "ack -w foo" effectively becomes "ack \bfoo\b". Handy. The problem is that ack doesn't put a \b before PATTERN if it begins with a non-word character, and won't put a \b after PATTERN if it ends with a non-word character. The problem is that if you're searching for "fool" or "foot", but only as a word, and you do "ack -w foo[lt]" or "ack -w (fool|foot)", you'll get matches for "football and foolish" which certainly should not match if you're using -w. 2.15_03 Sun Feb 26 23:07:35 CST 2017 ==================================== [ENHANCEMENTS] Include .cljs, .cljc and .edn files with the --clojure filetype. Thanks, Austin Chamberlin. Added .xsd to the --xml filetype. Thanks, Nick Morrott. Added support for Swift language. Thanks, Nikolaj Schumacher. (GH #512) The MSYS2 project is now seen as Windows. Thanks, Ray Donnelly. (GH #450) Expand the definition of OCaml files. Thanks, Marek Kubica. (GH #511) Add support for Groovy Server Pages. Thanks, Ethan Mallove. (GH #469) [INTERNALS] Added test to test --output. Thanks, Varadinsky! (GH #587, GH #590) [DOCUMENTATION] Expanded the explanation of how the -w flag works. Thanks, Ed Avis. (GH #585) 2.15_02 Thu Dec 17 15:51:15 CST 2015 ==================================== This is the first dev version in nine months. Many changes have gone into this, probably more than have been listed here. We need to update this list, but for now these are fixes we know are in here. My apologies for not having this changelog accurate. [FIXES] Reverted an optimization to make \s work properly again. (GH #572, GH #571, GH #562, GH #491, GH #498) Fixed an out-of-date FAQ entry. Thanks, Jakub Wilk. (GH #580) [ENHANCEMENTS] The JSP filetype (--jsp) now recognizes .jspf files. Thanks, Sebastien Feugere. (GH #586) [INTERNALS] Added test to make sure subdirs of target subdirs are ignored if --ignore-dir applies to them. Thanks, Pete Houston. (GH #570) 2.15_01 Fri Feb 13 16:23:54 CST 2015 ==================================== [FIXES] The -l and -c flags would sometimes return inaccurate results due to a bug introduced in 2.14. Thanks to Elliot Shank for the report! (GH #491) Behavior when using newlines in a search was inconsistent. Thanks to Yves Chevallier for the report! (GH #522) Add minimal requirement of Getopt::Long 2.38, not 2.35, for GetOptionsFromString. Don't ignore directories that are specified as command line targets (GH #524) Fix a bug where a regular expression that matches the empty string could cause ack to go into an infinite loop (GH #542) [ENHANCEMENTS] Many optimizations and code cleanups. Thanks, Stephan Hohe. Added --hpp option for C++ header files. Thankis, Steffen Jaeckel. ack now supports --ignore-dir=match:.... Thanks, Ailin Nemui! (GitHub ticket #42) ack also supports --ignore-dir=ext:..., and --noignore-dir supports match/ext as well 2.14 Wed Sep 3 22:48:00 CDT 2014 ==================================== [FIXES] The -s flag would fail to suppress certain warnings. Thanks, Kassio Borges. (GitHub ticket #439) The -w flag would fail to work properly with regex features such as alternation. Thanks to Ed Avis for the report (GitHub ticket #443) The -g flag should now work faster on larger codebases. Thanks to Manuel Meurer for the report (GitHub ticket #458) [ENHANCEMENTS] ack now ignores JavaScript and CSS source maps. Thanks, Chris Rebert. ack now ships with customized shell completion scripts for bash and zsh. 2.13_06 Sat Jan 25 23:36:09 CST 2014 ==================================== [FIXES] More fixes for Windows tests. Thanks to GitHub user @ispedals. [ENHANCEMENTS] Add docs for available colors in ack. 2.13_05 Thu Jan 9 22:41:33 CST 2014 ==================================== [FIXES] More whack-a-mole with Windows failures. This time, it's POSIX::mkfifo dying on Windows instead of returning undef like the docs implied, or at least that I inferred. [ENHANCEMENTS] --create-ackrc keeps the comments that describe each of the options, and it shows the ack version number. 2.13_04 Sat Jan 4 11:17:28 CST 2014 ==================================== [FIXES] Fixed incorrect deduping of config files under Windows. Thanks, Denis Howe. 2.13_03 Thu Jan 2 22:23:03 CST 2014 ==================================== [FIXES] More build fixes for Windows. Windows config finder fixes from James McCoy. t/ack-named-pipes.t uses POSIX::mkfifo instead of the external command, which should be more portable. Thanks, Pete Krawczyk. [ENHANCEMENTS] Now ignores Cabal (Haskell) sandboxes. Thanks, Fraser Tweedale. Added filetypes for Jade, Smarty and Stylus. Thanks, Raúl Gundín. 2.13_02 Fri Dec 27 12:54:27 CST 2013 ==================================== [FIXES] The building of ack-standalone relied on the output of `perldoc -l`, which I apparently can't rely on having been installed. I've changed the way that the squash program finds File::Next. 2.13_01 Wed Dec 25 13:36:08 CST 2013 ==================================== So this is Christmas And what have you done I'm sitting here hacking On ack 2.13_01 -- via Pete Krawczyk [FIXES] Issue #313: ack would fail when trying to check files for readability on some networked filesystems, or on Mac OS X with ACLs. Now it uses the filetest pragma. Thanks, Jonathan Perret. [INTERNALS] ack's entire test suite now runs under Perl's -T taint flag. We'll build more security tests on top of this. Added some checks to the squash program that I hope will turn up errors in the Windows builds. 2.12 Tue Dec 3 07:05:02 CST 2013 ==================================== [SECURITY FIXES] This version of ack prevents the --pager, --regex and --output options from being used from project-level ackrc files. It is possible to execute malicious code with these options, and we want to prevent the security risk of acking through a potentially malicious codebase, such as one downloaded from an Internet site or checked out from a code repository. The --pager, --regex and --output options may still be used from the global /etc/ackrc, your own private ~/.ackrc, the ACK_OPTIONS environment variable, and of course from the command line. [ENHANCEMENTS] Now ignores Eclipse .metadata directory. Thanks, Steffen Jaeckel. [INTERNALS] Removed the Git revision tracking in the --version. 2.11_02 Sun Oct 6 12:39:21 CDT 2013 ==================================== [FIXES] 2.11_01 was mispackaged. This fixes that. 2.11_01 Sun Sep 29 13:15:41 CDT 2013 ==================================== [FIXES] Fixed a race condition in t/file-permission.t that was causing failures if tests were run in parallel. 2.10 Tue Sep 24 16:24:11 CDT 2013 ==================================== [ENHANCEMENTS] Add --perltest for *.t files. Added Matlab support. Thanks, Zertrin. [FIXES] Fix the test suite for Win32. Many thanks to Christian Walde for bringing the severity of this issue to our attention, as well as providing a Win32 development environment for us to work with. Fixed Win32-detection in the Makefile.PL. Thanks, Michael Beijen and Alexandr Ciornii. More compatibility fixes for Perl 5.8.8. 2.08 Thu Aug 22 23:11:45 CDT 2013 ==================================== [ENHANCEMENTS] ack now ignores CMake's build/cache directories by default. Thanks, Volodymyr Medvid. Add shebang matching for --lua files. Add documentation for --ackrc. Add Elixir filetype. Add --cathy option. Thanks to Joe McMahon. Add some helpful debugging tips when an invalid option is found. Thanks to Charles Lee. Ignore PDF files by default, because Perl will detect them as text. Ignore .gif, .jpg, .jpeg and .png files. They won't normally be selected, but this is an optimization so that ack doesn't have to open them to know. [FIXES] Ack's colorizing of output would get confused with multiple sets of parentheses. This has been fixed. (Issue #276) Ack would get confused when trying to colorize the output in DOS-format files. This has been fixed. (Issue #145) 2.06 ==================================== This mistake of an upload lived for only about 15 minutes. 2.05_01 Tue May 28 10:12:04 CDT 2013 ==================================== [ENHANCEMENTS] We now ignore the node_modules directories created by npm. Thanks, Konrad Borowski. --pager without an argument implies --pager=$PAGER. --perl now recognizes Plack-style .psgi files. Thanks, Ron Savage. Added filetypes for Coffescript, JSON, LESS, and Sass. [FIXES] Command-line options now override options set in ackrc files. ACK_PAGER and ACK_PAGER_COLOR now work as advertised. Fix a bug resulting in uninitialized variable warnings when more than one capture group was specified in the search pattern. Make sure ack is happy to build and test under cron and other console-less environments. Colored output is now supported and on by default on Windows. 2.04 Fri Apr 26 22:47:55 CDT 2013 ==================================== ack now runs on a standard Perl 5.8.8 install with no module updates. The minimum Perl requirement for ack is now explicitly 5.8.8. Anything before 5.8.8 will not work, and we've added checks. Thanks, Michael McClimon. [FIXES] ack was colorizing captured groups even if --nocolor was given. Thanks, Dale Sedivic. [ENHANCEMENTS] The --shell file type now recognizes the fish shell. We now ignore minified CSS or Javascript, in the form of either *.css.min or *.min.css, or *.js.min or *.min.js. Added support for the Dart language. ack 2.02 was much slower than ack 1.96, up to 8x slower in some cases. These slowdowns have been mostly eliminated, and in some cases ack 2.04 is now faster than 1.96. 2.02 Thu Apr 18 23:51:52 CDT 2013 ==================================== [ENHANCEMENTS] The firstlinematch file type detection option now only searches the first 250 characters of the first line of the file. Otherwise, ack would read entire text files that were only one line long, such as minified JavaScript, and that would be slow. Thanks, Michael McClimon. [DOCUMENTATION] Many clarifications and cleanups. Thanks, Michael McClimon. 2.00 Wed Apr 17 22:49:41 CDT 2013 ==================================== The first version of ack 2.0. # Incompatibilities with ack 1.x ack 2 makes some big changes in its behaviors that could trip up users who are used to the idiosyncracies of ack 1.x. These changes could affect your searching happiness, so please read them. * ack's default behavior is now to search all files that it identifies as being text. ack 1.x would only search files that were of a file type that it recognized. * Removed the `-a` and `-u` options since the default is to search all text files. * Removed the `--binary` option. ack 2.0 will not find and search through binary files. * Removed the `--skipped` option. * Removed the `--invert-file-match` option. `-v` now works with `-g`. To list files that do not match `/foo/` ack -g foo -v * `-g` now obeys all regex options: `-i`, `-w`, `-Q`, `-v` * Removed the `-G` switch, because it was too confusing to have two regexes specified on the command line. Now you use the `-x` switch to pipe filenames from one `ack` invocation into another. To search files with filename matching "sales" for the string "foo": ack -g sales | ack -x foo # New features in ack 2.0 ack 2.0 will: * By default searches all text files, as identified by Perl's `-T` operator * We will no longer have a `-a` switch. * improved flexibility in defining filetype selectors * name equality ($filename eq 'Makefile') * glob-style matching (`*.pl` identifies a Perl file) * regex-style matching (`/\.pl$/i` identifies a Perl file) * shebang-line matching (shebang line matching `/usr/bin/perl/` identifies a Perl file) * support for multiple ackrc files * global ackrc (/etc/ackrc) * https://github.com/petdance/ack/issues/#issue/79 * user-specific ackrc (~/.ackrc) * per-project ackrc files (~/myproject/.ackrc) * you can use --dump to figure which options are set where * all inclusion/exclusion rules will be in the ackrc files * ack 2.0 has a set of definitions for filetypes, directories to include or exclude, etc, *but* these are only included so you don't need to ship an ackrc file to a new machine. You may tell ack to disregard these defaults if you like. * In addition to the classic `--thpppt` option to draw Bill the Cat, `ack --bar` will draw (of course) Admiral Ackbar. ack-2.22/MatchGroup.pm0000644000175000017500000000161513066014025013254 0ustar andyandypackage App::Ack::Filter::MatchGroup; =head1 NAME App::Ack::Filter::MatchGroup =head1 DESCRIPTION The App::Ack::Filter::MatchGroup class optimizes multiple ::Match calls into one container. See App::Ack::Filter::IsGroup for details. =cut use strict; use warnings; use base 'App::Ack::Filter'; sub new { my ( $class ) = @_; return bless { matches => [], big_re => undef, }, $class; } sub add { my ( $self, $filter ) = @_; push @{ $self->{matches} }, $filter->{regex}; my $re = join('|', map { "(?:$_)" } @{ $self->{matches} }); $self->{big_re} = qr/$re/; return; } sub filter { my ( $self, $resource ) = @_; my $re = $self->{big_re}; return $resource->basename =~ /$re/; } sub inspect { my ( $self ) = @_; # XXX Needs an explicit return. } sub to_string { my ( $self ) = @_; # XXX Needs an explicit return. } 1; ack-2.22/Inverse.pm0000644000175000017500000000121313066014025012610 0ustar andyandypackage App::Ack::Filter::Inverse; =head1 NAME App::Ack::Filter::Inverse =head1 DESCRIPTION The filter class that inverts another filter. =cut use strict; use warnings; use base 'App::Ack::Filter'; sub new { my ( $class, $filter ) = @_; return bless { filter => $filter, }, $class; } sub filter { my ( $self, $resource ) = @_; my $filter = $self->{'filter'}; return !$filter->filter( $resource ); } sub invert { my $self = shift; return $self->{'filter'}; } sub is_inverted { return 1; } sub inspect { my ( $self ) = @_; my $filter = $self->{'filter'}; return "!$filter"; } 1; ack-2.22/Is.pm0000644000175000017500000000166013066014025011556 0ustar andyandypackage App::Ack::Filter::Is; =head1 NAME App::Ack::Filter::Is =head1 DESCRIPTION Filters based on exact filename match. =cut use strict; use warnings; use base 'App::Ack::Filter'; use File::Spec 3.00 (); use App::Ack::Filter::IsGroup; sub new { my ( $class, $filename ) = @_; return bless { filename => $filename, groupname => 'IsGroup', }, $class; } sub create_group { return App::Ack::Filter::IsGroup->new(); } sub filter { my ( $self, $resource ) = @_; my $filename = $self->{'filename'}; my $base = (File::Spec->splitpath($resource->name))[2]; return $base eq $filename; } sub inspect { my ( $self ) = @_; my $filename = $self->{'filename'}; return ref($self) . " - $filename"; } sub to_string { my ( $self ) = @_; my $filename = $self->{'filename'}; return $filename; } BEGIN { App::Ack::Filter->register_filter(is => __PACKAGE__); } 1; ack-2.22/IsGroup.pm0000644000175000017500000000220713066014025012571 0ustar andyandypackage App::Ack::Filter::IsGroup; =head1 NAME App::Ack::Filter::IsGroup =head1 DESCRIPTION The App::Ack::Filter::IsGroup class optimizes multiple App::Ack::Filter::Is calls into one container. Let's say you have 100 C<--type-add=is:...> filters. You could have my @filters = map { make_is_filter($_) } 1..100; and then do if ( any { $_->filter($rsrc) } @filters ) { ... } but that's slow, because of of method lookup overhead, function call overhead, etc. So ::Is filters know how to organize themselves into an ::IsGroup filter. =cut use strict; use warnings; use base 'App::Ack::Filter'; use File::Spec 3.00 (); sub new { my ( $class ) = @_; return bless { data => {}, }, $class; } sub add { my ( $self, $filter ) = @_; $self->{data}->{ $filter->{filename} } = 1; return; } sub filter { my ( $self, $resource ) = @_; my $data = $self->{'data'}; my $base = $resource->basename; return exists $data->{$base}; } sub inspect { my ( $self ) = @_; return ref($self) . " - $self"; } sub to_string { my ( $self ) = @_; return join(' ', keys %{$self->{data}}); } 1; ack-2.22/Filter.pm0000644000175000017500000000460413066014025012431 0ustar andyandypackage App::Ack::Filter; =head1 NAME App::Ack::Filter =head1 DESCRIPTION An abstract superclass that represents objects that can filter `App::Ack::Resource` objects. =cut use strict; use warnings; use App::Ack::Filter::Inverse (); use Carp 1.04 (); my %filter_types; =head1 NAME App::Ack::Filter - Filter objects to filter files =head1 SYNOPSIS # filter implementation package MyFilter; use strict; use warnings; use base 'App::Ack::Filter'; sub filter { my ( $self, $resource ) = @_; } BEGIN { App::Ack::Filter->register_filter('mine' => __PACKAGE__); } 1; # users App::Ack::Filter->create_filter('mine', @args); =head1 DESCRIPTION App::Ack::Filter implementations are responsible for filtering filenames to be searched. =head1 METHODS =head2 App::Ack:Filter->create_filter($type, @args) Creates a filter implementation, registered as C<$type>. C<@args> are provided as additional arguments to the implementation's constructor. =cut sub create_filter { my ( undef, $type, @args ) = @_; if ( my $package = $filter_types{$type} ) { return $package->new(@args); } Carp::croak "Unknown filter type '$type'"; } =head2 App::Ack:Filter->register_filter($type, $package) Registers a filter implementation package C<$package> under the name C<$type>. =cut sub register_filter { my ( undef, $type, $package ) = @_; $filter_types{$type} = $package; return; } =head2 $filter->filter($resource) Must be implemented by filter implementations. Returns true if the filter passes, false otherwise. This method must B alter the passed-in C<$resource> object. =head2 $filter->invert() Returns a filter whose L method returns the opposite of this filter. =cut sub invert { my ( $self ) = @_; return App::Ack::Filter::Inverse->new( $self ); } =head2 $filter->is_inverted() Returns true if this filter is an inverted filter; false otherwise. =cut sub is_inverted { return 0; } =head2 $filter->to_string Converts the filter to a string. This method is also called implicitly by stringification. =cut sub to_string { my ( $self ) = @_; return '(unimplemented to_string)'; } =head2 $filter->inspect Prints a human-readable debugging string for this filter. Useful for, you guessed it, debugging. =cut sub inspect { my ( $self ) = @_; return ref($self); } 1; ack-2.22/Ack.pm0000644000175000017500000004265313217305177011721 0ustar andyandypackage App::Ack; use warnings; use strict; =head1 NAME App::Ack =head1 DESCRIPTION A container for functions for the ack program. =head1 VERSION Version 2.22 =cut our $VERSION; our $COPYRIGHT; BEGIN { $VERSION = '2.22'; $COPYRIGHT = 'Copyright 2005-2017 Andy Lester.'; } our $fh; BEGIN { $fh = *STDOUT; } our %types; our %type_wanted; our %mappings; our %ignore_dirs; our $is_filter_mode; our $output_to_pipe; our $dir_sep_chars; our $is_cygwin; our $is_windows; use File::Spec 1.00015 (); BEGIN { # These have to be checked before any filehandle diddling. $output_to_pipe = not -t *STDOUT; $is_filter_mode = -p STDIN; $is_cygwin = ($^O eq 'cygwin' || $^O eq 'msys'); $is_windows = ($^O eq 'MSWin32'); $dir_sep_chars = $is_windows ? quotemeta( '\\/' ) : quotemeta( File::Spec->catfile( '', '' ) ); } =head1 SYNOPSIS If you want to know about the F program, see the F file itself. No user-serviceable parts inside. F is all that should use this. =head1 FUNCTIONS =cut =head2 remove_dir_sep( $path ) This functions removes a trailing path separator, if there is one, from its argument =cut sub remove_dir_sep { my $path = shift; $path =~ s/[$dir_sep_chars]$//; return $path; } =head2 warn( @_ ) Put out an ack-specific warning. =cut sub warn { return CORE::warn( _my_program(), ': ', @_, "\n" ); } =head2 die( @_ ) Die in an ack-specific way. =cut sub die { return CORE::die( _my_program(), ': ', @_, "\n" ); } sub _my_program { require File::Basename; return File::Basename::basename( $0 ); } =head2 filetypes_supported() Returns a list of all the types that we can detect. =cut sub filetypes_supported { return keys %mappings; } sub thpppt { my $y = q{_ /|,\\'!.x',=(www)=, U }; $y =~ tr/,x!w/\nOo_/; App::Ack::print( "$y ack $_[0]!\n" ); exit 0; } sub ackbar { my $x; $x = <<'_BAR'; 6?!I'7!I"?%+! 3~!I#7#I"7#I!?!+!="+"="+!:! 2?#I!7!I!?#I!7!I"+"=%+"=# 1?"+!?*+!=#~"=!+#?"="+! 0?"+!?"I"?&+!="~!=!~"=!+%="+" /I!+!?)+!?!+!=$~!=!~!="+!="+"?!="?! .?%I"?%+%='?!=#~$=" ,,!?%I"?(+$=$~!=#:"~$:!~! ,I!?!I!?"I"?!+#?"+!?!+#="~$:!~!:!~!:!,!:!,":#~! +I!?&+!="+!?#+$=!~":!~!:!~!:!,!:#,!:!,%:" *+!I!?!+$=!+!=!+!?$+#=!~":!~":#,$:",#:!,!:! *I!?"+!?!+!=$+!?#+#=#~":$,!:",!:!,&:" )I!?$=!~!=#+"?!+!=!+!=!~!="~!:!~":!,'.!,%:!~! (=!?"+!?!=!~$?"+!?!+!=#~"=",!="~$,$.",#.!:!=! (I"+"="~"=!+&=!~"=!~!,!~!+!=!?!+!?!=!I!?!+"=!.",!.!,":! %I$?!+!?!=%+!~!+#~!=!~#:#=!~!+!~!=#:!,%.!,!.!:" $I!?!=!?!I!+!?"+!=!~!=!~!?!I!?!=!+!=!~#:",!~"=!~!:"~!=!:",&:" '-/ $?!+!I!?"+"=!+"~!,!:"+#~#:#,"=!~"=!,!~!,!.",!:".!:! */! !I!t!'!s! !a! !g!r!e!p!!! !/! $+"=!+!?!+"~!=!:!~!:"I!+!,!~!=!:!~!,!:!,$:!~".&:"~!,# (-/ %~!=!~!=!:!.!+"~!:!,!.!,!~!=!:$.!,":!,!.!:!~!,!:!=!.#="~!,!:" ./! %=!~!?!+"?"+!=!~",!.!:!?!~!.!:!,!:!,#.!,!:","~!:!=!~!=!:",!~! ./! %+"~":!~!=#~!:!~!,!.!~!:",!~!=!~!.!:!,!.",!:!,":!=":!.!,!:!7! -/! %~",!:".#:!=!:!,!:"+!:!~!:!.!,!~!,!.#,!.!,$:"~!,":"~!=! */! &=!~!=#+!=!~",!.!:",#:#,!.",+:!,!.",!=!+!?! &~!=!~!=!~!:"~#:",!.!,#~!:!.!+!,!.",$.",$.#,!+!I!?! &~!="~!:!~":!~",!~!=!~":!,!:!~!,!:!,&.$,#."+!?!I!?!I! &~!=!~!=!+!,!:!~!:!=!,!:!~&:$,!.!,".!,".!,#."~!+!?$I! &~!=!~!="~!=!:!~":!,!~%:#,!:",!.!,#.",#I!7"I!?!+!?"I" &+!I!7!:#~"=!~!:!,!:"~$.!=!.!,!~!,$.#,!~!7!I#?!+!?"I"7! %7#?!+!~!:!=!~!=!~":!,!:"~":#.!,)7#I"?"I!7& %7#I!=":!=!~!:"~$:"~!:#,!:!,!:!~!:#,!7#I!?#7) $7$+!,!~!=#~!:!~!:!~$:#,!.!~!:!=!,":!7#I"?#7+=!?! $7#I!~!,!~#=!~!:"~!:!,!:!,#:!=!~",":!7$I!?#I!7*+!=!+" "I!7$I!,":!,!.!=":$,!:!,$:$7$I!+!?"I!7+?"I!7!I!7!,! !,!7%I!:",!."~":!,&.!,!:!~!I!7$I!+!?"I!7,?!I!7',! !7(,!.#~":!,%.!,!7%I!7!?#I"7,+!?!7* 7+:!,!~#,"=!7'I!?#I"7/+!7+ 77I!+!7!?!7!I"71+!7, _BAR return _pic_decode($x); } sub cathy { my $x = <<'CATHY'; 0+!--+! 0|! "C!H!O!C!O!L!A!T!E!!! !|! 0|! "C!H!O!C!O!L!A!T!E!!! !|! 0|! "C!H!O!C!O!L!A!T!E!!! !|! 0|! $A"C!K!!! $|! 0+!--+! 6\! 1:!,!.! ! 7\! /.!M!~!Z!M!~! 8\! /~!D! "M! ! 4.! $\! /M!~!.!8! +.!M# 4 0,!.! (\! .~!M!N! ,+!I!.!M!.! 3 /?!O!.!M!:! '\! .O!.! +~!Z!=!N!.! 4 ..! !D!Z!.!Z!.! '\! 9=!M".! 6 /.! !.!~!M".! '\! 8~! 9 4M!.! /.!7!N!M!.! F 4.! &:!M! !N"M# !M"N!M! #D!M&=! = :M!7!M#:! !~!M!7!,!$!M!:! #.! !O!N!.!M!:!M# ; 8Z!M"~!N!$!D!.!N!?! !I!N!.! (?!M! !M!,!D!M".! 9 (?!Z!M!N!:! )=!M!O!8!.!M!+!M! !M!,! !O!M! +,!M!.!M!~!Z!N!M!:! &:!~! 0 &8!7!.!~!M"D!M!,! &M!?!=!8! !M!,!O! !M!+! !+!O!.!M! $M#~! !.!8!M!Z!.!M! !O!M"Z! %:!~!M!Z!M!Z!.! + &:!M!7!,! *M!.!Z!M! !8"M!.!M!~! !.!M!.!=! #~!8!.!M! !7!M! "N!Z#I! !D!M!,!M!.! $."M!,! !M!.! * 2$!O! "N! !.!M!I! !7" "M! "+!O! !~!M! !d!O!.!7!I!M!.! !.!O!=!M!.! !M",!M!.! %.!$!O!D! + 1~!O! "M!+! !8!$! "M! "?!O! %Z!8!D!M!?!8!I!O!7!M! #M!.!M! "M",!M! 4 07!~! ".!8! !.!M! "I!+! !.!M! &Z!D!.!7!=!M! !:!.!M! #:!8"+! !.!+!8! !8! 3 /~!M! #N! !~!M!$! !.!M! !.!M" &~!M! "~!M!O! "D! $M! !8! "M!,!M!+!D!.! 1 #.! #?!M!N!.! #~!O! $M!.!7!$! "?" !?!~!M! '7!8!?!M!.!+!M"O! $?"$!D! !.!O! !$!7!I!.! 0 $,!M!:!O!?! ".! !?!=! $=!:!O! !M! "M! !M! !+!$! (.! +.!M! !M!.! !8! !+"Z!~! $:!M!$! !.! ' #.!8!.!I!$! $7!I! %M" !=!M! !~!M!D! "7!I! .I!O! %?!=!,!D! !,!M! !D!~!8!~! %D!M! ( #.!M"?! $=!O! %=!N! "8!.! !Z!M! #M!~! (M!:! #.!M" &O! !M!.! !?!,! !8!.!N!~! $8!N!M!,!.! % *$!O! &M!,! "O! !.!M!.! #M! (~!M( &O!.! !7! "M! !.!M!.!M!,! #.!M! !M! & )=!8!.! $.!M!O!.! "$!.!I!N! !I!M# (7!M(I! %D"Z!M! "=!I! "M! !M!:! #~!D! ' )D! &8!N!:! ".!O! !M!="M! "M! (7!M) %." !M!D!."M!.! !$!=! !M!,! + (M! &+!.!M! #Z!7!O!M!.!~!8! +,!M#D!?!M#D! #.!Z!M#,!Z!?! !~!N! "N!.! !M! + 'D!:! %$!D! !?! #M!Z! !8!.! !M"?!7!?!7! '+!I!D! !?!O!:!M!:! ":!M!:! !M!7".!M! "8!+! !:!D! !.!M! * %.!O!:! $.!O!+! !D!.! #M! "M!.!+!N!I!Z! "7!M!N!M!N!?!I!7!Z!=!M'D"~! #M!.!8!$! !:! !.!M! "N!?! !,!O! ) !.!?!M!:!M!I! %8!,! "M!.! #M! "N! !M!.! !M!.! !+!~! !.!M!.! ':!M! $M! $M!Z!$! !M!.! "D! "M! "?!M! ( !7!8! !+!I! ".! "$!=! ":!$! "+! !M!.! !O! !M!I!M".! !=!~! ",!O! '=!M! $$!,! #N!:! ":!8!.! !D!~! !,!M!.! !:!M!.! & !:!,!.! &Z" #D! !.!8!."M!.! !8!?!Z!M!.!M! #Z!~! !?!M!Z!.! %~!O!.!8!$!N!8!O!I!:!~! !+! #M!.! !.!M!.! !+!M! ".!~!M!+! $ !.! 'D!I! #?!M!.!M!,! !.!Z! !.!8! #M&O!I!?! (~!I!M"." !M!Z!.! !M!N!.! "+!$!.! "M!.! !M!?!.! "8!M! $ (O!8! $M! !M!.! ".!:! !+!=! #M! #.!M! !+" *$!M":!.! !M!~! "M!7! #M! #7!Z! "M"$!M!.! !.! # '$!Z! #.!7!+!M! $.!,! !+!:! #N! #.!M!.!+!M! +D!M! #=!N! ":!O! #=!M! #Z!D! $M!I! % $,! ".! $.!M" %$!.! !?!~! "+!7!." !.!M!,! !M! *,!N!M!.$M!?! "D!,! #M!.! #N! + ,M!Z! &M! "I!,! "M! %I!M! !?!=!.! (Z!8!M! $:!M!.! !,!M! $D! #.!M!.! ) +8!O! &.!8! "I!,! !~!M! &N!M! !M!D! '?!N!O!." $?!7! "?!~! #M!.! #I!D!.! ( 3M!,! "N!.! !D" &.!+!M!.! !M":!.":!M!7!M!D! 'M!.! "M!.! "M!,! $I! ) 3I! #M! "M!,! !:! &.!M" ".!,! !.!$!M!I! #.! !:! !.!M!?! "N!+! ".! / 1M!,! #.!M!8!M!=!.! +~!N"O!Z"~! *+!M!.! "M! 2 0.!M! &M!.! 8:! %.!M!Z! "M!=! *O!,! % 0?!$! &N! )." .,! %."M! ":!M!.! 0 0N!:! %?!O! #.! ..! &,! &.!D!,! "N!I! 0 CATHY return _pic_decode($x); } sub _pic_decode { my($compressed) = @_; $compressed =~ s/(.)(.)/$1x(ord($2)-32)/eg; App::Ack::print( $compressed ); exit 0; } =head2 show_help() Dumps the help page to the user. =cut sub show_help { my $help_arg = shift || 0; return show_help_types() if $help_arg =~ /^types?/; App::Ack::print( <<"END_OF_HELP" ); Usage: ack [OPTION]... PATTERN [FILES OR DIRECTORIES] Search for PATTERN in each source file in the tree from the current directory on down. If any files or directories are specified, then only those files and directories are checked. ack may also search STDIN, but only if no file or directory arguments are specified, or if one of them is "-". Default switches may be specified in ACK_OPTIONS environment variable or an .ackrc file. If you want no dependency on the environment, turn it off with --noenv. Example: ack -i select Searching: -i, --ignore-case Ignore case distinctions in PATTERN --[no]smart-case Ignore case distinctions in PATTERN, only if PATTERN contains no upper case. Ignored if -i is specified -v, --invert-match Invert match: select non-matching lines -w, --word-regexp Force PATTERN to match only whole words -Q, --literal Quote all metacharacters; PATTERN is literal Search output: --lines=NUM Only print line(s) NUM of each file -l, --files-with-matches Only print filenames containing matches -L, --files-without-matches Only print filenames with no matches --output=expr Output the evaluation of expr for each line (turns off text highlighting) -o Show only the part of a line matching PATTERN Same as --output='\$&' --passthru Print all lines, whether matching or not --match PATTERN Specify PATTERN explicitly. -m, --max-count=NUM Stop searching in each file after NUM matches -1 Stop searching after one match of any kind -H, --with-filename Print the filename for each match (default: on unless explicitly searching a single file) -h, --no-filename Suppress the prefixing filename on output -c, --count Show number of lines matching per file --[no]column Show the column number of the first match -A NUM, --after-context=NUM Print NUM lines of trailing context after matching lines. -B NUM, --before-context=NUM Print NUM lines of leading context before matching lines. -C [NUM], --context[=NUM] Print NUM lines (default 2) of output context. --print0 Print null byte as separator between filenames, only works with -f, -g, -l, -L or -c. -s Suppress error messages about nonexistent or unreadable files. File presentation: --pager=COMMAND Pipes all ack output through COMMAND. For example, --pager="less -R". Ignored if output is redirected. --nopager Do not send output through a pager. Cancels any setting in ~/.ackrc, ACK_PAGER or ACK_PAGER_COLOR. --[no]heading Print a filename heading above each file's results. (default: on when used interactively) --[no]break Print a break between results from different files. (default: on when used interactively) --group Same as --heading --break --nogroup Same as --noheading --nobreak --[no]color Highlight the matching text (default: on unless output is redirected, or on Windows) --[no]colour Same as --[no]color --color-filename=COLOR --color-match=COLOR --color-lineno=COLOR Set the color for filenames, matches, and line numbers. --flush Flush output immediately, even when ack is used non-interactively (when output goes to a pipe or file). File finding: -f Only print the files selected, without searching. The PATTERN must not be specified. -g Same as -f, but only select files matching PATTERN. --sort-files Sort the found files lexically. --show-types Show which types each file has. --files-from=FILE Read the list of files to search from FILE. -x Read the list of files to search from STDIN. File inclusion/exclusion: --[no]ignore-dir=name Add/remove directory from list of ignored dirs --[no]ignore-directory=name Synonym for ignore-dir --ignore-file=filter Add filter for ignoring files -r, -R, --recurse Recurse into subdirectories (default: on) -n, --no-recurse No descending into subdirectories --[no]follow Follow symlinks. Default is off. -k, --known-types Include only files of types that ack recognizes. --type=X Include only X files, where X is a recognized filetype. --type=noX Exclude X files. See "ack --help-types" for supported filetypes. File type specification: --type-set TYPE:FILTER:FILTERARGS Files with the given FILTERARGS applied to the given FILTER are recognized as being of type TYPE. This replaces an existing definition for type TYPE. --type-add TYPE:FILTER:FILTERARGS Files with the given FILTERARGS applied to the given FILTER are recognized as being type TYPE. --type-del TYPE Removes all filters associated with TYPE. Miscellaneous: --[no]env Ignore environment variables and global ackrc files. --env is legal but redundant. --ackrc=filename Specify an ackrc file to use --ignore-ack-defaults Ignore default definitions included with ack. --create-ackrc Outputs a default ackrc for your customization to standard output. --help, -? This help --help-types Display all known types --dump Dump information on which options are loaded from which RC files --[no]filter Force ack to treat standard input as a pipe (--filter) or tty (--nofilter) --man Man page --version Display version & copyright --thpppt Bill the Cat --bar The warning admiral --cathy Chocolate! Chocolate! Chocolate! Exit status is 0 if match, 1 if no match. ack's home page is at https://beyondgrep.com/ The full ack manual is available by running "ack --man". This is version $VERSION of ack. Run "ack --version" for full version info. END_OF_HELP return; } =head2 show_help_types() Display the filetypes help subpage. =cut sub show_help_types { App::Ack::print( <<'END_OF_HELP' ); Usage: ack [OPTION]... PATTERN [FILES OR DIRECTORIES] The following is the list of filetypes supported by ack. You can specify a file type with the --type=TYPE format, or the --TYPE format. For example, both --type=perl and --perl work. Note that some extensions may appear in multiple types. For example, .pod files are both Perl and Parrot. END_OF_HELP my @types = filetypes_supported(); my $maxlen = 0; for ( @types ) { $maxlen = length if $maxlen < length; } for my $type ( sort @types ) { next if $type =~ /^-/; # Stuff to not show my $ext_list = $mappings{$type}; if ( ref $ext_list ) { $ext_list = join( '; ', map { $_->to_string } @{$ext_list} ); } App::Ack::print( sprintf( " --[no]%-*.*s %s\n", $maxlen, $maxlen, $type, $ext_list ) ); } return; } sub show_man { require Pod::Usage; Pod::Usage::pod2usage({ -input => $App::Ack::orig_program_name, -verbose => 2, -exitval => 0, }); return; } =head2 get_version_statement Returns the version information for ack. =cut sub get_version_statement { require Config; my $copyright = get_copyright(); my $this_perl = $Config::Config{perlpath}; if ($^O ne 'VMS') { my $ext = $Config::Config{_exe}; $this_perl .= $ext unless $this_perl =~ m/$ext$/i; } my $ver = sprintf( '%vd', $^V ); return <<"END_OF_VERSION"; ack ${VERSION} Running under Perl $ver at $this_perl $copyright This program is free software. You may modify or distribute it under the terms of the Artistic License v2.0. END_OF_VERSION } =head2 print_version_statement Prints the version information for ack. =cut sub print_version_statement { App::Ack::print( get_version_statement() ); return; } =head2 get_copyright Return the copyright for ack. =cut sub get_copyright { return $COPYRIGHT; } sub print { print {$fh} @_; return; } sub print_blank_line { App::Ack::print( "\n" ); return; } sub print_filename { App::Ack::print( $_[0], $_[1] ); return; } sub set_up_pager { my $command = shift; return if App::Ack::output_to_pipe(); my $pager; if ( not open( $pager, '|-', $command ) ) { App::Ack::die( qq{Unable to pipe to pager "$command": $!} ); } $fh = $pager; return; } =head2 output_to_pipe() Returns true if ack's input is coming from a pipe. =cut sub output_to_pipe { return $output_to_pipe; } =head2 exit_from_ack Exit from the application with the correct exit code. Returns with 0 if a match was found, otherwise with 1. The number of matches is handed in as the only argument. =cut sub exit_from_ack { my $nmatches = shift; my $rc = $nmatches ? 0 : 1; exit $rc; } =head1 COPYRIGHT & LICENSE Copyright 2005-2017 Andy Lester. This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License v2.0. =cut 1; # End of App::Ack