=head1 NAME

Devel::PerlySense::BookmarkConfig - A collection of
Bookmark::Definition and their configuration.


This is the Bookmark config chunk, and the parsed Bookmark::Definition
objects that results in.


use strict;
use warnings;

package Devel::PerlySense::BookmarkConfig;
  $Devel::PerlySense::BookmarkConfig::VERSION = '0.0199';

use Spiffy -Base;
use Carp;
use Data::Dumper;
use File::Basename;
use File::Path;
use Path::Class;

use Devel::PerlySense;
use Devel::PerlySense::Util;
use Devel::PerlySense::Util::Log;

use Devel::PerlySense::Bookmark::Definition;
use Devel::PerlySense::Bookmark::MatchResult;


=head2 oPerlySense

Devel::PerlySense object.

Default: set during new()

field "oPerlySense" => undef;

=head2 raDefinition

Array ref with Bookmark::Definition objects from the oPerlySense

sub raDefinition {
    return [
        map { Devel::PerlySense::Bookmark::Definition->newFromConfig( %$_ ) }

=head1 METHODS

=head2 new(oPerlySense)

Create new BookmarkConfig object. Associate it with $oPerlySense.

sub new {
    my ($oPerlySense) = Devel::PerlySense::Util::aNamedArg(["oPerlySense"], @_);

    $self = bless {}, $self;    #Create the object. It looks weird because of Spiffy


=head2 aMatch(file)

Parse the text in $file and return list of Bookmark::MatchResult
objects that have matches.

Die on errors, like if $file doesn't exist.

sub aMatchResult {
    my ($file) = Devel::PerlySense::Util::aNamedArg(["file"], @_);

    defined( my $source = slurp($file) ) or die("Could not read source file ($file)\n");

    $self->oPerlySense->setFindProject(file => $file) or debug("Could not identify any PerlySense Project for Bookmark matching, but that's not fatal\n");

    my @aMatchResult = map {
            oDefinition => $_,
            file => $file,
            source => $source
    } @{$self->raDefinition};




=head1 AUTHOR

Johan Lindström, C<< <johanl[ÄT]DarSerMan.com> >>

=head1 BUGS

Please report any bugs or feature requests to
C<bug-devel-perlysense@rt.cpan.org>, or through the web interface at
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.



Copyright 2005 Johan Lindström, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.