r59491 - in /trunk/libpackage-stash-perl: ./ debian/ lib/Package/ t/

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Fri Jun 18 03:33:19 UTC 2010


Author: ansgar-guest
Date: Fri Jun 18 03:33:12 2010
New Revision: 59491

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59491
Log:
New upstream release.

Added:
    trunk/libpackage-stash-perl/META.json
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/META.json
    trunk/libpackage-stash-perl/t/00-compile.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/00-compile.t
    trunk/libpackage-stash-perl/t/01-basic.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/01-basic.t
    trunk/libpackage-stash-perl/t/02-extension.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/02-extension.t
    trunk/libpackage-stash-perl/t/03-io.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/03-io.t
    trunk/libpackage-stash-perl/t/04-get.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/04-get.t
    trunk/libpackage-stash-perl/t/05-isa.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/05-isa.t
    trunk/libpackage-stash-perl/t/06-addsub.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/06-addsub.t
    trunk/libpackage-stash-perl/t/10-synopsis.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/10-synopsis.t
    trunk/libpackage-stash-perl/t/release-eol.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/release-eol.t
    trunk/libpackage-stash-perl/t/release-no-tabs.t
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/t/release-no-tabs.t
    trunk/libpackage-stash-perl/weaver.ini
      - copied unchanged from r59490, branches/upstream/libpackage-stash-perl/current/weaver.ini
Removed:
    trunk/libpackage-stash-perl/t/000-load.t
    trunk/libpackage-stash-perl/t/001-basic.t
    trunk/libpackage-stash-perl/t/002-extension.t
    trunk/libpackage-stash-perl/t/003-io.t
    trunk/libpackage-stash-perl/t/004-get.t
    trunk/libpackage-stash-perl/t/005-isa.t
    trunk/libpackage-stash-perl/t/010-synopsis.t
Modified:
    trunk/libpackage-stash-perl/Changes
    trunk/libpackage-stash-perl/MANIFEST
    trunk/libpackage-stash-perl/META.yml
    trunk/libpackage-stash-perl/Makefile.PL
    trunk/libpackage-stash-perl/README
    trunk/libpackage-stash-perl/debian/changelog
    trunk/libpackage-stash-perl/dist.ini
    trunk/libpackage-stash-perl/lib/Package/Stash.pm
    trunk/libpackage-stash-perl/t/release-pod-coverage.t
    trunk/libpackage-stash-perl/t/release-pod-syntax.t

Modified: trunk/libpackage-stash-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/Changes?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/Changes (original)
+++ trunk/libpackage-stash-perl/Changes Fri Jun 18 03:33:12 2010
@@ -1,10 +1,21 @@
-Revision history for Package::Stash
+Revision history for Package-Stash
 
-0.03    2010-05-14
-    Rename from Stash::Manip to Package::Stash
+0.05  2010-06-15
+      - bump Test::More requirement for done_testing
 
-0.02    2010-05-13
-    Need to dep on Test::Exception
+      - update packaging stuff
 
-0.01    2010-05-12
-    Initial release
+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.
+
+      - Update %DB::sub on add_package_symbol (Tim Bunce).
+
+0.03  2010-05-14
+      - Rename from Stash::Manip to Package::Stash
+
+0.02  2010-05-13
+      - Need to dep on Test::Exception
+
+0.01  2010-05-12
+      - Initial release

Modified: trunk/libpackage-stash-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/MANIFEST?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/MANIFEST (original)
+++ trunk/libpackage-stash-perl/MANIFEST Fri Jun 18 03:33:12 2010
@@ -1,17 +1,22 @@
 Changes
 LICENSE
 MANIFEST
+META.json
 META.yml
 Makefile.PL
 README
 dist.ini
 lib/Package/Stash.pm
-t/000-load.t
-t/001-basic.t
-t/002-extension.t
-t/003-io.t
-t/004-get.t
-t/005-isa.t
-t/010-synopsis.t
+t/00-compile.t
+t/01-basic.t
+t/02-extension.t
+t/03-io.t
+t/04-get.t
+t/05-isa.t
+t/06-addsub.t
+t/10-synopsis.t
+t/release-eol.t
+t/release-no-tabs.t
 t/release-pod-coverage.t
-t/release-pod-syntax.t
+t/release-pod-syntax.t
+weaver.ini

Modified: trunk/libpackage-stash-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/META.yml?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/META.yml (original)
+++ trunk/libpackage-stash-perl/META.yml Fri Jun 18 03:33:12 2010
@@ -2,17 +2,175 @@
 abstract: 'routines for manipulating stashes'
 author:
   - 'Jesse Luehrs <doy at tozt dot net>'
-build_requires: {}
+build_requires:
+  Test::Exception: 0
+  Test::More: 0.88
 configure_requires:
   ExtUtils::MakeMaker: 6.31
-generated_by: 'Dist::Zilla version 2.101241'
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 4.101612, CPAN::Meta::Converter version 2.101610'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
   version: 1.4
 name: Package-Stash
-recommends: {}
 requires:
   Scalar::Util: 0
-  Test::Exception: 0
-version: 0.03
+resources:
+  repository: git://github.com/doy/package-stash.git
+version: 0.05
+x_Dist_Zilla:
+  plugins:
+    -
+      class: Dist::Zilla::Plugin::GatherDir
+      name: '@DOY/@Basic/GatherDir'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::PruneCruft
+      name: '@DOY/@Basic/PruneCruft'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::ManifestSkip
+      name: '@DOY/@Basic/ManifestSkip'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::MetaYAML
+      name: '@DOY/@Basic/MetaYAML'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::License
+      name: '@DOY/@Basic/License'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::Readme
+      name: '@DOY/@Basic/Readme'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::ExtraTests
+      name: '@DOY/@Basic/ExtraTests'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::ExecDir
+      name: '@DOY/@Basic/ExecDir'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::ShareDir
+      name: '@DOY/@Basic/ShareDir'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::MakeMaker
+      name: '@DOY/@Basic/MakeMaker'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::Manifest
+      name: '@DOY/@Basic/Manifest'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::TestRelease
+      name: '@DOY/@Basic/TestRelease'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::ConfirmRelease
+      name: '@DOY/@Basic/ConfirmRelease'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::UploadToCPAN
+      name: '@DOY/@Basic/UploadToCPAN'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::MetaConfig
+      name: '@DOY/MetaConfig'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::MetaJSON
+      name: '@DOY/MetaJSON'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::NextRelease
+      name: '@DOY/NextRelease'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::CheckChangesHasContent
+      name: '@DOY/CheckChangesHasContent'
+      version: 0.003
+    -
+      class: Dist::Zilla::Plugin::PkgVersion
+      name: '@DOY/PkgVersion'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::PodCoverageTests
+      name: '@DOY/PodCoverageTests'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::PodSyntaxTests
+      name: '@DOY/PodSyntaxTests'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::NoTabsTests
+      name: '@DOY/NoTabsTests'
+      version: 0.01
+    -
+      class: Dist::Zilla::Plugin::EOLTests
+      name: '@DOY/EOLTests'
+      version: 0.02
+    -
+      class: Dist::Zilla::Plugin::CompileTests
+      name: '@DOY/CompileTests'
+      version: 1.101600
+    -
+      class: Dist::Zilla::Plugin::Repository
+      name: '@DOY/Repository'
+      version: 0.13
+    -
+      class: Dist::Zilla::Plugin::Git::Check
+      name: '@DOY/Git::Check'
+      version: 1.101650
+    -
+      class: Dist::Zilla::Plugin::Git::Tag
+      name: '@DOY/Git::Tag'
+      version: 1.101650
+    -
+      class: Dist::Zilla::Plugin::BumpVersionFromGit
+      name: '@DOY/BumpVersionFromGit'
+      version: 0.006
+    -
+      class: Dist::Zilla::Plugin::PodWeaver
+      name: '@DOY/PodWeaver'
+      version: 3.101530
+    -
+      class: Dist::Zilla::Plugin::Prereq
+      config:
+        Dist::Zilla::Plugin::Prereq:
+          phase: runtime
+          type: requires
+      name: Prereq
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::Prereq
+      config:
+        Dist::Zilla::Plugin::Prereq:
+          phase: test
+          type: requires
+      name: TestRequires
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::FinderCode
+      name: ':InstallModules'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::FinderCode
+      name: ':TestFiles'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::FinderCode
+      name: ':ExecFiles'
+      version: 4.101612
+    -
+      class: Dist::Zilla::Plugin::FinderCode
+      name: ':ShareFiles'
+      version: 4.101612
+  zilla:
+    class: Dist::Zilla
+    config:
+      is_trial: 0
+    version: 4.101612

Modified: trunk/libpackage-stash-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/Makefile.PL?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/Makefile.PL (original)
+++ trunk/libpackage-stash-perl/Makefile.PL Fri Jun 18 03:33:12 2010
@@ -11,7 +11,10 @@
 my %WriteMakefileArgs = (
   'ABSTRACT' => 'routines for manipulating stashes',
   'AUTHOR' => 'Jesse Luehrs <doy at tozt dot net>',
-  'BUILD_REQUIRES' => {},
+  'BUILD_REQUIRES' => {
+    'Test::Exception' => '0',
+    'Test::More' => '0.88'
+  },
   'CONFIGURE_REQUIRES' => {
     'ExtUtils::MakeMaker' => '6.31'
   },
@@ -20,10 +23,9 @@
   'LICENSE' => 'perl',
   'NAME' => 'Package::Stash',
   'PREREQ_PM' => {
-    'Scalar::Util' => '0',
-    'Test::Exception' => '0'
+    'Scalar::Util' => '0'
   },
-  'VERSION' => '0.03',
+  'VERSION' => '0.05',
   'test' => {
     'TESTS' => 't/*.t'
   }
@@ -32,10 +34,10 @@
 
 unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
   my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
-  my $pp = $WriteMakefileArgs{PREREQ_PM}; 
+  my $pp = $WriteMakefileArgs{PREREQ_PM};
   for my $mod ( keys %$br ) {
     if ( exists $pp->{$mod} ) {
-      $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; 
+      $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
     }
     else {
       $pp->{$mod} = $br->{$mod};

Modified: trunk/libpackage-stash-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/README?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/README (original)
+++ trunk/libpackage-stash-perl/README Fri Jun 18 03:33:12 2010
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution Package-Stash,
-version 0.03:
+version 0.05:
 
   routines for manipulating stashes
 

Modified: trunk/libpackage-stash-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/debian/changelog?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/debian/changelog (original)
+++ trunk/libpackage-stash-perl/debian/changelog Fri Jun 18 03:33:12 2010
@@ -1,3 +1,9 @@
+libpackage-stash-perl (0.05-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org>  Fri, 18 Jun 2010 12:32:00 +0900
+
 libpackage-stash-perl (0.03-1) unstable; urgency=low
 
   * Initial Release. (Closes: #584729)

Modified: trunk/libpackage-stash-perl/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/dist.ini?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/dist.ini (original)
+++ trunk/libpackage-stash-perl/dist.ini Fri Jun 18 03:33:12 2010
@@ -1,12 +1,14 @@
 name = Package-Stash
-version = 0.03
 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

Modified: trunk/libpackage-stash-perl/lib/Package/Stash.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/lib/Package/Stash.pm?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/lib/Package/Stash.pm (original)
+++ trunk/libpackage-stash-perl/lib/Package/Stash.pm Fri Jun 18 03:33:12 2010
@@ -1,49 +1,14 @@
 package Package::Stash;
 BEGIN {
-  $Package::Stash::VERSION = '0.03';
+  $Package::Stash::VERSION = '0.05';
 }
 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 VERSION
-
-version 0.03
-
-=head1 SYNOPSIS
-
-  my $stash = Package::Stash->new('Foo');
-  $stash->add_package_symbol('%foo', {bar => 1});
-  # $Foo::foo{bar} == 1
-  $stash->has_package_symbol('$foo') # false
-  my $namespace = $stash->namespace;
-  *{ $namespace->{foo} }{HASH} # {bar => 1}
-
-=head1 DESCRIPTION
-
-Manipulating stashes (Perl's symbol tables) is occasionally necessary, but
-incredibly messy, and easy to get wrong. This module hides all of that behind a
-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
-
-Creates a new C<Package::Stash> object, for the package given as the only
-argument.
-
-=cut
 
 sub new {
     my $class = shift;
@@ -51,30 +16,20 @@
     return bless { 'package' => $namespace }, $class;
 }
 
-=head2 name
-
-Returns the name of the package that this object represents.
-
-=cut
 
 sub name {
     return $_[0]->{package};
 }
 
-=head2 namespace
-
-Returns the raw stash itself.
-
-=cut
 
 sub namespace {
     # NOTE:
-    # because of issues with the Perl API 
-    # to the typeglob in some versions, we 
-    # need to just always grab a new 
-    # reference to the hash here. Ideally 
+    # because of issues with the Perl API
+    # to the typeglob in some versions, we
+    # need to just always grab a new
+    # reference to the hash here. Ideally
     # we could just store a ref and it would
-    # Just Work, but oh well :\    
+    # Just Work, but oh well :\
     no strict 'refs';
     return \%{$_[0]->name . '::'};
 }
@@ -105,17 +60,6 @@
     }
 }
 
-=head2 add_package_symbol $variable $value
-
-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
-variable including the sigil, so
-
-  Package::Stash->new('Foo')->add_package_symbol('%foo')
-
-will create C<%Foo::foo>.
-
-=cut
 
 sub _valid_for_type {
     my $self = shift;
@@ -131,29 +75,38 @@
 }
 
 sub add_package_symbol {
-    my ($self, $variable, $initial_value) = @_;
+    my ($self, $variable, $initial_value, %opts) = @_;
 
     my ($name, $sigil, $type) = ref $variable eq 'HASH'
         ? @{$variable}{qw[name sigil type]}
         : $self->_deconstruct_variable_name($variable);
 
+    my $pkg = $self->name;
+
     if (@_ > 2) {
         $self->_valid_for_type($initial_value, $type)
             || confess "$initial_value is not of type $type";
-    }
-
-    my $pkg = $self->name;
+
+        # cheap fail-fast check for PERLDBf_SUBLINE and '&'
+        if ($^P and $^P & 0x10 && $sigil eq '&') {
+            my $filename = $opts{filename};
+            my $first_line_num = $opts{first_line_num};
+
+            (undef, $filename, $first_line_num) = caller
+                if not defined $filename;
+
+            my $last_line_num = $opts{last_line_num} || ($first_line_num ||= 0);
+
+            # http://perldoc.perl.org/perldebguts.html#Debugger-Internals
+            $DB::sub{$pkg . '::' . $name} = "$filename:$first_line_num-$last_line_num";
+        }
+    }
 
     no strict 'refs';
     no warnings 'redefine', 'misc', 'prototype';
     *{$pkg . '::' . $name} = ref $initial_value ? $initial_value : \$initial_value;
 }
 
-=head2 remove_package_glob $name
-
-Removes all package variables with the given name, regardless of sigil.
-
-=cut
 
 sub remove_package_glob {
     my ($self, $name) = @_;
@@ -163,11 +116,6 @@
 
 # ... these functions deal with stuff on the namespace level
 
-=head2 has_package_symbol $variable
-
-Returns whether or not the given package variable (including sigil) exists.
-
-=cut
 
 sub has_package_symbol {
     my ($self, $variable) = @_;
@@ -196,14 +144,9 @@
     }
 }
 
-=head2 get_package_symbol $variable
-
-Returns the value of the given package variable (including sigil).
-
-=cut
 
 sub get_package_symbol {
-    my ($self, $variable) = @_;
+    my ($self, $variable, %opts) = @_;
 
     my ($name, $sigil, $type) = ref $variable eq 'HASH'
         ? @{$variable}{qw[name sigil type]}
@@ -218,10 +161,10 @@
         # accessed... in the case of @ISA, this might never happen
         # for instance, assigning like that and then calling $obj->isa
         # will fail. see t/005-isa.t
-        if ($type eq 'ARRAY' && $name ne 'ISA') {
+        if ($opts{vivify} && $type eq 'ARRAY' && $name ne 'ISA') {
             $self->add_package_symbol($variable, []);
         }
-        elsif ($type eq 'HASH') {
+        elsif ($opts{vivify} && $type eq 'HASH') {
             $self->add_package_symbol($variable, {});
         }
         else {
@@ -246,13 +189,12 @@
     }
 }
 
-=head2 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
-untouched.
-
-=cut
+
+sub get_or_add_package_symbol {
+    my $self = shift;
+    $self->get_package_symbol(@_, vivify => 1);
+}
+
 
 sub remove_package_symbol {
     my ($self, $variable) = @_;
@@ -262,7 +204,7 @@
         : $self->_deconstruct_variable_name($variable);
 
     # FIXME:
-    # no doubt this is grossly inefficient and 
+    # no doubt this is grossly inefficient and
     # could be done much easier and faster in XS
 
     my ($scalar_desc, $array_desc, $hash_desc, $code_desc, $io_desc) = (
@@ -317,14 +259,6 @@
     $self->add_package_symbol($io_desc     => $io)     if defined $io;
 }
 
-=head2 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
-type, where valid types are the slots of a typeglob ('SCALAR', 'CODE', 'HASH',
-etc).
-
-=cut
 
 sub list_all_package_symbols {
     my ($self, $type_filter) = @_;
@@ -333,7 +267,7 @@
     return keys %{$namespace} unless defined $type_filter;
 
     # NOTE:
-    # or we can filter based on 
+    # or we can filter based on
     # type (SCALAR|ARRAY|HASH|CODE)
     if ($type_filter eq 'CODE') {
         return grep {
@@ -347,6 +281,109 @@
     }
 }
 
+
+1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Package::Stash - routines for manipulating stashes
+
+=head1 VERSION
+
+version 0.05
+
+=head1 SYNOPSIS
+
+  my $stash = Package::Stash->new('Foo');
+  $stash->add_package_symbol('%foo', {bar => 1});
+  # $Foo::foo{bar} == 1
+  $stash->has_package_symbol('$foo') # false
+  my $namespace = $stash->namespace;
+  *{ $namespace->{foo} }{HASH} # {bar => 1}
+
+=head1 DESCRIPTION
+
+Manipulating stashes (Perl's symbol tables) is occasionally necessary, but
+incredibly messy, and easy to get wrong. This module hides all of that behind a
+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
+
+=head2 new $package_name
+
+Creates a new C<Package::Stash> object, for the package given as the only
+argument.
+
+=head2 name
+
+Returns the name of the package that this object represents.
+
+=head2 namespace
+
+Returns the raw stash itself.
+
+=head2 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
+variable including the sigil, so
+
+  Package::Stash->new('Foo')->add_package_symbol('%foo')
+
+will create C<%Foo::foo>.
+
+Valid options (all optional) are C<filename>, C<first_line_num>, and
+C<last_line_num>.
+
+C<$opts{filename}>, C<$opts{first_line_num}>, and C<$opts{last_line_num}> can
+be used to indicate where the symbol should be regarded as having been defined.
+Currently these values are only used if the symbol is a subroutine ('C<&>'
+sigil) and only if C<$^P & 0x10> is true, in which case the special C<%DB::sub>
+hash is updated to record the values of C<filename>, C<first_line_num>, and
+C<last_line_num> for the subroutine. If these are not passed, their values are
+inferred (as much as possible) from C<caller> information.
+
+This is especially useful for debuggers and profilers, which use C<%DB::sub> to
+determine where the source code for a subroutine can be found.  See
+L<http://perldoc.perl.org/perldebguts.html#Debugger-Internals> for more
+information about C<%DB::sub>.
+
+=head2 remove_package_glob $name
+
+Removes all package variables with the given name, regardless of sigil.
+
+=head2 has_package_symbol $variable
+
+Returns whether or not the given package variable (including sigil) exists.
+
+=head2 get_package_symbol $variable
+
+Returns the value of the given package variable (including sigil).
+
+=head2 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.
+
+=head2 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
+untouched.
+
+=head2 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
+type, where valid types are the slots of a typeglob ('SCALAR', 'CODE', 'HASH',
+etc).
+
 =head1 BUGS
 
 No known bugs.
@@ -357,8 +394,13 @@
 
 =head1 SEE ALSO
 
-L<Class::MOP::Package> - this module is a factoring out of code that used to
-live here
+=over 4
+
+=item * L<Class::MOP::Package>
+
+This module is a factoring out of code that used to live here
+
+=back
 
 =head1 SUPPORT
 
@@ -392,16 +434,12 @@
 
   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.
+the same terms as the Perl 5 programming language system itself.
 
 =cut
 
-1;

Modified: trunk/libpackage-stash-perl/t/release-pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/t/release-pod-coverage.t?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/t/release-pod-coverage.t (original)
+++ trunk/libpackage-stash-perl/t/release-pod-coverage.t Fri Jun 18 03:33:12 2010
@@ -18,4 +18,4 @@
 plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
   if $@;
 
-all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
+all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });

Modified: trunk/libpackage-stash-perl/t/release-pod-syntax.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libpackage-stash-perl/t/release-pod-syntax.t?rev=59491&op=diff
==============================================================================
--- trunk/libpackage-stash-perl/t/release-pod-syntax.t (original)
+++ trunk/libpackage-stash-perl/t/release-pod-syntax.t Fri Jun 18 03:33:12 2010
@@ -12,4 +12,4 @@
 eval "use Test::Pod 1.41";
 plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
 
-all_pod_files_ok();
+all_pod_files_ok();




More information about the Pkg-perl-cvs-commits mailing list