[Bps-public-commit] r14750 - in Shipwright/trunk: lib/Shipwright/Source

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Aug 4 08:12:05 EDT 2008


Author: sunnavy
Date: Mon Aug  4 08:12:04 2008
New Revision: 14750

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Source/Base.pm

Log:
 r15266 at sunnavys-mb:  sunnavy | 2008-08-04 20:11:50 +0800
 improved shipwright_features a bit


Modified: Shipwright/trunk/lib/Shipwright/Source/Base.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Source/Base.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Source/Base.pm	Mon Aug  4 08:12:04 2008
@@ -132,6 +132,28 @@
                 next;
             }
 
+            if ( ref $mods->[$i] eq 'ARRAY' ) {
+# this happends when
+# features(
+#     'Date loading' => [
+#         -default => 0,
+#        recommends( 'DateTime' )
+#     ],
+# );
+               for ( my $j = 0; $j < @{$mods->[$i]}; $j++ ) {
+                    if ( $mods->[$i][$j+1] =~ /^[\d\.]+$/ ) {
+                        $shipwright_req->{recommends}{$mods->[$i][$j]} 
+                            = $mods->[$i][$j+1];
+                        $j++;
+                    }
+                    else {
+                        $shipwright_req->{recommends}{$mods->[$i][$j]} = 0;
+                    }
+                }
+                
+                next;
+            }
+
             if ( $mods->[$i+1] =~ /^[\d\.]+$/ ) {
                 # index $i+1 is a version
                 $shipwright_req->{recommends}{$mods->[$i]} = $mods->[$i+1];



More information about the Bps-public-commit mailing list