Toby Inkster avatar Toby Inkster committed e10e726

Document EN::Roget; bump version

Comments (0)

Files changed (7)

lib/Crypt/XkcdPassword.pm

 
 BEGIN {
 	$Crypt::XkcdPassword::AUTHORITY = 'cpan:TOBYINK';
-	$Crypt::XkcdPassword::VERSION   = '0.003';
+	$Crypt::XkcdPassword::VERSION   = '0.004';
 }
 
 use Carp qw/carp croak/;
 	is      => 'rw',
 	isa     => sub { ref $_[0] eq 'CODE' },
 	default => sub { sub { int(rand($_[0])) } },
-	);
+);
 
 has words => (
 	is      => 'rw',
 	isa     => sub { !ref $_[0] },
 	default => sub { 'EN' },
-	);
+);
 
 *chars = *provider = sub {};
 
 
 =head2 Attributes
 
-This module doesn't use Moose, but uses its "mini-me", L<Mo>. Like Moose,
-Mo provides the concept of attributes, which have a getter/setter method.
+This module doesn't use Moose, but uses its "mini-me", L<Moo>. Like Moose,
+Moo provides the concept of attributes, which have a getter/setter method.
 
 =over
 
 C<< Crypt::XkcdPassword::Words::EN >> is a list of 10,000 common English
 words.
 
+C<< Crypt::XkcdPassword::Words::EN::Roget >> is a list of about 8500
+words. The words are less questionable, but as there are fewer of them,
+pass phrases will be chosen from a smaller pool, thus slightly more
+guessable.
+
 Also supplied is "IT", a list of 20,000 common Italian words.
 
 =item * C<< rng >>

lib/Crypt/XkcdPassword/Examples.pod

  
  say Crypt::XkcdPassword->make_password(4, $filter);
 
+=head2 Use EN::Roget
+
+An alternative English dictionary is provided which filters the standard
+English dictionary through Roget's thesaurus.
+
+ my $gen = Crypt::XkcdPassword->new(words => 'EN::Roget');
+
 =head1 COMBINING BOTH
 
 The following filter combines both of the above, and also filters out

lib/Crypt/XkcdPassword/Words/EN.pm

 package Crypt::XkcdPassword::Words::EN;
 BEGIN {
 	$Crypt::XkcdPassword::Words::EN::AUTHORITY = 'cpan:TOBYINK';
-	$Crypt::XkcdPassword::Words::EN::VERSION   = '0.003';
+	$Crypt::XkcdPassword::Words::EN::VERSION   = '0.004';
 }
 my @words;
 sub words

lib/Crypt/XkcdPassword/Words/EN/Roget.pm

 use 5.010001;
 BEGIN {
 	$Crypt::XkcdPassword::Words::EN::Roget::AUTHORITY = 'cpan:TOBYINK';
-	$Crypt::XkcdPassword::Words::EN::Roget::VERSION   = '0.003';
+	$Crypt::XkcdPassword::Words::EN::Roget::VERSION   = '0.004';
 }
-my @words;
 sub words
 {
-	unless (@words)
-	{
-		while (<DATA>)
-		{
+	state $words = do {
+		my @w;
+		while (<DATA>) {
 			chomp;
-			push @words, $_ if length;
+			push @w, $_ if length;
 		}
-	}
-	
-	\@words
+		\@w;
+	};
+	$words;
 }
 __PACKAGE__
 __DATA__

lib/Crypt/XkcdPassword/Words/IT.pm

 package Crypt::XkcdPassword::Words::IT;
 BEGIN {
 	$Crypt::XkcdPassword::Words::IT::AUTHORITY = 'cpan:TOBYINK';
-	$Crypt::XkcdPassword::Words::IT::VERSION   = '0.003';
+	$Crypt::XkcdPassword::Words::IT::VERSION   = '0.004';
 }
 my @words;
 sub words
 	dcs:changeset [
 		dcs:versus dist:v_0-001;
 		dcs:item   [rdfs:label "Forgot to run mo-inline in 0.001, creating an undeclared dependency on Mo. Have switched to Moo now anyway, and declared that as a dependency."@en;a dcs:Bugfix,dcs:Packaging];
-		].
+	].
 
 dist:project :release dist:v_0-003 .
 dist:v_0-003
 		dcs:item   [rdfs:label "Provide a $filter parameter to make_password."@en; a dcs:Addition; dcs:fixes <http://purl.org/NET/cpan-uri/rt/ticket/74684>, <http://purl.org/NET/cpan-uri/rt/ticket/74685> ];
 		dcs:item   [rdfs:label "Crypt::XkcdPassword::Examples"@en; a dcs:Addition, dcs:Documentation ] ;
 		dcs:item   [rdfs:label "Require Perl 5.10.1 (Unicode in 5.10.0 is too broken)."@en; a dcs:Packaging ]
-		].
+	].
+
+dist:project :release dist:v_0-004 .
+dist:v_0-004
+	a               :Version ;
+	dc:issued       "2012-07-06"^^xsd:date ;
+	:revision       "0.004"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/Crypt-XkcdPassword-0.004.tar.gz> ;
+	dcs:changeset [
+		dcs:versus dist:v_0-003;
+		dcs:item   [ rdfs:label "EN::Roget word list."@en; a dcs:Addition ]
+	].
+use Test::More tests => 1;
+use Crypt::XkcdPassword;
+
+my $rng = sub { 281 };
+my $gen = Crypt::XkcdPassword->new(rng => $rng, words => 'EN::Roget');
+
+is
+	$gen->make_password,
+	'British British British British';
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.