Commits

Burak Gürsoy  committed 963e14c

convert build.pl and add DEBUG pod

  • Participants
  • Parent commits cdaff4a

Comments (0)

Files changed (3)

 use 5.006;
 use strict;
-use Module::Build;
-use File::Spec;
-use IO::File;
+use lib qw( builder );
+use Build;
 
-my $class = Module::Build->subclass(
-                class => 'MBSubclass',
-                code  => raw_subclass(),
-            );
-
-my $mb = $class->new(
-    module_name    => 'Lingua::TR::Numbers',
-    license        => 'perl',
-    requires       => {},
-    build_requires => {
-        'Test::More' => '0.40',
-    },
-    recommends     => {},
-    sign           => 0,
-    dist_author    => 'Burak Gursoy <burak@cpan.org>',
-    create_license => 1,
-    no_index       => {
-        directory => [
-            'tools',
-            't',
-        ]
-    },
-    meta_merge => {
-        resources => {
-            repository => 'http://bitbucket.org/burak/cpan-lingua-tr-numbers/',
-        },
-    },
-);
-
+my $mb = Build->new;
+$mb->change_versions(1);
 $mb->create_build_script;
-
-sub raw_subclass {
-    my $file = File::Spec->catfile( 'tools', 'Build.pm' );
-    my $FH   = IO::File->new;
-    $FH->open( $file, 'r' ) or die "Can not open($file): $!";
-    my $rv = do { local $/; <$FH> };
-    close $FH;
-    return $rv;
-}
+{
+    module_name => 'Lingua::TR::Numbers',
+    meta_merge  => {
+        resources => {
+            repository => 'http://bitbucket.org/burak/cpan-lingua-tr-numbers/',
+        },
+    },
+}

File lib/Lingua/TR/Numbers.pm

 #use constant IS_LEGACY => $] < 5.006;
 use Exporter ();
 
-BEGIN { *DEBUG = sub () {0} unless defined &DEBUG } # setup a DEBUG constant
+BEGIN { *DEBUG = sub () {0} if ! defined &DEBUG } # setup a DEBUG constant
 
 $VERSION     = '0.23';
 
 
 Similar to C<num2tr>, but returns ordinal versions .
 
+=head1 DEBUG
+
+Define C<Lingua::TR::Numbers::DEBUG> to enable debugging.
+
 =head1 LIMIT
 
 This module supports any numbers upto 999 decillion (999*10**33). Any further