Permalink
Browse files

Dist::Zilla and Pod::Weaver

  • Loading branch information...
1 parent 94c0bef commit 351f19bd7d80247105f15832ccbcfb27b07d30c5 @gphat committed Jul 4, 2011
View
@@ -1,6 +1,10 @@
Revision history for Data-SearchEngine
-0.21 2011-07-04
+{{$NEXT}}
+ * Convert README to README.mkdn
+ * Various tiny form and style fixes related to rejiggering docs for
+ Pod::Weaver
+ * Convert to Dist::Zilla and Pod::Weaver
* Change 'order' to be a Str|HashRef for more complex sorting features.
0.20 2011-07-03
View
@@ -1,30 +0,0 @@
-Changes
-ignore.txt
-inc/Module/Install.pm
-inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/Fetch.pm
-inc/Module/Install/Makefile.pm
-inc/Module/Install/Metadata.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
-lib/Data/SearchEngine.pm
-lib/Data/SearchEngine/Item.pm
-lib/Data/SearchEngine/Meta/Attribute/Trait/Digestable.pm
-lib/Data/SearchEngine/Modifiable.pm
-lib/Data/SearchEngine/Paginator.pm
-lib/Data/SearchEngine/Query.pm
-lib/Data/SearchEngine/Results.pm
-lib/Data/SearchEngine/Results/Faceted.pm
-lib/Data/SearchEngine/Results/Spellcheck.pm
-lib/Data/SearchEngine/Results/Spellcheck/Suggestion.pm
-lib/Moose/Meta/Attribute/Custom/Trait/Digestable.pm
-Makefile.PL
-MANIFEST This list of files
-META.yml
-README
-t/01-query.t
-t/01-simple.t
-t/02-storage.t
-t/lib/SearchEngineWee.pm
-t/lib/SEWeeResults.pm
View
@@ -1,18 +0,0 @@
-use inc::Module::Install;
-
-name 'Data-SearchEngine';
-all_from 'lib/Data/SearchEngine.pm';
-author q{Cory G Watson <gphat@cpan.org>};
-license 'perl';
-
-build_requires 'Test::More' => '0.88';
-
-requires 'Data::Paginator' => '0.03';
-requires 'Digest::MD5' => '2.39';
-requires 'JSON::Any';
-requires 'Moose' => '0.89';
-requires 'MooseX::Storage' => '0.21';
-requires 'Time::HiRes' => '1.9719';
-
-WriteAll;
-
View
25 README
@@ -1,25 +0,0 @@
-NAME
-
-Data::SearchEngine - A role for search engines and cacheable results.
-
-SYNOPSIS
-
-There are B<lots> of search engine libraries. Each has a different interface.
-The goal of Data::SearchEngine is to provide a simple, extensive set of
-classes and roles that you can use to wrap a search implementation. The net
-result will be an easily swappable backend with a common set of features, such
-as serialize of results for use with a cache.
-
-AUTHOR
-
-Cory G Watson, C<< <gphat at cpan.org> >>
-
-COPYRIGHT & LICENSE
-
-Copyright 2009 Cory G Watson
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of either: the GNU General Public License as published
-by the Free Software Foundation; or the Artistic License.
-
-See http://dev.perl.org/licenses/ for more information.
View
@@ -0,0 +1,97 @@
+# NAME
+
+Data::SearchEngine - A role for search engine abstraction.
+
+# VERSION
+
+version 0.21
+
+# SYNOPSIS
+
+ package Data::SearchEngine::MySearch;
+
+ with 'Data::SearchEngine';
+
+ sub search {
+ my ($self, $query) = @_;
+
+ # ... your internal search junk
+
+ my $result = Data::SearchEngine::Results->new(
+ query => $query,
+ pager => # ... make a Data::Page
+ );
+
+ foreach my $hit (@hits) {
+ $result->add(Data::SearchEngine::Item->new(
+ values => {
+ name => $hit->name,
+ description => $hit->description
+ },
+ score => $hit->score
+ ));
+ }
+
+ return $result;
+ }
+
+# DESCRIPTION
+
+There are __lots__ of search engine libraries. Each has a different interface.
+The goal of Data::SearchEngine is to provide a simple, extensive set of
+classes and roles that you can use to wrap a search implementation. The net
+result will be an easily swappable backend with a common set of features.
+
+# IMPLEMENTATION
+
+## Step 1 - Extend the Query
+
+If you have specific attributes that you need for your query, subclass the
+[Data::SearchEngine::Query](http://search.cpan.org/perldoc?Data::SearchEngine::Query) object and add the attributes. This part is
+optional.
+
+## Step 2 - Wrap a search implementation
+
+Next use the [Data::SearchEngine](http://search.cpan.org/perldoc?Data::SearchEngine) role in a class that wraps your search
+implementation. You can find an example in [Data::SearchEngine::Results](http://search.cpan.org/perldoc?Data::SearchEngine::Results).
+
+## Step 3 - Profit!!!
+
+!!!
+
+# DIGESTS
+
+Data::SearchEngine provides a Digestable trait that can be applied to
+attributes of `Query`. Attributes with this trait will be added to
+a base64 MD5 digest to produce a unique key identifying this query. You can
+then serialize the Result using [MooseX::Storage](http://search.cpan.org/perldoc?MooseX::Storage) and store it under the
+digest of the Query for caching.
+
+# ATTRIBUTES
+
+## defaults
+
+The `defaults` attribute is a simple HashRef that backends may use to get
+default settings from the user. The implementation of `search` may then use
+these defaults when setting up instances of a search.
+
+# METHODS
+
+## get_default ($key)
+
+Returns the value from `defaults` (if any) for the specified key.
+
+## set_default ($key, $value)
+
+Sets the value in `defaults`.
+
+# AUTHOR
+
+Cory G Watson <gphat@cpan.org>
+
+# COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2011 by Cold Hard Code, LLC.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
View
@@ -0,0 +1,47 @@
+name = Data-SearchEngine
+author = Cory G Watson <gphat@cpan.org>
+license = Perl_5
+copyright_holder= Cold Hard Code, LLC
+
+[@Basic]
+
+[Git::NextVersion]
+first_version = 0.01
+version_regexp = ^(\d+\.\d+)$
+
+[ReadmeMarkdownFromPod]
+
+[PkgVersion]
+
+[AutoPrereqs]
+
+[Prereqs]
+Data::Paginator = 0.03
+JSON::Any = 0
+JSON::XS = 0
+
+[NextRelease]
+format = %v %{MMM d yyyy}d
+
+[SynopsisTests]
+
+[PodSyntaxTests]
+
+[MetaJSON]
+
+[MetaResources]
+repository.url = https://github.com/gphat/data-searchengine
+repository.type = git
+
+[CopyFilesFromBuild]
+copy = README.mkdn
+
+[PruneFiles]
+filenames = dist.ini
+
+[Git::Commit]
+
+[Git::Tag]
+tag_format = %v
+
+[PodWeaver]
View
@@ -1,29 +1,10 @@
package Data::SearchEngine;
use Moose::Role;
-our $VERSION = '0.20';
-
-has defaults => (
- traits => [ 'Hash' ],
- is => 'ro',
- isa => 'HashRef',
- handles => {
- set_default => 'set',
- get_default => 'get'
- }
-);
+# ABSTRACT: A role for search engine abstraction.
requires qw(search);
-no Moose::Role;
-1;
-
-__END__
-
-=head1 NAME
-
-Data::SearchEngine - A role for search engine abstraction.
-
=head1 SYNOPSIS
package Data::SearchEngine::MySearch;
@@ -60,6 +41,8 @@ The goal of Data::SearchEngine is to provide a simple, extensive set of
classes and roles that you can use to wrap a search implementation. The net
result will be an easily swappable backend with a common set of features.
+=begin :prelude
+
=head1 IMPLEMENTATION
=head2 Step 1 - Extend the Query
@@ -77,24 +60,14 @@ implementation. You can find an example in L<Data::SearchEngine::Results>.
!!!
-=head1 ATTRIBUTES
+=end :prelude
-=head2 defaults
+=attr defaults
The C<defaults> attribute is a simple HashRef that backends may use to get
default settings from the user. The implementation of C<search> may then use
these defaults when setting up instances of a search.
-=head1 METHODS
-
-=head2 get_default ($key)
-
-Returns the value from C<defaults> (if any) for the specified key.
-
-=head2 set_default ($key, $value)
-
-Sets the value in C<defaults>.
-
=head1 DIGESTS
Data::SearchEngine provides a Digestable trait that can be applied to
@@ -103,17 +76,27 @@ a base64 MD5 digest to produce a unique key identifying this query. You can
then serialize the Result using L<MooseX::Storage> and store it under the
digest of the Query for caching.
-=head1 AUTHOR
+=cut
-Cory G Watson, C<< <gphat at cpan.org> >>
+has defaults => (
+ traits => [ 'Hash' ],
+ is => 'ro',
+ isa => 'HashRef',
+ handles => {
+ set_default => 'set',
+ get_default => 'get'
+ }
+);
-=head1 COPYRIGHT & LICENSE
+=method get_default ($key)
-Copyright 2009 Cory G Watson
+Returns the value from C<defaults> (if any) for the specified key.
-This program is free software; you can redistribute it and/or modify it
-under the terms of either: the GNU General Public License as published
-by the Free Software Foundation; or the Artistic License.
+=method set_default ($key, $value)
-See http://dev.perl.org/licenses/ for more information.
+Sets the value in C<defaults>.
+
+=cut
+no Moose::Role;
+1;
Oops, something went wrong.

0 comments on commit 351f19b

Please sign in to comment.