]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/commitdiff
Rename LT::Set::Mutable to ::Container
authorVincent Pit <vince@profvince.com>
Thu, 27 Jan 2011 14:26:47 +0000 (15:26 +0100)
committerVincent Pit <vince@profvince.com>
Thu, 27 Jan 2011 14:26:47 +0000 (15:26 +0100)
And makes it require kids().

MANIFEST
lib/LaTeX/TikZ/Formatter.pm
lib/LaTeX/TikZ/Set/Container.pm [moved from lib/LaTeX/TikZ/Set/Mutable.pm with 70% similarity]
lib/LaTeX/TikZ/Set/Sequence.pm
lib/LaTeX/TikZ/Set/Union.pm
t/00-load.t
t/92-pod-coverage.t

index 01e994a857d8cb87732d42a71056d3460dfbaa3e..a4f505f0c8c594369da14df513e5823b40269318 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -27,8 +27,8 @@ lib/LaTeX/TikZ/Set.pm
 lib/LaTeX/TikZ/Set/Arc.pm
 lib/LaTeX/TikZ/Set/Arrow.pm
 lib/LaTeX/TikZ/Set/Circle.pm
 lib/LaTeX/TikZ/Set/Arc.pm
 lib/LaTeX/TikZ/Set/Arrow.pm
 lib/LaTeX/TikZ/Set/Circle.pm
+lib/LaTeX/TikZ/Set/Container.pm
 lib/LaTeX/TikZ/Set/Line.pm
 lib/LaTeX/TikZ/Set/Line.pm
-lib/LaTeX/TikZ/Set/Mutable.pm
 lib/LaTeX/TikZ/Set/Path.pm
 lib/LaTeX/TikZ/Set/Point.pm
 lib/LaTeX/TikZ/Set/Polyline.pm
 lib/LaTeX/TikZ/Set/Path.pm
 lib/LaTeX/TikZ/Set/Point.pm
 lib/LaTeX/TikZ/Set/Polyline.pm
index a5bda82f88ffa32c445c7f0f5157ac4389ed4e11..afdbd388c93d3aa8f36f74b3342c581be61dacc1 100644 (file)
@@ -212,10 +212,9 @@ my $find_mods = do {
     }
    }
 
     }
    }
 
-   my @subsets = ($set->isa('LaTeX::TikZ::Set::Sequence')
-                  || $set->isa('LaTeX::TikZ::Set::Union'))
-                   ? $set->kids
-                   : ();
+   my @subsets = $set->does('LaTeX::TikZ::Set::Container')
+                 ? $set->kids
+                 : ();
 
    $find_mods_rec->($_, $layers, $others) for @subsets;
   });
 
    $find_mods_rec->($_, $layers, $others) for @subsets;
   });
similarity index 70%
rename from lib/LaTeX/TikZ/Set/Mutable.pm
rename to lib/LaTeX/TikZ/Set/Container.pm
index e7518cd55f71e8d56ce85558723634ad61ca2be0..37a56cd42085cc3f30ebeb279a29e135ac052771 100644 (file)
@@ -1,11 +1,11 @@
-package LaTeX::TikZ::Set::Mutable;
+package LaTeX::TikZ::Set::Container;
 
 use strict;
 use warnings;
 
 =head1 NAME
 
 
 use strict;
 use warnings;
 
 =head1 NAME
 
-LaTeX::TikZ::Set::Mutable - A role for set objects that can be appended to.
+LaTeX::TikZ::Set::Container - A role for set objects that are made of subobjects.
 
 =head1 VERSION
 
 
 =head1 VERSION
 
@@ -13,8 +13,20 @@ Version 0.02
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
-L<LaTeX::TikZ::Set> objects that are mutable consume this role.
-This forces them to implement an C<add> method describing how more elements can be added to the set.
+L<LaTeX::TikZ::Set> objects that group other objects together consume this role.
+This forces them to implement :
+
+=over 4
+
+=item *
+
+a C<kids> method that returns the list of subobjects ;
+
+=item *
+
+an C<add> method describing how more elements can be added to the set.
+
+=back
 
 =cut
 
 
 =cut
 
@@ -38,6 +50,7 @@ C<add>
 
 requires qw<
  add
 
 requires qw<
  add
+ kids
 >;
 
 =head1 SEE ALSO
 >;
 
 =head1 SEE ALSO
@@ -69,4 +82,4 @@ This program is free software; you can redistribute it and/or modify it under th
 
 =cut
 
 
 =cut
 
-1; # End of LaTeX::TikZ::Set::Mutable
+1; # End of LaTeX::TikZ::Set::Container
index c4531218aec1c135e8143ec47ebed45cfdf84aa0..70176a1fb65c061a298a792e9b5001906cc004d5 100644 (file)
@@ -28,13 +28,13 @@ use Any::Moose 'Util::TypeConstraints'
 
 =head1 RELATIONSHIPS
 
 
 =head1 RELATIONSHIPS
 
-This class consumes the L<LaTeX::TikZ::Set> and L<LaTeX::TikZ::Set::Mutable> roles, and as such implements the L</draw> and L</add> methods.
+This class consumes the L<LaTeX::TikZ::Set> and L<LaTeX::TikZ::Set::Container> roles, and as such implements the L</draw>, L</kids> and L</add> methods.
 
 =cut
 
 with qw<
  LaTeX::TikZ::Set
 
 =cut
 
 with qw<
  LaTeX::TikZ::Set
- LaTeX::TikZ::Set::Mutable
+ LaTeX::TikZ::Set::Container
 >;
 
 subtype 'LaTeX::TikZ::Set::Sequence::Elements'
 >;
 
 subtype 'LaTeX::TikZ::Set::Sequence::Elements'
@@ -113,7 +113,7 @@ __PACKAGE__->meta->make_immutable;
 
 =head1 SEE ALSO
 
 
 =head1 SEE ALSO
 
-L<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Path>, L<LaTeX::TikZ::Set::Mutable>.
+L<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Path>, L<LaTeX::TikZ::Set::Container>.
 
 =head1 AUTHOR
 
 
 =head1 AUTHOR
 
index 2648d3d77223810556025bdb637b234fca8ff056..228a6ff455a1bc5a404896abecb359bef9886056 100644 (file)
@@ -24,13 +24,13 @@ use Any::Moose;
 
 =head1 RELATIONSHIPS
 
 
 =head1 RELATIONSHIPS
 
-This class consumes the L<LaTeX::TikZ::Set::Path> and L<LaTeX::TikZ::Set::Mutable> roles, and as such implements the L</path> and L</add> methods.
+This class consumes the L<LaTeX::TikZ::Set::Path> and L<LaTeX::TikZ::Set::Container> roles, and as such implements the L</path>, L</kids> and L</add> methods.
 
 =cut
 
 with qw<
  LaTeX::TikZ::Set::Path
 
 =cut
 
 with qw<
  LaTeX::TikZ::Set::Path
- LaTeX::TikZ::Set::Mutable
+ LaTeX::TikZ::Set::Container
 >;
 
 =head1 ATTRIBUTES
 >;
 
 =head1 ATTRIBUTES
@@ -97,7 +97,7 @@ __PACKAGE__->meta->make_immutable;
 
 =head1 SEE ALSO
 
 
 =head1 SEE ALSO
 
-L<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Path>, L<LaTeX::TikZ::Set::Mutable>.
+L<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Path>, L<LaTeX::TikZ::Set::Container>.
 
 =head1 AUTHOR
 
 
 =head1 AUTHOR
 
index a82117458062da21ec293555232905c2719a64ff..52955abee9567af564b51e960f872ce3bc84c44a 100644 (file)
@@ -30,8 +30,8 @@ BEGIN {
  use_ok( 'LaTeX::TikZ::Set::Arc' );
  use_ok( 'LaTeX::TikZ::Set::Arrow' );
  use_ok( 'LaTeX::TikZ::Set::Circle' );
  use_ok( 'LaTeX::TikZ::Set::Arc' );
  use_ok( 'LaTeX::TikZ::Set::Arrow' );
  use_ok( 'LaTeX::TikZ::Set::Circle' );
+ use_ok( 'LaTeX::TikZ::Set::Container' );
  use_ok( 'LaTeX::TikZ::Set::Line' );
  use_ok( 'LaTeX::TikZ::Set::Line' );
- use_ok( 'LaTeX::TikZ::Set::Mutable' );
  use_ok( 'LaTeX::TikZ::Set::Path' );
  use_ok( 'LaTeX::TikZ::Set::Point' );
  use_ok( 'LaTeX::TikZ::Set::Polyline' );
  use_ok( 'LaTeX::TikZ::Set::Path' );
  use_ok( 'LaTeX::TikZ::Set::Point' );
  use_ok( 'LaTeX::TikZ::Set::Polyline' );
index f6cc91bc22d00272c44d3c131adbb3f145a0f85a..b56e464baa73055acbafd02528e820054325ea60 100644 (file)
@@ -45,8 +45,8 @@ pod_coverage_ok( 'LaTeX::TikZ::Set' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Arc' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Arrow' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Circle' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Arc' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Arrow' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Circle' );
+pod_coverage_ok( 'LaTeX::TikZ::Set::Container' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Line' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Line' );
-pod_coverage_ok( 'LaTeX::TikZ::Set::Mutable' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Path' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Point' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Polyline' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Path' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Point' );
 pod_coverage_ok( 'LaTeX::TikZ::Set::Polyline' );