Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

many package file updates & Perl::Critic suggestions

  • Loading branch information...
commit aa8c4efb4686d16666798170f8916f3ec7549dc5 1 parent 7ec7f42
Barbie authored July 29, 2012
12  Changes
... ...
@@ -1,5 +1,17 @@
1 1
 # Changes log for Data::Phrasebook
2 2
 
  3
+0.32    29/07/2012
  4
+        - removed License files from distro.
  5
+        - Artistic License v2 now sole license.
  6
+        - removed DSLIP info.
  7
+        - spelling fixes. (thanks to Nicholas Bamber, Florian Schlichting & 
  8
+          Gregor Herrmann).
  9
+        - added minimum perl version (5.006).
  10
+        - reworked Makefile.PL for clarity.
  11
+        - updated META.yml testing.
  12
+	- added Carp as a prerequisite.
  13
+	- implemented Perl::Critic suggestions.
  14
+
3 15
 0.31    31/08/2010
4 16
 	- added blank_args as a parameter to delimiters().
5 17
 
2  INSTALL
@@ -110,6 +110,6 @@ built correctly on your machine.
110 110
 
111 111
 cheers,
112 112
 Barbie.
113  
-http://birmingham.pm.org/
  113
+http://barbie.missbarbell.co.uk/
114 114
 
115 115
 with much appreciation to Iain (aka Spoon).
2  LICENSE
... ...
@@ -1,7 +1,7 @@
1 1
 LICENSE FOR Data-Phrasebook
2 2
 
3 3
 Copyright © 2003 Iain Truskett.
4  
-Copyright © 2004-2010 Barbie for Miss Barbell Productions.
  4
+Copyright © 2004-2012 Barbie for Miss Barbell Productions.
5 5
 
6 6
 This module is free software; you can redistribute it and/or
7 7
 modify it under the Artistic Licence v2.
37  META.json
... ...
@@ -1,7 +1,7 @@
1 1
 {
2 2
     "name": "Data::Phrasebook",
3  
-    "version": "0.31",
4  
-    "abstract": "A collection of modules for accessing phrasebooks from various data sources.",
  3
+    "version": "0.32",
  4
+    "abstract": "Access your data using the phrasebook design pattern",
5 5
     "author": ["Barbie <barbie@cpan.org>"],
6 6
 
7 7
     "license": "artistic_2",
@@ -13,27 +13,30 @@
13 13
     },
14 14
     "generated_by": "Hand 1.0",
15 15
     "keywords" : [
  16
+        "abstract",
16 17
         "data",
17 18
         "design pattern",
18  
-        "abstract"
  19
+        "phrasebook"
19 20
     ],
20 21
 
21 22
     "prereqs" : {
22 23
         "runtime" : {
23 24
             "requires" : {
  25
+                "perl": "5.006",
  26
+                "Carp": "0",
  27
+                "IO::File": "0",
24 28
                 "Module::Pluggable": "0"
25 29
             }
26 30
         },
27 31
         "test" : {
28 32
             "requires": {
29  
-                "Test::More": "0.47"
  33
+                "Test::More": "0.70"
30 34
             },
31 35
             "recommends": {
32  
-                "Test::More": "0.70",
  36
+                "Test::CPAN::Meta": "0",
  37
+                "Test::CPAN::Meta::JSON": "0",
33 38
                 "Test::Pod": "1.00",
34  
-                "Test::Pod::Coverage": "0.08",
35  
-                "Test::CPAN::Meta": "0.13",
36  
-                "Test::JSON::Meta": "0.08"
  39
+                "Test::Pod::Coverage": "0.08"
37 40
             }
38 41
         }
39 42
     },
@@ -41,39 +44,39 @@
41 44
     "provides": {
42 45
         "Data::Phrasebook": {
43 46
             "file": "lib/Data/Phrasebook.pm",
44  
-            "version": "0.31"
  47
+            "version": "0.32"
45 48
         },
46 49
         "Data::Phrasebook::Debug": {
47 50
             "file": "lib/Data/Phrasebook/Debug.pm",
48  
-            "version": "0.31"
  51
+            "version": "0.32"
49 52
         },
50 53
         "Data::Phrasebook::Generic": {
51 54
             "file": "lib/Data/Phrasebook/Generic.pm",
52  
-            "version": "0.31"
  55
+            "version": "0.32"
53 56
         },
54 57
         "Data::Phrasebook::Loader": {
55 58
             "file": "lib/Data/Phrasebook/Loader.pm",
56  
-            "version": "0.31"
  59
+            "version": "0.32"
57 60
         },
58 61
         "Data::Phrasebook::Loader::Base": {
59 62
             "file": "lib/Data/Phrasebook/Loader/Base.pm",
60  
-            "version": "0.31"
  63
+            "version": "0.32"
61 64
         },
62 65
         "Data::Phrasebook::Loader::Text": {
63 66
             "file": "lib/Data/Phrasebook/Loader/Text.pm",
64  
-            "version": "0.31"
  67
+            "version": "0.32"
65 68
         },
66 69
         "Data::Phrasebook::Plain": {
67 70
             "file": "lib/Data/Phrasebook/Plain.pm",
68  
-            "version": "0.31"
  71
+            "version": "0.32"
69 72
         },
70 73
         "Data::Phrasebook::SQL": {
71 74
             "file": "lib/Data/Phrasebook/SQL.pm",
72  
-            "version": "0.31"
  75
+            "version": "0.32"
73 76
         },
74 77
         "Data::Phrasebook::SQL::Query": {
75 78
             "file": "lib/Data/Phrasebook/SQL/Query.pm",
76  
-            "version": "0.31"
  79
+            "version": "0.32"
77 80
         }
78 81
     },
79 82
     "no_index": {
47  META.yml
... ...
@@ -1,54 +1,55 @@
1 1
 --- #YAML:1.0
2  
-name:                   Data-Phrasebook
3  
-version:                0.31
4  
-abstract:               A collection of modules for accessing phrasebooks from various data sources.
  2
+name:                     Data-Phrasebook
  3
+version:                  0.32
  4
+abstract:                 Access your data using the phrasebook design pattern
5 5
 author:
6 6
   - Barbie <barbie@cpan.org>
7 7
 
8  
-license:                artistic_2
9  
-distribution_type:      module
10  
-installdirs:            site
  8
+license:                  artistic_2
  9
+distribution_type:        module
  10
+installdirs:              site
11 11
 
12 12
 requires:
13  
-  Module::Pluggable:    2.7
14  
-  Test::More:           0.47
  13
+  perl:                   5.006
  14
+  Carp:                   0
  15
+  IO::File:               0
  16
+  Module::Pluggable:      2.7
15 17
 recommends:
16  
-  Test::More:           0.70
17  
-  Test::Pod:            1.00
18  
-  Test::Pod::Coverage:  0.08
19  
-  Test::CPAN::Meta:     0.13
20  
-  Test::CPAN::Meta:     0.08
  18
+  Test::CPAN::Meta:       0
  19
+  Test::CPAN::Meta::JSON: 0
  20
+  Test::Pod:              1.00
  21
+  Test::Pod::Coverage:    0.08
21 22
 build_requires:
22  
-  Test::More:           0.47
  23
+  Test::More:             0.70
23 24
 
24 25
 provides:
25 26
   Data::Phrasebook:
26 27
     file: lib/Data/Phrasebook.pm
27  
-    version: 0.31
  28
+    version: 0.32
28 29
   Data::Phrasebook::Debug:
29 30
     file: lib/Data/Phrasebook/Debug.pm
30  
-    version: 0.31
  31
+    version: 0.32
31 32
   Data::Phrasebook::Generic:
32 33
     file: lib/Data/Phrasebook/Generic.pm
33  
-    version: 0.31
  34
+    version: 0.32
34 35
   Data::Phrasebook::Loader:
35 36
     file: lib/Data/Phrasebook/Loader.pm
36  
-    version: 0.31
  37
+    version: 0.32
37 38
   Data::Phrasebook::Loader::Base:
38 39
     file: lib/Data/Phrasebook/Loader/Base.pm
39  
-    version: 0.31
  40
+    version: 0.32
40 41
   Data::Phrasebook::Loader::Text:
41 42
     file: lib/Data/Phrasebook/Loader/Text.pm
42  
-    version: 0.31
  43
+    version: 0.32
43 44
   Data::Phrasebook::Plain:
44 45
     file: lib/Data/Phrasebook/Plain.pm
45  
-    version: 0.31
  46
+    version: 0.32
46 47
   Data::Phrasebook::SQL:
47 48
     file: lib/Data/Phrasebook/SQL.pm
48  
-    version: 0.31
  49
+    version: 0.32
49 50
   Data::Phrasebook::SQL::Query:
50 51
     file: lib/Data/Phrasebook/SQL/Query.pm
51  
-    version: 0.31
  52
+    version: 0.32
52 53
 no_index:
53 54
   directory:
54 55
     - t
34  Makefile.PL
... ...
@@ -1,14 +1,26 @@
  1
+#!/usr/bin/perl
  2
+
  3
+use strict;
  4
+use warnings;
  5
+use 5.006;
  6
+
1 7
 use ExtUtils::MakeMaker;
  8
+
2 9
 WriteMakefile(
3  
-    NAME            => 'Data::Phrasebook',
4  
-    VERSION_FROM    => 'lib/Data/Phrasebook.pm',
5  
-    PREREQ_PM       => {
6  
-        'Module::Pluggable' => '2.7',
7  
-        'Test::More'        => '0.47',
8  
-    },
9  
-    NO_META         => 1,
10  
-
11  
-    ($] >= 5.005 ?
12  
-        (ABSTRACT_FROM  => 'lib/Data/Phrasebook.pm',
13  
-         AUTHOR         => 'Barbie <barbie@cpan.org>') : ()),
  10
+    AUTHOR              => 'Barbie <barbie@cpan.org>',
  11
+    NAME                => 'Data::Phrasebook',
  12
+    VERSION_FROM        => 'lib/Data/Phrasebook.pm',
  13
+    ABSTRACT            => 'Access your data using the phrasebook design pattern',
  14
+    NO_META             => 1,
  15
+    PREREQ_PM           => {
  16
+
  17
+        # runtime prereqs
  18
+        'Carp'                  => '0',
  19
+        'IO::File'              => '0',
  20
+        'Module::Pluggable'     => '2.7',
  21
+
  22
+        # build/test prereqs
  23
+        'Test::More'            => '0.70',
  24
+
  25
+    }
14 26
 );
20  README
@@ -57,17 +57,9 @@ within the POD documentation, please send an email to barbie@cpan.org or
57 57
 submit a bug to the RT system (http://rt.cpan.org/). It would help greatly 
58 58
 if you are able to pinpoint problems or even supply a patch. 
59 59
 
60  
-Fixes are dependant upon their severity and my availablity. Should a fix not
  60
+Fixes are dependent upon their severity and my availability. Should a fix not
61 61
 be forthcoming, please feel free to (politely) remind me.
62 62
 
63  
-DSLIP
64  
-
65  
-  b - Beta testing
66  
-  d - Developer
67  
-  p - Perl-only
68  
-  O - Object oriented
69  
-  p - Standard-Perl: user may choose between GPL and Artistic
70  
-
71 63
 AUTHOR
72 64
 
73 65
 Original author: Iain Campbell Truskett (16.07.1979 - 29.12.2003)
@@ -77,12 +69,8 @@ http://www.missbarbell.co.uk.
77 69
 
78 70
 COPYRIGHT AND LICENSE
79 71
 
80  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  72
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
81 73
   Copyright (C) 2003 Iain Truskett.
82 74
 
83  
-  This module is free software; you can redistribute it and/or 
84  
-  modify it under the same terms as Perl itself.
85  
-
86  
-The full text of the licenses can be found in the Artistic and
87  
-COPYING files included with this module, or in perlartistic and
88  
-perlgpl in Perl 5.8.1 or later.
  75
+  This module is free software; you can redistribute it and/or
  76
+  modify it under the Artistic Licence v2.
20  lib/Data/Phrasebook.pm
@@ -5,16 +5,12 @@ use base qw( Data::Phrasebook::Debug );
5 5
 use Carp qw( croak );
6 6
 
7 7
 use vars qw($VERSION);
8  
-$VERSION = '0.31';
  8
+$VERSION = '0.32';
9 9
 
10 10
 =head1 NAME
11 11
 
12 12
 Data::Phrasebook - Abstract your queries!
13 13
 
14  
-=head1 ABSTRACT
15  
-
16  
-A collection of modules for accessing phrasebooks from various data sources.
17  
-
18 14
 =head1 SYNOPSIS
19 15
 
20 16
     use Data::Phrasebook;
@@ -241,8 +237,8 @@ A subsequent reload will occur with the next fetch call.
241 237
 
242 238
 =head1 DEDICATION
243 239
 
244  
-Much of the work original class framework is from Iain's original code. My
245  
-code was alot simpler and was tied to using just an INI data source. Merging
  240
+Much of the code for the original class framework is from Iain's original code.
  241
+My code was much simpler and was tied to using just an INI data source. Merging
246 242
 all the ideas and code together we came up with this distribution.
247 243
 
248 244
 Unfortunately Iain died in December 2003, so he never got to see or play
@@ -266,14 +262,6 @@ L<Data::Phrasebook::Loader::Base>.
266 262
 
267 263
 Please see the README file.
268 264
 
269  
-=head1 DSLIP
270  
-
271  
-  b - Beta testing
272  
-  d - Developer
273  
-  p - Perl-only
274  
-  O - Object oriented
275  
-  p - Standard-Perl: user may choose between GPL and Artistic
276  
-
277 265
 =head1 AUTHOR
278 266
 
279 267
   Original author: Iain Campbell Truskett (16.07.1979 - 29.12.2003)
@@ -283,7 +271,7 @@ Please see the README file.
283 271
 =head1 COPYRIGHT AND LICENSE
284 272
 
285 273
   Copyright (C) 2003 Iain Truskett.
286  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  274
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
287 275
 
288 276
   This module is free software; you can redistribute it and/or
289 277
   modify it under the Artistic Licence v2.
4  lib/Data/Phrasebook/Debug.pm
@@ -4,7 +4,7 @@ use warnings FATAL => 'all';
4 4
 use Carp qw( croak );
5 5
 
6 6
 use vars qw($VERSION);
7  
-$VERSION = '0.31';
  7
+$VERSION = '0.32';
8 8
 
9 9
 =head1 NAME
10 10
 
@@ -143,7 +143,7 @@ Please see the README file.
143 143
 
144 144
 =head1 COPYRIGHT AND LICENSE
145 145
 
146  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  146
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
147 147
 
148 148
   This module is free software; you can redistribute it and/or
149 149
   modify it under the Artistic Licence v2.
4  lib/Data/Phrasebook/Generic.pm
@@ -6,7 +6,7 @@ use base qw( Data::Phrasebook::Debug );
6 6
 use Carp qw( croak );
7 7
 
8 8
 use vars qw($VERSION);
9  
-$VERSION = '0.31';
  9
+$VERSION = '0.32';
10 10
 
11 11
 =head1 NAME
12 12
 
@@ -329,7 +329,7 @@ Please see the README file.
329 329
 =head1 COPYRIGHT AND LICENSE
330 330
 
331 331
   Copyright (C) 2003 Iain Truskett.
332  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  332
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
333 333
 
334 334
   This module is free software; you can redistribute it and/or
335 335
   modify it under the Artistic Licence v2.
18  lib/Data/Phrasebook/Loader.pm
@@ -7,7 +7,7 @@ use Carp qw( croak );
7 7
 use Module::Pluggable   search_path => ['Data::Phrasebook::Loader'];
8 8
 
9 9
 use vars qw($VERSION);
10  
-$VERSION = '0.31';
  10
+$VERSION = '0.32';
11 11
 
12 12
 =head1 NAME
13 13
 
@@ -41,8 +41,7 @@ If no class is specified the default class of 'Text' is used.
41 41
 
42 42
 my $DEFAULT_CLASS = 'Text';
43 43
 
44  
-sub new
45  
-{
  44
+sub new {
46 45
     my $self  = shift;
47 46
     my %args  = @_;
48 47
     my $class = delete $args{class} || 'Text';
@@ -62,8 +61,15 @@ sub new
62 61
     }
63 62
 
64 63
     croak("no loader available of that name\n") unless($plugin);
65  
-    eval "CORE::require $plugin";
66  
-    croak "Couldn't require $plugin : $@" if $@;
  64
+
  65
+    eval {
  66
+        (my $file = $plugin) =~ s|::|/|g;
  67
+        require $file . '.pm';
  68
+        $plugin->import();
  69
+        1;
  70
+    } or do {
  71
+        croak "Couldn't require $plugin : $@";
  72
+    };
67 73
 
68 74
     $self->store(4,"$self->new plugin=[$plugin]")	if($self->debug);
69 75
     return $plugin->new( %args );
@@ -98,7 +104,7 @@ Please see the README file.
98 104
 =head1 COPYRIGHT AND LICENSE
99 105
 
100 106
   Copyright (C) 2003 Iain Truskett.
101  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  107
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
102 108
 
103 109
   This module is free software; you can redistribute it and/or
104 110
   modify it under the Artistic Licence v2.
4  lib/Data/Phrasebook/Loader/Base.pm
@@ -5,7 +5,7 @@ use base qw( Data::Phrasebook::Debug );
5 5
 use Carp qw( croak );
6 6
 
7 7
 use vars qw($VERSION);
8  
-$VERSION = '0.31';
  8
+$VERSION = '0.32';
9 9
 
10 10
 =head1 NAME
11 11
 
@@ -97,7 +97,7 @@ Please see the README file.
97 97
 
98 98
 =head1 COPYRIGHT AND LICENSE
99 99
 
100  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  100
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
101 101
 
102 102
   This module is free software; you can redistribute it and/or
103 103
   modify it under the Artistic Licence v2.
18  lib/Data/Phrasebook/Loader/Text.pm
@@ -6,7 +6,7 @@ use Carp qw( croak );
6 6
 use IO::File;
7 7
 
8 8
 use vars qw($VERSION);
9  
-$VERSION = '0.31';
  9
+$VERSION = '0.32';
10 10
 
11 11
 =head1 NAME
12 12
 
@@ -154,7 +154,7 @@ sub dicts {
154 154
     $path ||= $self->{parent}->file;
155 155
     return ()   unless($path && -d $path && -r $path);
156 156
 
157  
-    my @files = map { s/$path.//;$_ } grep {/^[^\.]+.txt$/} glob("$path/*");
  157
+    my @files = map { my $x = $_ ; $x =~ s/$path.//; $x } grep {/^[^\.]+.txt$/} glob("$path/*");
158 158
     return @files;
159 159
 }
160 160
 
@@ -185,7 +185,12 @@ used to interrogate the contents of a known dictionary.
185 185
 =cut
186 186
 
187 187
 sub keywords {
188  
-    return sort keys %phrasebook if(@_ == 1);
  188
+    my @keywords;
  189
+
  190
+    if(@_ == 1) {
  191
+        @keywords = sort keys %phrasebook;
  192
+        return @keywords;
  193
+    }
189 194
 
190 195
     my ($self,$file,$dict) = @_;
191 196
     $file ||= $self->{parent}->file;
@@ -195,14 +200,15 @@ sub keywords {
195 200
     $file = "$file/$dict"   if(-d $file && defined $dict);
196 201
     croak "File [$file] not accessible!" unless -f $file && -r $file;
197 202
 
198  
-    my @keywords;
199 203
     my $book = IO::File->new($file)    or return;
200 204
     while(<$book>) {
201 205
         push @keywords, $1   if(/(.*?)=/ && $1);
202 206
     }
203 207
     $book->close;
204 208
 
205  
-    return sort @keywords;
  209
+    my %keywords = map { $_ => 1 } @keywords;
  210
+    @keywords = sort keys %keywords;
  211
+    return @keywords;
206 212
 }
207 213
 
208 214
 1;
@@ -224,7 +230,7 @@ Please see the README file.
224 230
 
225 231
 =head1 COPYRIGHT AND LICENSE
226 232
 
227  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  233
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
228 234
 
229 235
   This module is free software; you can redistribute it and/or
230 236
   modify it under the Artistic Licence v2.
4  lib/Data/Phrasebook/Plain.pm
@@ -5,7 +5,7 @@ use base qw( Data::Phrasebook::Generic Data::Phrasebook::Debug );
5 5
 use Carp qw( croak );
6 6
 
7 7
 use vars qw($VERSION);
8  
-$VERSION = '0.31';
  8
+$VERSION = '0.32';
9 9
 
10 10
 =head1 NAME
11 11
 
@@ -106,7 +106,7 @@ Please see the README file.
106 106
 =head1 COPYRIGHT AND LICENSE
107 107
 
108 108
   Copyright (C) 2003 Iain Truskett.
109  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  109
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
110 110
 
111 111
   This module is free software; you can redistribute it and/or
112 112
   modify it under the Artistic Licence v2.
4  lib/Data/Phrasebook/SQL.pm
@@ -7,7 +7,7 @@ use Carp qw( croak );
7 7
 use Data::Phrasebook::SQL::Query;
8 8
 
9 9
 use vars qw($VERSION);
10  
-$VERSION = '0.31';
  10
+$VERSION = '0.32';
11 11
 
12 12
 =head1 NAME
13 13
 
@@ -234,7 +234,7 @@ Please see the README file.
234 234
 =head1 COPYRIGHT AND LICENSE
235 235
 
236 236
   Copyright (C) 2003 Iain Truskett.
237  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  237
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
238 238
 
239 239
   This module is free software; you can redistribute it and/or
240 240
   modify it under the Artistic Licence v2.
4  lib/Data/Phrasebook/SQL/Query.pm
@@ -6,7 +6,7 @@ use vars qw( $AUTOLOAD );
6 6
 use Carp qw( croak );
7 7
 
8 8
 use vars qw($VERSION);
9  
-$VERSION = '0.31';
  9
+$VERSION = '0.32';
10 10
 
11 11
 =head1 NAME
12 12
 
@@ -262,7 +262,7 @@ Please see the README file.
262 262
 =head1 COPYRIGHT AND LICENSE
263 263
 
264 264
   Copyright (C) 2003 Iain Truskett.
265  
-  Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
  265
+  Copyright (C) 2004-2012 Barbie for Miss Barbell Productions.
266 266
 
267 267
   This module is free software; you can redistribute it and/or
268 268
   modify it under the Artistic Licence v2.
3  t/90podtest.t
... ...
@@ -1,3 +1,6 @@
  1
+#!/usr/bin/perl -w
  2
+use strict;
  3
+
1 4
 use Test::More;
2 5
 
3 6
 # Skip if doing a regular install
3  t/91podcover.t
... ...
@@ -1,3 +1,6 @@
  1
+#!/usr/bin/perl -w
  2
+use strict;
  3
+
1 4
 use Test::More;
2 5
 
3 6
 # Skip if doing a regular install
25  t/94metatest.t
... ...
@@ -1,9 +1,28 @@
  1
+#!/usr/bin/perl -w
  2
+use strict;
  3
+
1 4
 use Test::More;
2 5
 
3 6
 # Skip if doing a regular install
4 7
 plan skip_all => "Author tests not required for installation"
5 8
     unless ( $ENV{AUTOMATED_TESTING} );
6 9
 
7  
-eval "use Test::CPAN::Meta 0.12";
8  
-plan skip_all => "Test::CPAN::Meta 0.12 required for testing META.yml" if $@;
9  
-meta_yaml_ok();
  10
+eval "use Test::CPAN::Meta";
  11
+plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
  12
+
  13
+plan 'no_plan';
  14
+
  15
+my $meta = meta_spec_ok(undef,undef,@_);
  16
+
  17
+use Data::Phrasebook;
  18
+my $version = $Data::Phrasebook::VERSION;
  19
+
  20
+is($meta->{version},$version,
  21
+    'META.yml distribution version matches');
  22
+
  23
+if($meta->{provides}) {
  24
+    for my $mod (keys %{$meta->{provides}}) {
  25
+        is($meta->{provides}{$mod}{version},$version,
  26
+            "META.yml entry [$mod] version matches");
  27
+    }
  28
+}
11  t/95changedate.t
... ...
@@ -1,6 +1,8 @@
  1
+#!/usr/bin/perl -w
  2
+use strict;
  3
+
1 4
 use Test::More;
2 5
 use IO::File;
3  
-use Data::Phrasebook;
4 6
 
5 7
 # Skip if doing a regular install
6 8
 plan skip_all => "Author tests not required for installation"
@@ -8,12 +10,15 @@ plan skip_all => "Author tests not required for installation"
8 10
 
9 11
 my $fh = IO::File->new('Changes','r')   or plan skip_all => "Cannot open Changes file";
10 12
 
11  
-plan no_plan;
  13
+plan 'no_plan';
  14
+
  15
+use Data::Phrasebook;
  16
+my $version = $Data::Phrasebook::VERSION;
12 17
 
13 18
 my $latest = 0;
14 19
 while(<$fh>) {
15 20
     next        unless(m!^\d!);
16  
-    $latest = 1 if(m!^$Data::Phrasebook::VERSION!);
  21
+    $latest = 1 if(m!^$version!);
17 22
     like($_, qr!\d[\d._]+\s+\d{2}/\d{2}/\d{4}!,'... version has a date');
18 23
 }
19 24
 
5  t/96metatest.t
... ...
@@ -1,3 +1,6 @@
  1
+#!/usr/bin/perl -w
  2
+use strict;
  3
+
1 4
 use Test::More;
2 5
 
3 6
 # Skip if doing a regular install
@@ -7,7 +10,7 @@ plan skip_all => "Author tests not required for installation"
7 10
 eval "use Test::JSON::Meta 0.08";
8 11
 plan skip_all => "Test::JSON::Meta 0.08 required for testing META.json files" if $@;
9 12
 
10  
-plan no_plan;
  13
+plan 'no_plan';
11 14
 
12 15
 my $meta = meta_spec_ok(undef,undef,@_);
13 16
 
7  t/lib/BookDB.pm
... ...
@@ -1,11 +1,13 @@
1 1
 package BookDB;
2 2
 
  3
+use strict;
  4
+use warnings;
  5
+
3 6
 my $dbh;
4 7
 my $bind = '';
5 8
 my $oldq = '';
6 9
 
7  
-sub new
8  
-{
  10
+sub new {
9 11
 	my $self = shift;
10 12
 
11 13
 	# create an attributes hash
@@ -129,4 +131,3 @@ DESTROY { }
129 131
 END { }
130 132
 
131 133
 1;
132  
-
4  t/lib/Data/Phrasebook/Loader/Fake.pm
... ...
@@ -1,6 +1,8 @@
1 1
 package Data::Phrasebook::Loader::Fake;
2 2
 
  3
+use strict;
  4
+use warnings;
  5
+
3 6
 use base qw( Data::Phrasebook::Loader::Base );
4 7
 
5 8
 1;
6  
-
4  t/lib/MyClass.pm
... ...
@@ -1,6 +1,8 @@
1 1
 package MyClass;
2 2
 
  3
+use strict;
  4
+use warnings;
  5
+
3 6
 use base qw( Data::Phrasebook::Generic );
4 7
 
5 8
 1;
6  
-
4  t/lib/MyPhrasebook.pm
... ...
@@ -1,6 +1,8 @@
1 1
 package MyPhrasebook;
2 2
 
  3
+use strict;
  4
+use warnings;
  5
+
3 6
 use base qw( Data::Phrasebook );
4 7
 
5 8
 1;
6  
-

0 notes on commit aa8c4ef

Please sign in to comment.
Something went wrong with that request. Please try again.