]> git.vpit.fr Git - perl/modules/Regexp-Wildcards.git/commitdiff
This is 1.03 v1.03
authorVincent Pit <vince@profvince.com>
Thu, 26 Feb 2009 15:35:08 +0000 (16:35 +0100)
committerVincent Pit <vince@profvince.com>
Thu, 26 Feb 2009 15:35:08 +0000 (16:35 +0100)
Changes
META.yml
README
lib/Regexp/Wildcards.pm

diff --git a/Changes b/Changes
index 8c41c424597408e8f9abec588fec9230d35b0627..456b4029b90e979881a1d8492072c63ecd076521 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,12 @@
 Revision history for Regexp-Wildcards
 
 Revision history for Regexp-Wildcards
 
+1.03    2009-02-26 15:35 UTC
+        + Add : Translating both 'jokers' and 'sql' at the same time.
+        + Doc : Cleanups.
+        + Fix : The ->type forgot how to really accept $^O since the rewrite.
+                Reported by Bruce McKenzie in RT #43643.
+        + Upd : META.yml spec updated to 1.4.
+
 1.02    2008-08-23 09:15 UTC
         + Add : The 'anchor' metacharacter class.
 
 1.02    2008-08-23 09:15 UTC
         + Add : The 'anchor' metacharacter class.
 
index cfa8e613c8fdd97f896874c0efc5fdeaf330fcb7..0aa78b6be0a1635d94eec0af3ceaab63d169ff75 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -1,19 +1,30 @@
 --- #YAML:1.0
 --- #YAML:1.0
-name:                Regexp-Wildcards
-version:             1.02
-abstract:            Converts wildcard expressions to Perl regular expressions.
-license:             perl
-author:              
+name:               Regexp-Wildcards
+version:            1.03
+abstract:           Converts wildcard expressions to Perl regular expressions.
+author:
     - Vincent Pit <perl@profvince.com>
     - Vincent Pit <perl@profvince.com>
-generated_by:        ExtUtils::MakeMaker version 6.42
-distribution_type:   module
-requires:     
-    Carp:                          0
-    Exporter:                      0
-    Text::Balanced:                0
-meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
-    version: 1.3
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
 build_requires:
 build_requires:
-    ExtUtils::MakeMaker:           0
-    Test::More:                    0
+    ExtUtils::MakeMaker:  0
+    Test::More:           0
+requires:
+    Carp:            0
+    perl:            5.006
+    Text::Balanced:  0
+resources:
+    bugtracker:  http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Regexp-Wildcards
+    homepage:    http://search.cpan.org/dist/Regexp-Wildcards/
+    license:     http://dev.perl.org/licenses/
+    repository:  http://git.profvince.com/perl/modules/Regexp-Wildcards.git
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.48
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4
diff --git a/README b/README
index 19cb5b7733ad7e7ffc72bc5b3341f9bf2647be33..6c12d595f66c399e477fd75a4cf82085f29a2024 100644 (file)
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ NAME
     expressions.
 
 VERSION
     expressions.
 
 VERSION
-    Version 1.02
+    Version 1.03
 
 SYNOPSIS
         use Regexp::Wildcards;
 
 SYNOPSIS
         use Regexp::Wildcards;
@@ -58,38 +58,50 @@ METHODS
     Specifies the list of metacharacters to convert or to prevent for
     escaping. They fit into six classes :
 
     Specifies the list of metacharacters to convert or to prevent for
     escaping. They fit into six classes :
 
-    *   'jokers' converts "?" to "." and "*" to ".*" ;
+    *   'jokers'
+
+        Converts "?" to "." and "*" to ".*".
 
             'a**\\*b??\\?c' ==> 'a.*\\*b..\\?c'
 
 
             'a**\\*b??\\?c' ==> 'a.*\\*b..\\?c'
 
-    *   'sql' converts "_" to "." and "%" to ".*" ;
+    *   'sql'
+
+        Converts "_" to "." and "%" to ".*".
 
             'a%%\\%b__\\_c' ==> 'a.*\\%b..\\_c'
 
 
             'a%%\\%b__\\_c' ==> 'a.*\\%b..\\_c'
 
-    *   'commas' converts all "," to "|" and puts the complete resulting
-        regular expression inside "(?: ... )" ;
+    *   'commas'
+
+        Converts all "," to "|" and puts the complete resulting regular
+        expression inside "(?: ... )".
 
             'a,b{c,d},e' ==> '(?:a|b\\{c|d\\}|e)'
 
 
             'a,b{c,d},e' ==> '(?:a|b\\{c|d\\}|e)'
 
-    *   'brackets' converts all matching "{ ... , ... }" brackets to "(?:
-        ... | ... )" alternations. If some brackets are unbalanced, it tries
-        to substitute as many of them as possible, and then escape the
+    *   'brackets'
+
+        Converts all matching "{ ... , ... }" brackets to "(?: ... | ... )"
+        alternations. If some brackets are unbalanced, it tries to
+        substitute as many of them as possible, and then escape the
         remaining unmatched "{" and "}". Commas outside of any
         remaining unmatched "{" and "}". Commas outside of any
-        bracket-delimited block are also escaped ;
+        bracket-delimited block are also escaped.
 
             'a,b{c,d},e'    ==> 'a\\,b(?:c|d)\\,e'
             '{a\\{b,c}d,e}' ==> '(?:a\\{b|c)d\\,e\\}'
             '{a{b,c\\}d,e}' ==> '\\{a\\{b\\,c\\}d\\,e\\}'
 
 
             'a,b{c,d},e'    ==> 'a\\,b(?:c|d)\\,e'
             '{a\\{b,c}d,e}' ==> '(?:a\\{b|c)d\\,e\\}'
             '{a{b,c\\}d,e}' ==> '\\{a\\{b\\,c\\}d\\,e\\}'
 
-    *   'groups' keeps the parenthesis "( ... )" of the original string
-        without escaping them. Currently, no check is done to ensure that
-        the parenthesis are matching.
+    *   'groups'
+
+        Keeps the parenthesis "( ... )" of the original string without
+        escaping them. Currently, no check is done to ensure that the
+        parenthesis are matching.
 
             'a(b(c))d\\(\\)' ==> (no change)
 
 
             'a(b(c))d\\(\\)' ==> (no change)
 
-    *   'anchors' prevents the *beginning-of-line* "^" and *end-of-line* "$"
-        anchors to be escaped. Since "[...]" character class are currently
-        escaped, a "^" will always be interpreted as *beginning-of-line*.
+    *   'anchors'
+
+        Prevents the *beginning-of-line* "^" and *end-of-line* "$" anchors
+        to be escaped. Since "[...]" character class are currently escaped,
+        a "^" will always be interpreted as *beginning-of-line*.
 
             'a^b$c' ==> (no change)
 
 
             'a^b$c' ==> (no change)
 
@@ -116,40 +128,78 @@ METHODS
         $rw->do(rem => 'jokers');           # Specifying both 'sql' and 'jokers' is useless.
         $rw->do();                          # Translate nothing.
 
         $rw->do(rem => 'jokers');           # Specifying both 'sql' and 'jokers' is useless.
         $rw->do();                          # Translate nothing.
 
+    The "do" method returns the Regexp::Wildcards object.
+
   "type $type"
     Notifies to convert the metacharacters that corresponds to the
   "type $type"
     Notifies to convert the metacharacters that corresponds to the
-    predefined type $type. $type can be any of 'jokers', 'sql', 'commas',
-    'brackets', 'win32' or 'unix'. An unknown or undefined value defaults to
-    'unix', except for 'dos', 'os2', 'MSWin32' and 'cygwin' that default to
-    'win32'. This means that you can pass $^O as the $type and get the
-    corresponding shell behaviour. Returns the object.
+    predefined type $type. $type can be any of :
+
+    *   'jokers', 'sql', 'commas', 'brackets'
+
+        Singleton types that enable the corresponding "do" classes.
+
+    *   'unix'
+
+        Covers typical Unix shell globbing features (effectively 'jokers'
+        and 'brackets').
+
+    *   $^O values for common Unix systems
+
+        Wrap to 'unix' (see perlport for the list).
+
+    *   "undef"
+
+        Defaults to 'unix'.
+
+    *   'win32'
+
+        Covers typical Windows shell globbing features (effectively 'jokers'
+        and 'commas').
+
+    *   'dos', 'os2', 'MSWin32', 'cygwin'
+
+        Wrap to 'win32'.
+
+    In particular, you can usually pass $^O as the $type and get the
+    corresponding shell behaviour.
 
         $rw->type('win32'); # Set type to win32.
 
         $rw->type('win32'); # Set type to win32.
+        $rw->type($^O);     # Set type to unix on Unices and win32 on Windows
         $rw->type();        # Set type to unix.
 
         $rw->type();        # Set type to unix.
 
+    The "type" method returns the Regexp::Wildcards object.
+
   "capture [ $captures | set => $c1, add => $c2, rem => $c3 ]"
     Specifies the list of atoms to capture. This method works like "do",
     except that the classes are different :
 
   "capture [ $captures | set => $c1, add => $c2, rem => $c3 ]"
     Specifies the list of atoms to capture. This method works like "do",
     except that the classes are different :
 
-    *   'single' will capture all unescaped *"exactly one"* metacharacters,
-        i.e. "?" for wildcards or "_" for SQL ;
+    *   'single'
+
+        Captures all unescaped *"exactly one"* metacharacters, i.e. "?" for
+        wildcards or "_" for SQL.
 
             'a???b\\??' ==> 'a(.)(.)(.)b\\?(.)'
             'a___b\\__' ==> 'a(.)(.)(.)b\\_(.)'
 
 
             'a???b\\??' ==> 'a(.)(.)(.)b\\?(.)'
             'a___b\\__' ==> 'a(.)(.)(.)b\\_(.)'
 
-    *   'any' will capture all unescaped *"any"* metacharacters, i.e. "*"
-        for wildcards or "%" for SQL ;
+    *   'any'
+
+        Captures all unescaped *"any"* metacharacters, i.e. "*" for
+        wildcards or "%" for SQL.
 
             'a***b\\**' ==> 'a(.*)b\\*(.*)'
             'a%%%b\\%%' ==> 'a(.*)b\\%(.*)'
 
 
             'a***b\\**' ==> 'a(.*)b\\*(.*)'
             'a%%%b\\%%' ==> 'a(.*)b\\%(.*)'
 
-    *   'greedy', when used in conjunction with 'any', will make the 'any'
-        captures greedy (by default they are not) ;
+    *   'greedy'
+
+        When used in conjunction with 'any', it makes the 'any' captures
+        greedy (by default they are not).
 
             'a***b\\**' ==> 'a(.*?)b\\*(.*?)'
             'a%%%b\\%%' ==> 'a(.*?)b\\%(.*?)'
 
 
             'a***b\\**' ==> 'a(.*?)b\\*(.*?)'
             'a%%%b\\%%' ==> 'a(.*?)b\\%(.*?)'
 
-    *   'brackets' will capture matching "{ ... , ... }" alternations.
+    *   'brackets'
+
+        Capture matching "{ ... , ... }" alternations.
 
             'a{b\\},\\{c}' ==> 'a(b\\}|\\{c)'
 
 
             'a{b\\},\\{c}' ==> 'a(b\\}|\\{c)'
 
@@ -159,12 +209,14 @@ METHODS
         $rw->capture(rem => 'greedy');           # No more greed please.
         $rw->capture();                          # Capture nothing.
 
         $rw->capture(rem => 'greedy');           # No more greed please.
         $rw->capture();                          # Capture nothing.
 
+    The "capture" method returns the Regexp::Wildcards object.
+
   "convert $wc [ , $type ]"
     Converts the wildcard expression $wc into a regular expression according
     to the options stored into the Regexp::Wildcards object, or to $type if
     it's supplied. It successively escapes all unprotected regexp special
     characters that doesn't hold any meaning for wildcards, then replace
   "convert $wc [ , $type ]"
     Converts the wildcard expression $wc into a regular expression according
     to the options stored into the Regexp::Wildcards object, or to $type if
     it's supplied. It successively escapes all unprotected regexp special
     characters that doesn't hold any meaning for wildcards, then replace
-    'jokers' or 'sql' and 'commas' or 'brackets' (depending on the "do" or
+    'jokers', 'sql' and 'commas' or 'brackets' (depending on the "do" or
     "type" options), all of this by applying the 'capture' rules specified
     in the constructor or by "capture".
 
     "type" options), all of this by applying the 'capture' rules specified
     in the constructor or by "capture".
 
@@ -180,11 +232,13 @@ CAVEATS
     the file extension). For example, Windows XP shell matches *a like
     ".*a", "*a?" like ".*a.?", "*a??" like ".*a.{0,2}" and so on.
 
     the file extension). For example, Windows XP shell matches *a like
     ".*a", "*a?" like ".*a.?", "*a??" like ".*a.{0,2}" and so on.
 
+SEE ALSO
+    Text::Glob.
+
 AUTHOR
     Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
 
 AUTHOR
     Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
 
-    You can contact me by mail or on #perl @ FreeNode (vincent or
-    Prof_Vince).
+    You can contact me by mail or on "irc.perl.org" (vincent).
 
 BUGS
     Please report any bugs or feature requests to "bug-regexp-wildcards at
 
 BUGS
     Please report any bugs or feature requests to "bug-regexp-wildcards at
@@ -202,7 +256,7 @@ SUPPORT
     <http://www.profvince.com/perl/cover/Regexp-Wildcards>.
 
 COPYRIGHT & LICENSE
     <http://www.profvince.com/perl/cover/Regexp-Wildcards>.
 
 COPYRIGHT & LICENSE
-    Copyright 2007-2008 Vincent Pit, all rights reserved.
+    Copyright 2007-2009 Vincent Pit, all rights reserved.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
index 1fad00698e7bc511382b759e03403f464d2cab87..d0f9ab3f134560b14360adb95d99b5a9e3e8577a 100644 (file)
@@ -12,13 +12,13 @@ Regexp::Wildcards - Converts wildcard expressions to Perl regular expressions.
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-Version 1.02
+Version 1.03
 
 =cut
 
 use vars qw/$VERSION/;
 BEGIN {
 
 =cut
 
 use vars qw/$VERSION/;
 BEGIN {
- $VERSION = '1.02';
+ $VERSION = '1.03';
 }
 
 =head1 SYNOPSIS
 }
 
 =head1 SYNOPSIS