[Bps-public-commit] Symbol-Global-Name branch, master, updated. 0.02-2-g8e53a06

Ruslan Zakirov ruz at bestpractical.com
Thu Mar 14 12:05:34 EDT 2013


The branch, master has been updated
       via  8e53a066bf8e0d910ae43e41a14158349584ccbc (commit)
       via  f137a840a20ab768e3f7737f0774486018d1d7d4 (commit)
      from  a060aa15061a87333b04121cd93e2ad176352060 (commit)

Summary of changes:
 Changes                   | 3 +++
 META.yml                  | 2 +-
 lib/Symbol/Global/Name.pm | 4 ++--
 t/basics.t                | 9 ++++++++-
 4 files changed, 14 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit f137a840a20ab768e3f7737f0774486018d1d7d4
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Mar 14 20:02:11 2013 +0400

    fix nesting
    
    module couldn't find $Foo::Bar::baz, it was not problem for our
    use case, so we didn't notice

diff --git a/Changes b/Changes
index 596c563..a16d303 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+0.03
+    • Correctly nest into subpackages
+
 0.02    Thu Dec  6 14:54:06 PST 2012
     • Correctly find names when the value is a reference, such as regex
 
diff --git a/lib/Symbol/Global/Name.pm b/lib/Symbol/Global/Name.pm
index 89a2c82..0b4f6e0 100644
--- a/lib/Symbol/Global/Name.pm
+++ b/lib/Symbol/Global/Name.pm
@@ -84,7 +84,7 @@ sub _find {
         # if the entry has a trailing '::' then
         # it is a link to another name space
         if ( substr( $k, -2 ) eq '::') {
-            $name = $self->_find( $ref, $k );
+            $name = $self->_find( $ref, $pack eq 'main::'? $k : $pack.$k );
             return $name if $name;
         }
 
diff --git a/t/basics.t b/t/basics.t
index 8bac196..f7daee0 100644
--- a/t/basics.t
+++ b/t/basics.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 5;
+use Test::More tests => 6;
 
 {
     package My;
@@ -21,9 +21,16 @@ use Test::More tests => 5;
     $res{'regex'} = Symbol::Global::Name->find( \$regex );
 }
 
+{
+    package Foo::Bar;
+    our $baz = 'x';
+}
+
 package main;
 is($My::res{'scalar'}, '$My::VERSION', 'found name');
 is($My::res{'sub'}, '&My::foo', 'found name');
 is($My::res{'array'}, '@My::ISA', 'found name');
 is($My::res{'hash'}, '%main::ENV', 'found name');
 is($My::res{'regex'}, '$My::regex', 'found name');
+
+is(Symbol::Global::Name->find(\$Foo::Bar::baz), '$Foo::Bar::baz', 'found name');

commit 8e53a066bf8e0d910ae43e41a14158349584ccbc
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Mar 14 20:04:44 2013 +0400

    bump version, 0.03

diff --git a/Changes b/Changes
index a16d303..805186a 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,4 @@
-0.03
+0.03    Thu Mar 14 20:04:23 MSK 2013
     • Correctly nest into subpackages
 
 0.02    Thu Dec  6 14:54:06 PST 2012
diff --git a/META.yml b/META.yml
index 89243e5..0722a96 100644
--- a/META.yml
+++ b/META.yml
@@ -23,4 +23,4 @@ requires:
   perl: 5.8.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.02
+version: 0.03
diff --git a/lib/Symbol/Global/Name.pm b/lib/Symbol/Global/Name.pm
index 0b4f6e0..864b2e7 100644
--- a/lib/Symbol/Global/Name.pm
+++ b/lib/Symbol/Global/Name.pm
@@ -4,7 +4,7 @@ use warnings;
 
 package Symbol::Global::Name;
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 =head1 NAME
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list