Commits

shl...@b384bcd7-cfd4-0310-aca0-d78b80f7b91b  committed 3ffba59

Fix the export of the $NK_UNKNOWN/etc. constants.

It was broken by the fact that Class::Accessor started including an import
method. This time we fixed it by separating all the constants into their
own module and making use of it instead of having ::Cell double serve as
such.

  • Participants
  • Parent commits f525d78

Comments (0)

Files changed (10)

File nurikabe-solver/Games-Nurikabe-Solver/MANIFEST

 lib/Games/Nurikabe/Solver/Base.pm
 lib/Games/Nurikabe/Solver/Board.pm
 lib/Games/Nurikabe/Solver/Cell.pm
+lib/Games/Nurikabe/Solver/Constants.pm
 lib/Games/Nurikabe/Solver/Island.pm
 lib/Games/Nurikabe/Solver/Move.pm
 lib/Games/Nurikabe/Solver.pm

File nurikabe-solver/Games-Nurikabe-Solver/lib/Games/Nurikabe/Solver/Board.pm

 
 use base 'Games::Nurikabe::Solver::Base';
 
-use Games::Nurikabe::Solver::Cell qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+use Games::Nurikabe::Solver::Cell;
+use Games::Nurikabe::Solver::Constants;
+
 use Games::Nurikabe::Solver::Island;
 use Games::Nurikabe::Solver::Move;
 

File nurikabe-solver/Games-Nurikabe-Solver/lib/Games/Nurikabe/Solver/Cell.pm

 use strict;
 
 use base 'Games::Nurikabe::Solver::Base';
-use base 'Exporter';
+
+use Games::Nurikabe::Solver::Constants;
 
 =head1 NAME
 
 
 =cut
 
-our $NK_UNKNOWN = 0;
-our $NK_WHITE = 1;
-our $NK_BLACK = 2;
-
-our @EXPORT_OK = (qw($NK_BLACK $NK_WHITE $NK_UNKNOWN));
-
 sub _init
 {
     my $self = shift;

File nurikabe-solver/Games-Nurikabe-Solver/lib/Games/Nurikabe/Solver/Constants.pm

+package Games::Nurikabe::Solver::Constants;
+
+use warnings;
+use strict;
+
+use base 'Exporter';
+
+=head1 NAME
+
+Games::Nurikabe::Solver::Constants - export constants.
+
+=head1 VERSION
+
+Version 0.01
+
+=cut
+
+our $VERSION = '0.01';
+
+=head1 SYNOPSIS
+
+    use Games::Nurikabe::Solver::Constants;
+
+    # Do something with $NK_UNKNOWN , $NK_BLACK and $NK_WHITE .
+
+=head1 FUNCTIONS
+
+=cut
+
+our $NK_UNKNOWN = 0;
+our $NK_WHITE = 1;
+our $NK_BLACK = 2;
+
+our @EXPORT_OK = (qw($NK_BLACK $NK_WHITE $NK_UNKNOWN));
+our @EXPORT = (@EXPORT_OK);
+
+=head1 AUTHOR
+
+Shlomi Fish, C<< <shlomif at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-games-nurikabe-solver at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-Nurikabe-Solver>.  I will be notified, and then you'll
+automatically be notified of progress on your bug as I make changes.
+
+
+
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+    perldoc Games::Nurikabe::Solver::Constants
+
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-Nurikabe-Solver>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Games-Nurikabe-Solver>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Games-Nurikabe-Solver>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Games-Nurikabe-Solver>
+
+=item * Version control repository:
+
+L<http://svn.berlios.de/svnroot/repos/fc-solve/nurikabe-solver/trunk/>
+
+=back
+
+=head1 ACKNOWLEDGEMENTS
+
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2008 Shlomi Fish, all rights reserved.
+
+This program is released under the following license: MIT/X11 Licence. 
+
+=cut
+
+1; # End of Games::Nurikabe::Solver

File nurikabe-solver/Games-Nurikabe-Solver/lib/Games/Nurikabe/Solver/Island.pm

 
 use base 'Games::Nurikabe::Solver::Base';
 
-use Games::Nurikabe::Solver::Cell qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+use Games::Nurikabe::Solver::Cell;
+use Games::Nurikabe::Solver::Constants qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
 
 =head1 NAME
 

File nurikabe-solver/Games-Nurikabe-Solver/lib/Games/Nurikabe/Solver/Move.pm

 use strict;
 
 use base 'Games::Nurikabe::Solver::Base';
-use Games::Nurikabe::Solver::Cell qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+
+use Games::Nurikabe::Solver::Cell;
+use Games::Nurikabe::Solver::Constants;
 
 =head1 NAME
 

File nurikabe-solver/Games-Nurikabe-Solver/t/load-from-string.t

 
 use Test::Differences;
 
-use Games::Nurikabe::Solver::Cell qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+use Games::Nurikabe::Solver::Cell;
+use Games::Nurikabe::Solver::Constants qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
 use Games::Nurikabe::Solver::Board;
 
 {

File nurikabe-solver/Games-Nurikabe-Solver/t/move1.t

 
 use Games::Nurikabe::Solver::Test::BoardInput;
 
-use Games::Nurikabe::Solver::Cell qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+use Games::Nurikabe::Solver::Cell;
+use Games::Nurikabe::Solver::Constants qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+
 use Games::Nurikabe::Solver::Move;
 
 {

File nurikabe-solver/Games-Nurikabe-Solver/t/solve-refactor.t

 
 use Test::Differences;
 
-use Games::Nurikabe::Solver::Cell qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+use Games::Nurikabe::Solver::Cell;
+use Games::Nurikabe::Solver::Constants qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+
 use Games::Nurikabe::Solver::Board;
 
 use List::MoreUtils qw(any);

File nurikabe-solver/Games-Nurikabe-Solver/t/solve1.t

 
 use Test::Differences;
 
-use Games::Nurikabe::Solver::Cell qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+use Games::Nurikabe::Solver::Cell;
+use Games::Nurikabe::Solver::Constants qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
 use Games::Nurikabe::Solver::Board;
 
 {
 
 use List::MoreUtils qw(any);
 
-use Games::Nurikabe::Solver::Cell qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+use Games::Nurikabe::Solver::Constants qw($NK_UNKNOWN $NK_WHITE $NK_BLACK);
+use Games::Nurikabe::Solver::Cell;
 
 __PACKAGE__->mk_accessors(qw(move));