Skip to content

Commit

Permalink
Rename to signatures.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafl committed Nov 9, 2008
1 parent 7cac7d6 commit 71b53a8
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .gitignore
@@ -1,8 +1,8 @@
.*
!.gitignore
Signature.*
!Signature.xs
!Signature.pm
signatures.*
!signatures.xs
!signatures.pm
Makefile*
!Makefile.PL
META.yml
Expand All @@ -14,4 +14,4 @@ MANIFEST*
!MANIFEST.SKIP
Debian*
README
Sub-Signature-*
signatures-*
2 changes: 1 addition & 1 deletion MANIFEST.SKIP
Expand Up @@ -5,4 +5,4 @@ blib\b
^Makefile$
^Makefile.old$
^Debian
^Sub-Signature-
^signature-
10 changes: 5 additions & 5 deletions Makefile.PL
Expand Up @@ -3,8 +3,8 @@ use warnings;
use inc::Module::Install;
use ExtUtils::Depends;

name 'Sub-Signature';
all_from 'lib/Sub/Signature.pm';
name 'signatures';
all_from 'lib/signatures.pm';

requires 'B::Hooks::OP::Check' => '0.11';
requires 'B::Hooks::Parser' => '0.06';
Expand All @@ -16,9 +16,9 @@ configure_requires 'ExtUtils::Depends';
configure_requires 'B::Hooks::OP::Check' => '0.11';
configure_requires 'B::Hooks::Parser' => '0.06';

my $pkg = ExtUtils::Depends->new('Sub::Signature', 'B::Hooks::OP::Check', 'B::Hooks::Parser');
$pkg->add_xs('Signature.xs');
$pkg->add_pm('lib/Sub/Signature.pm' => '$(INST_LIB)/Sub/Signature.pm');
my $pkg = ExtUtils::Depends->new('signatures', 'B::Hooks::OP::Check', 'B::Hooks::Parser');
$pkg->add_xs('signatures.xs');
$pkg->add_pm('lib/signatures.pm' => '$(INST_LIB)/signatures.pm');

makemaker_args($pkg->get_makefile_vars);

Expand Down
6 changes: 3 additions & 3 deletions lib/Sub/Signature.pm → lib/signatures.pm
@@ -1,7 +1,7 @@
use strict;
use warnings;

package Sub::Signature;
package signatures;

use XSLoader;
use B::Hooks::Parser;
Expand Down Expand Up @@ -93,11 +93,11 @@ __END__
=head1 NAME
Sub::Signature - subroutine signatures with no source filter
signatures - subroutine signatures with no source filter
=head1 SYNOPSIS
use Sub::Signature;
use signatures;
sub foo ($bar, $baz) {
return $bar + $baz;
Expand Down
2 changes: 1 addition & 1 deletion Signature.xs → signatures.xs
Expand Up @@ -296,7 +296,7 @@ handle_eval (pTHX_ OP *op, void *user_data) {
return op;
}

MODULE = Sub::Signature PACKAGE = Sub::Signature
MODULE = signatures PACKAGE = signatures

PROTOTYPES: DISABLE

Expand Down
2 changes: 1 addition & 1 deletion t/anon.t
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use Test::More tests => 1;

use Sub::Signature;
use signatures;

my $foo = sub ($bar, $baz) { return "${bar}-${baz}" };

Expand Down
2 changes: 1 addition & 1 deletion t/basic.t
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use Test::More tests => 5;

use Sub::Signature;
use signatures;

sub foo ($bar) { $bar }

Expand Down
6 changes: 3 additions & 3 deletions t/eval.t
Expand Up @@ -2,22 +2,22 @@ use strict;
use warnings;
use Test::More tests => 8;

use Sub::Signature;
use signatures;

eval 'sub foo ($bar) { $bar }';
ok(!$@, 'signatures parse in eval');
diag $@ if $@;
ok(\&foo, 'sub declared in eval');
is(foo(42), 42, 'eval signature works');

no Sub::Signature;
no signatures;

$SIG{__WARN__} = sub {};
eval 'sub bar ($baz) { $baz }';
like($@, qr/requires explicit package name/, 'string eval disabled');

{
use Sub::Signature;
use signatures;

eval 'sub bar ($baz) { $baz }';
ok(!$@, 'signatures parse in eval');
Expand Down
2 changes: 1 addition & 1 deletion t/proto.t
Expand Up @@ -7,7 +7,7 @@ BEGIN { $SIG{__WARN__} = sub { push @warnings, @_ } }

BEGIN { is(@warnings, 0, 'no warnings yet') }

use Sub::Signature;
use signatures;

sub with_proto ($x, $y, $z) : proto($$$) {
return $x + $y + $z;
Expand Down
4 changes: 2 additions & 2 deletions t/subclass.t
Expand Up @@ -5,9 +5,9 @@ use Test::More tests => 1;
{
package CustomSignature;

use base qw/Sub::Signature/;
use base qw/signatures/;

use Sub::Signature;
use signatures;

sub proto_unwrap ($class, $prototype) {
return "my (\$prototype) = '$prototype';";
Expand Down
10 changes: 5 additions & 5 deletions t/warnings.t
Expand Up @@ -7,23 +7,23 @@ use vars qw/@warnings/;
BEGIN { $SIG{__WARN__} = sub { push @warnings, $_ } }

{
use Sub::Signature;
use signatures;
sub foo ($x) { }
}

BEGIN { is(@warnings, 0, 'no prototype warnings with Sub::Signature in scope') }
BEGIN { is(@warnings, 0, 'no prototype warnings with signatures in scope') }

sub bar ($x) { }

BEGIN { is(@warnings, 1, 'warning without Sub::Signature in scope') }
BEGIN { is(@warnings, 1, 'warning without signatures in scope') }

use Sub::Signature;
use signatures;

sub baz ($x) { }

BEGIN { is(@warnings, 1, 'no more warnings') }

no Sub::Signature;
no signatures;

sub corge ($x) { }

Expand Down
2 changes: 1 addition & 1 deletion t/weird.t
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use Test::More tests => 2;

use Sub::Signature;
use signatures;

sub
foo
Expand Down

0 comments on commit 71b53a8

Please sign in to comment.