summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Changes24
-rw-r--r--dist.ini7
-rw-r--r--lib/Package/Stash.pm78
-rw-r--r--t/000-load.t8
-rw-r--r--t/01-basic.t (renamed from t/001-basic.t)0
-rw-r--r--t/02-extension.t (renamed from t/002-extension.t)0
-rw-r--r--t/03-io.t (renamed from t/003-io.t)0
-rw-r--r--t/04-get.t (renamed from t/004-get.t)0
-rw-r--r--t/05-isa.t (renamed from t/005-isa.t)0
-rw-r--r--t/06-addsub.t (renamed from t/006-addsub.t)0
-rw-r--r--t/10-synopsis.t (renamed from t/010-synopsis.t)0
-rw-r--r--weaver.ini37
13 files changed, 69 insertions, 87 deletions
diff --git a/.gitignore b/.gitignore
index c38068c..a2bd8da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,5 @@ Makefile.old
nytprof.out
MANIFEST.bak
*.sw[po]
+.build
+Package-Stash-*
diff --git a/Changes b/Changes
index ae17172..5844fde 100644
--- a/Changes
+++ b/Changes
@@ -1,16 +1,18 @@
-Revision history for Package::Stash
+Revision history for Package-Stash
-0.04 2010-06-13
- get_package_symbol now doesn't autovivify stash entries. A new method
- get_or_add_package_symbol can now be used for that behavior.
+{{$NEXT}}
- Update %DB::sub on add_package_symbol (Tim Bunce).
+0.04 2010-06-13
+ - get_package_symbol now doesn't autovivify stash entries. A new method
+ get_or_add_package_symbol can now be used for that behavior.
-0.03 2010-05-14
- Rename from Stash::Manip to Package::Stash
+ - Update %DB::sub on add_package_symbol (Tim Bunce).
-0.02 2010-05-13
- Need to dep on Test::Exception
+0.03 2010-05-14
+ - Rename from Stash::Manip to Package::Stash
-0.01 2010-05-12
- Initial release
+0.02 2010-05-13
+ - Need to dep on Test::Exception
+
+0.01 2010-05-12
+ - Initial release
diff --git a/dist.ini b/dist.ini
index aad335c..f4aed77 100644
--- a/dist.ini
+++ b/dist.ini
@@ -1,13 +1,14 @@
name = Package-Stash
-version = 0.04
author = Jesse Luehrs <doy at tozt dot net>
license = Perl_5
copyright_holder = Jesse Luehrs
-abstract = routines for manipulating stashes
-[@Classic]
+[@DOY]
+dist = Package-Stash
[Prereq]
Scalar::Util = 0
+
+[Prereq / TestRequires]
Test::Exception = 0
Test::More = 0.88
diff --git a/lib/Package/Stash.pm b/lib/Package/Stash.pm
index 6396ed5..ddc158b 100644
--- a/lib/Package/Stash.pm
+++ b/lib/Package/Stash.pm
@@ -1,14 +1,11 @@
package Package::Stash;
use strict;
use warnings;
+# ABSTRACT: routines for manipulating stashes
use Carp qw(confess);
use Scalar::Util qw(reftype);
-=head1 NAME
-
-Package::Stash - routines for manipulating stashes
-
=head1 SYNOPSIS
my $stash = Package::Stash->new('Foo');
@@ -27,11 +24,7 @@ simple API.
NOTE: Most methods in this class require a variable specification that includes
a sigil. If this sigil is absent, it is assumed to represent the IO slot.
-=head1 METHODS
-
-=cut
-
-=head2 new $package_name
+=method new $package_name
Creates a new C<Package::Stash> object, for the package given as the only
argument.
@@ -44,7 +37,7 @@ sub new {
return bless { 'package' => $namespace }, $class;
}
-=head2 name
+=method name
Returns the name of the package that this object represents.
@@ -54,7 +47,7 @@ sub name {
return $_[0]->{package};
}
-=head2 namespace
+=method namespace
Returns the raw stash itself.
@@ -98,7 +91,7 @@ sub namespace {
}
}
-=head2 add_package_symbol $variable $value %opts
+=method add_package_symbol $variable $value %opts
Adds a new package symbol, for the symbol given as C<$variable>, and optionally
gives it an initial value of C<$value>. C<$variable> should be the name of
@@ -172,7 +165,7 @@ sub add_package_symbol {
*{$pkg . '::' . $name} = ref $initial_value ? $initial_value : \$initial_value;
}
-=head2 remove_package_glob $name
+=method remove_package_glob $name
Removes all package variables with the given name, regardless of sigil.
@@ -186,7 +179,7 @@ sub remove_package_glob {
# ... these functions deal with stuff on the namespace level
-=head2 has_package_symbol $variable
+=method has_package_symbol $variable
Returns whether or not the given package variable (including sigil) exists.
@@ -219,7 +212,7 @@ sub has_package_symbol {
}
}
-=head2 get_package_symbol $variable
+=method get_package_symbol $variable
Returns the value of the given package variable (including sigil).
@@ -269,7 +262,7 @@ sub get_package_symbol {
}
}
-=head2 get_or_add_package_symbol $variable
+=method get_or_add_package_symbol $variable
Like C<get_package_symbol>, except that it will return an empty hashref or
arrayref if the variable doesn't exist.
@@ -281,7 +274,7 @@ sub get_or_add_package_symbol {
$self->get_package_symbol(@_, vivify => 1);
}
-=head2 remove_package_symbol $variable
+=method remove_package_symbol $variable
Removes the package variable described by C<$variable> (which includes the
sigil); other variables with the same name but different sigils will be
@@ -352,7 +345,7 @@ sub remove_package_symbol {
$self->add_package_symbol($io_desc => $io) if defined $io;
}
-=head2 list_all_package_symbols $type_filter
+=method list_all_package_symbols $type_filter
Returns a list of package variable names in the package, without sigils. If a
C<type_filter> is passed, it is used to select package variables of a given
@@ -382,61 +375,16 @@ sub list_all_package_symbols {
}
}
-=head1 BUGS
-
-No known bugs.
-
-Please report any bugs through RT: email
-C<bug-package-stash at rt.cpan.org>, or browse to
-L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Package-Stash>.
-
=head1 SEE ALSO
-L<Class::MOP::Package> - this module is a factoring out of code that used to
-live here
-
-=head1 SUPPORT
-
-You can find this documentation for this module with the perldoc command.
-
- perldoc Package::Stash
-
-You can also look for information at:
-
=over 4
-=item * AnnoCPAN: Annotated CPAN documentation
+=item * L<Class::MOP::Package>
-L<http://annocpan.org/dist/Package-Stash>
-
-=item * CPAN Ratings
-
-L<http://cpanratings.perl.org/d/Package-Stash>
-
-=item * RT: CPAN's request tracker
-
-L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Package-Stash>
-
-=item * Search CPAN
-
-L<http://search.cpan.org/dist/Package-Stash>
+This module is a factoring out of code that used to live here
=back
-=head1 AUTHOR
-
- Jesse Luehrs <doy at tozt dot net>
-
-Mostly copied from code from L<Class::MOP::Package>, by Stevan Little and the
-Moose Cabal.
-
-=head1 COPYRIGHT AND LICENSE
-
-This software is copyright (c) 2010 by Jesse Luehrs.
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as perl itself.
-
=cut
1;
diff --git a/t/000-load.t b/t/000-load.t
deleted file mode 100644
index 0420fe7..0000000
--- a/t/000-load.t
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-use Test::More tests => 1;
-
-package Foo;
-::use_ok('Package::Stash')
- or ::BAIL_OUT("couldn't load Package::Stash");
diff --git a/t/001-basic.t b/t/01-basic.t
index efd82b4..efd82b4 100644
--- a/t/001-basic.t
+++ b/t/01-basic.t
diff --git a/t/002-extension.t b/t/02-extension.t
index 2f95f15..2f95f15 100644
--- a/t/002-extension.t
+++ b/t/02-extension.t
diff --git a/t/003-io.t b/t/03-io.t
index 43a7dd8..43a7dd8 100644
--- a/t/003-io.t
+++ b/t/03-io.t
diff --git a/t/004-get.t b/t/04-get.t
index ebeb864..ebeb864 100644
--- a/t/004-get.t
+++ b/t/04-get.t
diff --git a/t/005-isa.t b/t/05-isa.t
index 3198fb1..3198fb1 100644
--- a/t/005-isa.t
+++ b/t/05-isa.t
diff --git a/t/006-addsub.t b/t/06-addsub.t
index 3c0dfc8..3c0dfc8 100644
--- a/t/006-addsub.t
+++ b/t/06-addsub.t
diff --git a/t/010-synopsis.t b/t/10-synopsis.t
index 4c93f32..4c93f32 100644
--- a/t/010-synopsis.t
+++ b/t/10-synopsis.t
diff --git a/weaver.ini b/weaver.ini
new file mode 100644
index 0000000..31f851b
--- /dev/null
+++ b/weaver.ini
@@ -0,0 +1,37 @@
+[@CorePrep]
+
+[Name]
+[Version]
+
+[Region / prelude]
+
+[Generic / SYNOPSIS]
+[Generic / DESCRIPTION]
+[Generic / OVERVIEW]
+
+[Collect / ATTRIBUTES]
+command = attr
+
+[Collect / METHODS]
+command = method
+
+[Collect / FUNCTIONS]
+command = func
+
+[Leftovers]
+
+[Region / postlude]
+
+[Template / BUGS]
+template = ~/.dzil/pod_templates/bugs.section
+main_module_only = 1
+
+[Generic / SEEALSO]
+header = SEE ALSO
+
+[Template / SUPPORT]
+template = ~/.dzil/pod_templates/support.section
+main_module_only = 1
+
+[Authors]
+[Legal]