[Bps-public-commit] r9555 - CSS-Squish/lib/CSS

ruz at bestpractical.com ruz at bestpractical.com
Mon Nov 5 12:16:44 EST 2007


Author: ruz
Date: Mon Nov  5 12:16:44 2007
New Revision: 9555

Modified:
   CSS-Squish/lib/CSS/Squish.pm

Log:
* store roots in the object if it's object

Modified: CSS-Squish/lib/CSS/Squish.pm
==============================================================================
--- CSS-Squish/lib/CSS/Squish.pm	(original)
+++ CSS-Squish/lib/CSS/Squish.pm	Mon Nov  5 12:16:44 2007
@@ -10,6 +10,7 @@
 $CSS::Squish::DEBUG   = 0;
 
 use File::Spec;
+use Scalar::Util qw(blessed);
 
 =head1 NAME
 
@@ -201,9 +202,16 @@
 
 sub roots {
     my $self = shift;
-    @ROOTS = @_ if @_;
-    $self->_debug("Roots are: '", join( "', '", @ROOTS ), "'");
-    return @ROOTS;
+    my @res;
+    unless ( blessed $self ) {
+        @ROOTS = @_ if @_;
+        @res = @ROOTS;
+    } else {
+        $self->{'roots'} = [ grep defined, @_ ] if @_;
+        @res = @{ $self->{'roots'} };
+    }
+    $self->_debug("Roots are: ". join ", ", map "'$_'", @res);
+    return @res;
 }
 
 sub _resolve_file {



More information about the Bps-public-commit mailing list