Skip to content

Commit

Permalink
prepare for release 0.066
Browse files Browse the repository at this point in the history
  • Loading branch information
terminalfool committed May 27, 2012
1 parent 34f4813 commit a9542a3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Revision history for Perl module Net::DNS::Dynamic::Adfilter

0.066 Sun May 27 08:32:24 EDT 2012
- parse adblock plus subscription links, add whitelist capability, add data::dumper method

0.065 Wed May 16 21:55:41 EDT 2012
- use general adblock loader/parser, allow infinite number of adblock lists

Expand Down
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = Net-DNS-Dynamic-Adfilter
version = 0.065
version = 0.066
author = David Watson <dwatson@cpan.org>
license = Perl_5
copyright_holder = David Watson
Expand Down
33 changes: 17 additions & 16 deletions lib/Net/DNS/Dynamic/adfilter.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::DNS::Dynamic::Adfilter;

our $VERSION = '0.065';
our $VERSION = '0.066';

use Moose 2.0403;
use Net::Address::IP::Local;
Expand All @@ -9,7 +9,6 @@ use LWP::Simple 6.00 qw($ua getstore);
$ua->agent("");

#use Data::Dumper;
#use FileHandle;

extends 'Net::DNS::Dynamic::Proxyserver';

Expand All @@ -36,7 +35,6 @@ override 'run' => sub {
# my ( $self ) = shift;
# system('networksetup -setdnsservers "Wi-Fi" empty');
# system('networksetup -setsearchdomains "Wi-Fi" empty');
# #$self->dump_adfilter; #for debugging
#};
#--

Expand Down Expand Up @@ -86,6 +84,9 @@ after 'read_config' => sub {
$cache = { $self->parse_single_col_hosts($self->whitelist->{path}) }; # remove entries
for ( keys %{ $cache } ) { delete ( $self->{adfilter}->{$_} ) };
}

# $self->dump_adfilter;

return;
};

Expand Down Expand Up @@ -168,14 +169,14 @@ sub parse_single_col_hosts {
return %hosts;
}

#sub dump_adfilter {
# my $self = shift;
sub dump_adfilter {
my $self = shift;

# my $str = Dumper(\%{ $self->adfilter });
# my $out = new FileHandle ">/var/named/adfilter.txt";
# print $out $str;
# close $out;
#}
my $str = Dumper(\%{ $self->adfilter });
open(OUT, ">/var/named/adfilter_dumpfile") or die "cant open dump file: $!";
print OUT $str;
close OUT;
}

__PACKAGE__->meta->make_immutable;

Expand All @@ -199,20 +200,20 @@ Adblock Plus, a popular ad filtering extension for the Firefox browser. Use of
the lists focuses only on third-party listings, since these generally define
dedicated ad/tracking hosts.
A local addendum of hosts can also be specified. In this case, ad host listings
A local addendum of hosts can also be specified. In this case, host listings
must conform to a one host per line format.
Once running, local network dns queries can be addressed to the host's ip. This ip is
echoed to stdout.
Once running, local network dns queries can be addressed to the host's ip. This
ip is echoed to stdout.
=head1 SYNOPSIS
my $adfilter = Net::DNS::Dynamic::Adfilter->new();
$adfilter->run();
Without any arguments, the module will function simply as a proxy, forwarding all requests
upstream to nameservers defined in /etc/resolv.conf.
Without any arguments, the module will function simply as a proxy, forwarding all
requests upstream to nameservers defined in /etc/resolv.conf.
=head1 ATTRIBUTES
Expand Down Expand Up @@ -280,7 +281,7 @@ acceptable format:
The whitelist hashref, like the custom_filter hashref, contains only a path
parameter to a single column list of hosts. These hosts will be removed from
the adfilter.
the filter.
=head1 LEGACY ATTRIBUTES
Expand Down
4 changes: 2 additions & 2 deletions scripts/adfilter.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
use strict;
use warnings;

use Net::DNS::Dynamic::Adfilter 0.065;
use Net::DNS::Dynamic::Adfilter 0.066;

use Getopt::Long;
use Pod::Usage;

our $VERSION = '0.065';
our $VERSION = '0.066';

my $debug = 0;
my $verbose = 0;
Expand Down

0 comments on commit a9542a3

Please sign in to comment.