From: Vincent Pit Date: Mon, 19 Jul 2010 12:16:28 +0000 (+0200) Subject: Rename L::T::API to ::Interface X-Git-Tag: v0.01~39 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=5adf00c880491bac3bd793a07431cf161c03643f;p=perl%2Fmodules%2FLaTeX-TikZ.git Rename L::T::API to ::Interface --- diff --git a/MANIFEST b/MANIFEST index 4d8c347..41853b7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4,8 +4,8 @@ META.yml Makefile.PL README lib/LaTeX/TikZ.pm -lib/LaTeX/TikZ/API.pm lib/LaTeX/TikZ/Formatter.pm +lib/LaTeX/TikZ/Interface.pm lib/LaTeX/TikZ/Mod.pm lib/LaTeX/TikZ/Mod/Clip.pm lib/LaTeX/TikZ/Mod/Color.pm diff --git a/lib/LaTeX/TikZ.pm b/lib/LaTeX/TikZ.pm index 713aff8..fc0c094 100644 --- a/lib/LaTeX/TikZ.pm +++ b/lib/LaTeX/TikZ.pm @@ -15,7 +15,7 @@ Version 0.01 our $VERSION = '0.01'; -use LaTeX::TikZ::API; +use LaTeX::TikZ::Interface; sub import { shift; @@ -29,13 +29,13 @@ sub import { } my $pkg = caller; - my $const = sub () { 'LaTeX::TikZ::API' }; + my $const = sub () { 'LaTeX::TikZ::Interface' }; { no strict 'refs'; *{$pkg . '::' . $name} = $const; } - LaTeX::TikZ::API->load; + LaTeX::TikZ::Interface->load; return; } diff --git a/lib/LaTeX/TikZ/Formatter.pm b/lib/LaTeX/TikZ/Formatter.pm index d349ed3..44af1c8 100644 --- a/lib/LaTeX/TikZ/Formatter.pm +++ b/lib/LaTeX/TikZ/Formatter.pm @@ -159,7 +159,7 @@ sub thickness { 0.8 * $width * ($tikz->scale / 5); } -use LaTeX::TikZ::API formatter => sub { +use LaTeX::TikZ::Interface formatter => sub { shift; __PACKAGE__->new(@_); diff --git a/lib/LaTeX/TikZ/API.pm b/lib/LaTeX/TikZ/Interface.pm similarity index 93% rename from lib/LaTeX/TikZ/API.pm rename to lib/LaTeX/TikZ/Interface.pm index 46fe198..91342ab 100644 --- a/lib/LaTeX/TikZ/API.pm +++ b/lib/LaTeX/TikZ/Interface.pm @@ -1,11 +1,11 @@ -package LaTeX::TikZ::API; +package LaTeX::TikZ::Interface; use strict; use warnings; =head1 NAME -LaTeX::TikZ::API - LaTeX::TikZ public API register and loader. +LaTeX::TikZ::Interface - LaTeX::TikZ public interface register and loader. =head1 VERSION @@ -101,4 +101,4 @@ This program is free software; you can redistribute it and/or modify it under th =cut -1; # End of LaTeX::TikZ::API +1; # End of LaTeX::TikZ::Interface diff --git a/lib/LaTeX/TikZ/Mod/Clip.pm b/lib/LaTeX/TikZ/Mod/Clip.pm index 5fdac3d..ab68d3a 100644 --- a/lib/LaTeX/TikZ/Mod/Clip.pm +++ b/lib/LaTeX/TikZ/Mod/Clip.pm @@ -136,7 +136,7 @@ sub apply { ) } -use LaTeX::TikZ::API clip => sub { +use LaTeX::TikZ::Interface clip => sub { shift; __PACKAGE__->new(clip => $_[0]); diff --git a/lib/LaTeX/TikZ/Mod/Color.pm b/lib/LaTeX/TikZ/Mod/Color.pm index 53fe411..47cc8a2 100644 --- a/lib/LaTeX/TikZ/Mod/Color.pm +++ b/lib/LaTeX/TikZ/Mod/Color.pm @@ -33,7 +33,7 @@ sub declare { } sub apply { 'color=' . $_[0]->color } -use LaTeX::TikZ::API color => sub { +use LaTeX::TikZ::Interface color => sub { shift; __PACKAGE__->new(color => $_[0]); diff --git a/lib/LaTeX/TikZ/Mod/Fill.pm b/lib/LaTeX/TikZ/Mod/Fill.pm index 8d350d7..f729dea 100644 --- a/lib/LaTeX/TikZ/Mod/Fill.pm +++ b/lib/LaTeX/TikZ/Mod/Fill.pm @@ -33,7 +33,7 @@ sub declare { } sub apply { 'fill=' . $_[0]->color } -use LaTeX::TikZ::API fill => sub { +use LaTeX::TikZ::Interface fill => sub { shift; __PACKAGE__->new(color => $_[0]); diff --git a/lib/LaTeX/TikZ/Mod/Layer.pm b/lib/LaTeX/TikZ/Mod/Layer.pm index f1f0daf..6b3f73d 100644 --- a/lib/LaTeX/TikZ/Mod/Layer.pm +++ b/lib/LaTeX/TikZ/Mod/Layer.pm @@ -190,7 +190,7 @@ sub apply { ) } -use LaTeX::TikZ::API layer => sub { +use LaTeX::TikZ::Interface layer => sub { shift; my $name = shift; diff --git a/lib/LaTeX/TikZ/Mod/Raw.pm b/lib/LaTeX/TikZ/Mod/Raw.pm index f5a3218..1d05720 100644 --- a/lib/LaTeX/TikZ/Mod/Raw.pm +++ b/lib/LaTeX/TikZ/Mod/Raw.pm @@ -37,7 +37,7 @@ sub declare { } sub apply { $_[0]->content } -use LaTeX::TikZ::API raw_mod => sub { +use LaTeX::TikZ::Interface raw_mod => sub { shift; __PACKAGE__->new(content => $_[0]); diff --git a/lib/LaTeX/TikZ/Mod/Width.pm b/lib/LaTeX/TikZ/Mod/Width.pm index bc6ad70..345b357 100644 --- a/lib/LaTeX/TikZ/Mod/Width.pm +++ b/lib/LaTeX/TikZ/Mod/Width.pm @@ -35,7 +35,7 @@ sub declare { } sub apply { sprintf 'line width=%0.1fpt', $_[1]->thickness($_[0]->width) } -use LaTeX::TikZ::API width => sub { +use LaTeX::TikZ::Interface width => sub { shift; __PACKAGE__->new(width => $_[0]); diff --git a/lib/LaTeX/TikZ/Set/Circle.pm b/lib/LaTeX/TikZ/Set/Circle.pm index c3a0ec0..b1d83b8 100644 --- a/lib/LaTeX/TikZ/Set/Circle.pm +++ b/lib/LaTeX/TikZ/Set/Circle.pm @@ -46,7 +46,7 @@ sub path { $set->center->path(@_) . ' circle (' . $tikz->len($set->radius) . ')'; } -use LaTeX::TikZ::API circle => sub { +use LaTeX::TikZ::Interface circle => sub { shift; __PACKAGE__->new(center => $_[0], radius => $_[1]); diff --git a/lib/LaTeX/TikZ/Set/Line.pm b/lib/LaTeX/TikZ/Set/Line.pm index 238e1f7..6e73e38 100644 --- a/lib/LaTeX/TikZ/Set/Line.pm +++ b/lib/LaTeX/TikZ/Set/Line.pm @@ -37,7 +37,7 @@ sub path { $set->from->path(@_) . ' -- ' . $set->to->path(@_); } -use LaTeX::TikZ::API line => sub { +use LaTeX::TikZ::Interface line => sub { shift; __PACKAGE__->new(from => $_[0], to => $_[1]); diff --git a/lib/LaTeX/TikZ/Set/Path.pm b/lib/LaTeX/TikZ/Set/Path.pm index 0b695c6..18b9020 100644 --- a/lib/LaTeX/TikZ/Set/Path.pm +++ b/lib/LaTeX/TikZ/Set/Path.pm @@ -55,7 +55,7 @@ sub path { join ' ', map $_->path(@_), $set->ops; } -use LaTeX::TikZ::API path => sub { +use LaTeX::TikZ::Interface path => sub { shift; __PACKAGE__->new(ops => \@_); diff --git a/lib/LaTeX/TikZ/Set/Point.pm b/lib/LaTeX/TikZ/Set/Point.pm index 85c35cf..2c613d8 100644 --- a/lib/LaTeX/TikZ/Set/Point.pm +++ b/lib/LaTeX/TikZ/Set/Point.pm @@ -33,7 +33,7 @@ sub path { '(' . $tikz->len($p->Re) . ',' . $tikz->len($p->Im) . ')'; } -use LaTeX::TikZ::API point => sub { +use LaTeX::TikZ::Interface point => sub { shift; __PACKAGE__->new(point => $_[0]); diff --git a/lib/LaTeX/TikZ/Set/Raw.pm b/lib/LaTeX/TikZ/Set/Raw.pm index 66784ea..169569f 100644 --- a/lib/LaTeX/TikZ/Set/Raw.pm +++ b/lib/LaTeX/TikZ/Set/Raw.pm @@ -27,7 +27,7 @@ has 'content' => ( sub path { $_[0]->content } -use LaTeX::TikZ::API raw => sub { +use LaTeX::TikZ::Interface raw => sub { shift; __PACKAGE__->new(content => join ' ', @_); diff --git a/lib/LaTeX/TikZ/Set/Rectangle.pm b/lib/LaTeX/TikZ/Set/Rectangle.pm index 0c35c9d..88af295 100644 --- a/lib/LaTeX/TikZ/Set/Rectangle.pm +++ b/lib/LaTeX/TikZ/Set/Rectangle.pm @@ -77,7 +77,7 @@ Attributes 'width' and 'height' are required when 'to' was not given $class->$orig(@_); }; -use LaTeX::TikZ::API rectangle => sub { +use LaTeX::TikZ::Interface rectangle => sub { shift; my ($p, $q) = @_; diff --git a/lib/LaTeX/TikZ/Set/Sequence.pm b/lib/LaTeX/TikZ/Set/Sequence.pm index a430fe5..fe32f14 100644 --- a/lib/LaTeX/TikZ/Set/Sequence.pm +++ b/lib/LaTeX/TikZ/Set/Sequence.pm @@ -64,7 +64,7 @@ sub draw { $set->kids; } -use LaTeX::TikZ::API seq => sub { +use LaTeX::TikZ::Interface seq => sub { shift; __PACKAGE__->new(kids => \@_); diff --git a/t/00-load.t b/t/00-load.t index 2825ca7..301e307 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -7,8 +7,8 @@ use Test::More tests => 27; BEGIN { use_ok( 'LaTeX::TikZ' ); - use_ok( 'LaTeX::TikZ::API' ); use_ok( 'LaTeX::TikZ::Formatter' ); + use_ok( 'LaTeX::TikZ::Interface' ); use_ok( 'LaTeX::TikZ::Mod' ); use_ok( 'LaTeX::TikZ::Mod::Clip' ); use_ok( 'LaTeX::TikZ::Mod::Color' ); diff --git a/t/01-api.t b/t/01-api.t index 6bcada7..7a29a36 100644 --- a/t/01-api.t +++ b/t/01-api.t @@ -41,11 +41,11 @@ for (@methods) { ok(Tikz->can($_), "Tikz evaluates to something that ->can($_)"); } -require LaTeX::TikZ::API; +require LaTeX::TikZ::Interface; for my $name (undef, ':)') { eval { - LaTeX::TikZ::API->import( + LaTeX::TikZ::Interface->import( $name => sub { }, ); }; @@ -53,7 +53,7 @@ for my $name (undef, ':)') { } eval { - LaTeX::TikZ::API->import( + LaTeX::TikZ::Interface->import( 'raw' => sub { }, ); }; @@ -61,7 +61,7 @@ like $@, qr/^'raw' is already defined/, 'already defined'; for my $code (undef, [ ]) { eval { - LaTeX::TikZ::API->import( + LaTeX::TikZ::Interface->import( 'foo' => $code, ); }; @@ -69,7 +69,7 @@ for my $code (undef, [ ]) { } eval { - LaTeX::TikZ::API->import( + LaTeX::TikZ::Interface->import( 'foo' => sub { @_ }, ); }; @@ -78,7 +78,7 @@ ok(Tikz->can('foo'), 'Tikz evaluates to something that ->can(foo)'); is_deeply [ Tikz->foo('hello') ], [ Tikz, 'hello' ], 'Tikz->foo works'; eval { - LaTeX::TikZ::API->import( + LaTeX::TikZ::Interface->import( 'bar' => sub { @_ }, 'baz' => undef, );