Changeset 386

Show
Ignore:
Timestamp:
08/19/08 23:40:26 (3 months ago)
Author:
ingy
Message:
version 0.15
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/ingy/JS/Changes

    r352 r386  
     1--- 
     2version: 0.15 
     3date:    Tue Aug 19 23:34:54 PDT 2008 
     4changes: 
     5- Allow random files to be installed as well. 
    16--- 
    27version: 0.14 
  • trunk/src/ingy/JS/Makefile.PL

    r295 r386  
    88install_script  'js-cpan'; 
    99 
     10clean_files     'META.yml'; 
     11 
    1012WriteAll; 
  • trunk/src/ingy/JS/lib/JS.pm

    r352 r386  
    55use 5.005.003; 
    66 
    7 our $VERSION = '0.14'; 
     7our $VERSION = '0.15'; 
    88 
    99sub new { 
     
    3131    find { 
    3232        wanted => sub { 
    33             return unless /\.js$/; 
     33            return unless -f $_; 
     34            return if /\.(?:pm|pod|packlist)$/; 
     35            return if /^\./; 
    3436            my $dir = $File::Find::dir; 
    3537            $dir =~ s{.*/JS\b(/|$)(.*)}{$2} or return; 
    3638            my $module = $dir ? "$dir/$_" : $_; 
    37             $module =~ s/[\/\\]+/./g; 
    38             $module =~ s/\.js$//; 
     39            if ($module =~ s/\.js$//) { 
     40                $module =~ s/[\/\\]+/./g; 
     41            } 
    3942            return if $found->{$module}++; 
    4043            print $module, "\n"; 
     
    4649    my $self = shift; 
    4750    my $module = shift; 
    48     $module =~ s/(::|\.)/\//g; 
     51    unless ($module =~ /\//) { 
     52        $module =~ s/(?:\.)/\//g; 
     53    } 
     54    $module =~ s/(?:::)/\//g; 
    4955    $module =~ s/\*$/.*/; 
    50     $module .= '.js'; 
    5156 
    5257    my $found = {}; 
     
    5560        wanted => sub { 
    5661            my $path = $File::Find::name; 
    57             return unless $path =~ /$module(\.gz)?$/i; 
     62            while (1) { 
     63                return if -d $_; 
     64                return if $path =~ /$module\.pm$/i; 
     65                return if $path =~ /$module\.pod$/i; 
     66                last if $path =~ /$module$/i; 
     67                last if $path =~ /$module\.js(?:\.gz)?$/i; 
     68                return; 
     69            } 
    5870            return if $found->{$path}++; 
    5971            push @module_path, $path; 
  • trunk/src/ingy/JS/t/test.t

    r348 r386  
    2424t/testlib/JS/Foo/Bar-pack.js 
    2525t/testlib/JS/Foo/Bar.js 
     26t/testlib/JS/Foo/bin/script 
    2627 
    2728=== Specific