gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog devtools/lib/Gnash/Distribution.pm


From: Ann Barcomb
Subject: [Gnash-commit] gnash ChangeLog devtools/lib/Gnash/Distribution.pm
Date: Wed, 11 Apr 2007 17:44:36 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Ann Barcomb <ann>       07/04/11 17:44:36

Modified files:
        .              : ChangeLog 
        devtools/lib/Gnash: Distribution.pm 

Log message:
        This changes the way in which Distribution calculates the project root
        (or, rather, allows it to be overridden and checked), which will 
hopefully
        prevent me from using the wrong directory when writing one-off scripts.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2851&r2=1.2852
http://cvs.savannah.gnu.org/viewcvs/gnash/devtools/lib/Gnash/Distribution.pm?cvsroot=gnash&r1=1.1&r2=1.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2851
retrieving revision 1.2852
diff -u -b -r1.2851 -r1.2852
--- ChangeLog   11 Apr 2007 17:10:12 -0000      1.2851
+++ ChangeLog   11 Apr 2007 17:44:35 -0000      1.2852
@@ -1,3 +1,9 @@
+2007-04-11 Ann Barcomb <address@hidden>
+
+       * devtools/lib/Gnash/Distribution.pm: made it more
+         difficult to mistakenly use the wrong root distribution
+         directory.
+
 2007-04-11 Sandro Santilli <address@hidden>
 
        * testsuite/actionscript.all/MovieClip.as: add some tests

Index: devtools/lib/Gnash/Distribution.pm
===================================================================
RCS file: /sources/gnash/gnash/devtools/lib/Gnash/Distribution.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- devtools/lib/Gnash/Distribution.pm  31 Jan 2007 02:54:59 -0000      1.1
+++ devtools/lib/Gnash/Distribution.pm  11 Apr 2007 17:44:35 -0000      1.2
@@ -11,20 +11,21 @@
 my $dist;
 
 sub new {
-    my( $class ) = @_;
+    my $class = shift;
 
     return $dist if defined $dist;
     my $self = bless {}, $class;
-    return $self->_initialize;
+    return $self->_initialize(@_);
 }
 
 {
     no warnings 'File::Find';
     my @found_files;
     sub _initialize {
-        my( $self ) = @_;
+        my $self = shift;
 
-        my $dist = $Bin.'/../..';
+        my $dist = $_[0] || $Bin.'/../..';
+        $self->{_distribution_root} = $dist; 
         _croak(undef, 
           "Failed to find distribution root; did you move the test directory?"
         ) unless (-d $dist);
@@ -53,6 +54,11 @@
 
 }
 
+sub distribution_root {
+    my $self = shift;
+    return $self->{_distribution_root};
+}
+
 sub _croak {
     my( $self, @message ) = @_;
     require Carp;
@@ -238,19 +244,32 @@
 
 In order to find files, it works on the assumption that it will be used
 by files in the directory devtools/testsuite, which will be located within
-the Gnash top-level checkout directory.
+the Gnash top-level checkout directory.  You may also explicitly specify
+a distribution root at construction.
 
 =head1 METHODS
 
 =over 4
 
-=item new()
+=item new([DISTRIBUTION_ROOT])
 
 The constructor will search the file system as described above, then
 create a list of all files in the top-level checkout directory or in
 nested directories.  It will throw an exception if the distribution
 root is not found.
 
+You may optionally supply your own distribution root, using a full
+path.
+
+=item distribution_root()
+
+Returns the full path of the directory this library considers to be
+your distribution root.  All files under that directory will be 
+considered for inclusion in the lists returned by the next two methods.
+
+Use this method if you want to ensure that you are operating on the
+correct directory (for example if you are writing a one-off script).
+
 =item get_cpp_language_files()
 
 This method will return an array containing all C++ files, which includes




reply via email to

[Prev in Thread] Current Thread [Next in Thread]