r75107 - in /branches/upstream/libterm-sk-perl/current: Changes MANIFEST META.json META.yml README lib/Term/Sk.pm t/0010_test.t

carnil at users.alioth.debian.org carnil at users.alioth.debian.org
Sat Jun 4 10:11:44 UTC 2011


Author: carnil
Date: Sat Jun  4 10:11:37 2011
New Revision: 75107

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=75107
Log:
[svn-upgrade] new version libterm-sk-perl (0.08)

Added:
    branches/upstream/libterm-sk-perl/current/META.json
Modified:
    branches/upstream/libterm-sk-perl/current/Changes
    branches/upstream/libterm-sk-perl/current/MANIFEST
    branches/upstream/libterm-sk-perl/current/META.yml
    branches/upstream/libterm-sk-perl/current/README
    branches/upstream/libterm-sk-perl/current/lib/Term/Sk.pm
    branches/upstream/libterm-sk-perl/current/t/0010_test.t

Modified: branches/upstream/libterm-sk-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-sk-perl/current/Changes?rev=75107&op=diff
==============================================================================
--- branches/upstream/libterm-sk-perl/current/Changes (original)
+++ branches/upstream/libterm-sk-perl/current/Changes Sat Jun  4 10:11:37 2011
@@ -39,3 +39,11 @@
         Token which updates its value before being displayed. An example use
         of this would be a loop wherein every step of the loop could be
         identified by a particular string.
+
+0.08    14 May 2011
+        In the POD documentation, remove the "or die..." from "my $ctr = Term::Sk->new(...) or die..."
+        Also, as suggested by Salvatore Bonaccorso, change the POD documentation as follows:
+          before: This option allows to register...
+          after : This option allows one to register...
+        Make subs log_info(), set_chunk_size() and set_bkup_size() effectively dummy operations (i.e. they
+        don't have any effect whatsoever)

Modified: branches/upstream/libterm-sk-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-sk-perl/current/MANIFEST?rev=75107&op=diff
==============================================================================
--- branches/upstream/libterm-sk-perl/current/MANIFEST (original)
+++ branches/upstream/libterm-sk-perl/current/MANIFEST Sat Jun  4 10:11:37 2011
@@ -6,3 +6,4 @@
 lib/Term/Sk.pm
 t/0010_test.t
 META.yml
+META.json

Added: branches/upstream/libterm-sk-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-sk-perl/current/META.json?rev=75107&op=file
==============================================================================
--- branches/upstream/libterm-sk-perl/current/META.json (added)
+++ branches/upstream/libterm-sk-perl/current/META.json Sat Jun  4 10:11:37 2011
@@ -1,0 +1,36 @@
+{
+   "abstract" : "Perl extension for displaying a progress indicator on a terminal",
+   "author" : [
+      "unknown"
+   ],
+   "dynamic_config" : 1,
+   "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.110930",
+   "license" : [
+      "perl_5"
+   ],
+   "meta-spec" : {
+      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+      "version" : "2"
+   },
+   "name" : "Term-Sk",
+   "prereqs" : {
+      "configure" : {
+         "requires" : {
+            "Module::Build" : "0.38"
+         }
+      }
+   },
+   "provides" : {
+      "Term::Sk" : {
+         "file" : "lib/Term/Sk.pm",
+         "version" : "0.08"
+      }
+   },
+   "release_status" : "stable",
+   "resources" : {
+      "license" : [
+         "http://dev.perl.org/licenses/"
+      ]
+   },
+   "version" : "0.08"
+}

Modified: branches/upstream/libterm-sk-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-sk-perl/current/META.yml?rev=75107&op=diff
==============================================================================
--- branches/upstream/libterm-sk-perl/current/META.yml (original)
+++ branches/upstream/libterm-sk-perl/current/META.yml Sat Jun  4 10:11:37 2011
@@ -1,9 +1,12 @@
 ---
 abstract: 'Perl extension for displaying a progress indicator on a terminal'
-author: []
+author:
+  - unknown
+build_requires: {}
 configure_requires:
-  Module::Build: 0.36
-generated_by: 'Module::Build version 0.3609'
+  Module::Build: 0.38
+dynamic_config: 1
+generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.110930'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -12,7 +15,7 @@
 provides:
   Term::Sk:
     file: lib/Term/Sk.pm
-    version: 0.07
+    version: 0.08
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.07
+version: 0.08

Modified: branches/upstream/libterm-sk-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-sk-perl/current/README?rev=75107&op=diff
==============================================================================
--- branches/upstream/libterm-sk-perl/current/README (original)
+++ branches/upstream/libterm-sk-perl/current/README Sat Jun  4 10:11:37 2011
@@ -1,4 +1,4 @@
-Term-Sk Version 0.07
+Term-Sk Version 0.08
 
 This is a Perl extension for displaying a progress indicator on a terminal.
 

Modified: branches/upstream/libterm-sk-perl/current/lib/Term/Sk.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-sk-perl/current/lib/Term/Sk.pm?rev=75107&op=diff
==============================================================================
--- branches/upstream/libterm-sk-perl/current/lib/Term/Sk.pm (original)
+++ branches/upstream/libterm-sk-perl/current/lib/Term/Sk.pm Sat Jun  4 10:11:37 2011
@@ -16,7 +16,7 @@
 
 our @EXPORT = qw();
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 our $errcode = 0;
 our $errmsg  = '';
@@ -279,23 +279,23 @@
     return $_;
 }
 
-my $log_info = '';
-
-sub log_info { $log_info }
-
 my $chunk_size = 10000;
 my $bkup_size  = 80;
 
-sub set_chunk_size { $chunk_size = $_[0]; if ($chunk_size < 100) { $chunk_size = 100;} }
-sub set_bkup_size  { $bkup_size  = $_[0]; if ($bkup_size  <  10) { $bkup_size  =  10;} }
+# Decision by Klaus Eichner, 31-MAY-2011:
+# ---------------------------------------
+# Make subs log_info(), set_chunk_size() and set_bkup_size() effectively dummy operations (i.e. they
+# don't have any effect whatsoever)
+
+sub log_info { }
+sub set_chunk_size { }
+sub set_bkup_size { }
 
 sub rem_backspace {
     my ($fname) = @_;
 
     open my $ifh, '<', $fname or die "Error-0200: Can't open < '$fname' because $!";
     open my $tfh, '+>', undef or die "Error-0210: Can't open +> undef (tempfile) because $!";
-
-    $log_info = '';
 
     my $out_buf = '';
 
@@ -322,13 +322,6 @@
 
             my $delstr = substr($out_buf, $pos_left, $pos_from - $pos_left);
 
-            if ($underflow) {
-                $log_info .= "[** Buffer underflow **]\n";
-            }
-            if ($delstr =~ s{([[:cntrl:]])}{sprintf('[%02d]',ord($1))}xmsge) {
-                $log_info .= "[** Ctlchar: '$delstr' **]\n";
-            }
-
             $out_buf = substr($out_buf, 0, $pos_left).substr($out_buf, $pos_to);
         }
 
@@ -336,8 +329,6 @@
             print {$tfh} substr($out_buf, 0, -$bkup_size);
             $out_buf = substr($out_buf, -$bkup_size);
         }
-
-        $log_info .= "[I=$log_input,B=$log_backspaces]";
     }
 
     CORE::close $ifh; # We need to employ CORE::close because there is already another close subroutine defined in the current namespace "Term::Sk"
@@ -367,10 +358,7 @@
   use Term::Sk;
 
   my $ctr = Term::Sk->new('%d Elapsed: %8t %21b %4p %2d (%8c of %11m)',
-    {quiet => 0, freq => 10, base => 0, target => 100, pdisp => '!'})
-    or die "Error 0010: Term::Sk->new, ".
-           "(code $Term::Sk::errcode) ".
-           "$Term::Sk::errmsg";
+    {quiet => 0, freq => 10, base => 0, target => 100, pdisp => '!'});
 
   $ctr->up for (1..100);
 
@@ -399,10 +387,7 @@
   my $format = '%2d Elapsed: %8t %21b %4p %2d (%8c of %11m)';
 
   my $ctr = Term::Sk->new($format,
-    {freq => 10, base => 0, target => $target, pdisp => '!'})
-    or die "Error 0010: Term::Sk->new, ".
-           "(code $Term::Sk::errcode) ".
-           "$Term::Sk::errmsg";
+    {freq => 10, base => 0, target => $target, pdisp => '!'});
 
   for (1..$target) {
       $ctr->up;
@@ -424,8 +409,7 @@
 
   my $format = '%21b %4p';
 
-  my $ctr = Term::Sk->new($format, {freq => 's', base => 0, target => 70})
-    or die "Error 0010: Term::Sk->new, (code $Term::Sk::errcode) $Term::Sk::errmsg";
+  my $ctr = Term::Sk->new($format, {freq => 's', base => 0, target => 70});
 
   for (1..10) {
       $ctr->up(7);
@@ -439,8 +423,7 @@
 
   use Term::Sk;
 
-  my $ctr = Term::Sk->new('%6c', {freq => 's', base => 0, target => 70})
-    or die "Error 0010: Term::Sk->new, (code $Term::Sk::errcode) $Term::Sk::errmsg";
+  my $ctr = Term::Sk->new('%6c', {freq => 's', base => 0, target => 70});
 
   for (1..4288) {
       $ctr->up;
@@ -457,8 +440,7 @@
 
   my $format = 'Ctr %4c';
 
-  my $ctr = Term::Sk->new($format, {freq => 2, base => 0, target => 10, quiet => 1})
-    or die "Error 0010: Term::Sk->new, (code $Term::Sk::errcode) $Term::Sk::errmsg";
+  my $ctr = Term::Sk->new($format, {freq => 2, base => 0, target => 10, quiet => 1});
 
   my $line = $ctr->get_line;
   $line =~ s/\010/</g;
@@ -482,25 +464,20 @@
 
   my $format = 'act %c max %m';
 
-  my $ctr1 = Term::Sk->new($format, {base => 1234567, target => 2345678})
-    or die "Error 0010: Term::Sk->new, (code $Term::Sk::errcode) $Term::Sk::errmsg";
+  my $ctr1 = Term::Sk->new($format, {base => 1234567, target => 2345678});
   # The following numbers are shown: act 1_234_567 max 2_345_678
 
-  my $ctr2 = Term::Sk->new($format, {base => 1234567, target => 2345678, num => q{9,999}})
-    or die "Error 0010: Term::Sk->new, (code $Term::Sk::errcode) $Term::Sk::errmsg";
+  my $ctr2 = Term::Sk->new($format, {base => 1234567, target => 2345678, num => q{9,999}});
   # The following numbers are shown: act 1,234,567 max 2,345,678
 
-  my $ctr3 = Term::Sk->new($format, {base => 1234567, target => 2345678, num => q{9'99}})
-    or die "Error 0010: Term::Sk->new, (code $Term::Sk::errcode) $Term::Sk::errmsg";
+  my $ctr3 = Term::Sk->new($format, {base => 1234567, target => 2345678, num => q{9'99}});
   # The following numbers are shown: act 1'23'45'67 max 2'34'56'78
 
-  my $ctr4 = Term::Sk->new($format, {base => 1234567, target => 2345678, num => q{9}})
-    or die "Error 0010: Term::Sk->new, (code $Term::Sk::errcode) $Term::Sk::errmsg";
+  my $ctr4 = Term::Sk->new($format, {base => 1234567, target => 2345678, num => q{9}});
   # The following numbers are shown: act 1234567 max 2345678
 
   my $ctr5 = Term::Sk->new($format, {base => 1234567, target => 2345678,
-    commify => sub{ join '!', split m{}xms, $_[0]; }})
-    or die "Error 0010: Term::Sk->new, (code $Term::Sk::errcode) $Term::Sk::errmsg";
+    commify => sub{ join '!', split m{}xms, $_[0]; }});
   # The following numbers are shown: act 1!2!3!4!5!6!7 max 2!3!4!5!6!7!8
 
 =head1 DESCRIPTION
@@ -542,8 +519,7 @@
 of this would be a loop wherein every step of the loop could be
 identified by a particular string.  For example:
 
-    my $ctr = Term::Sk->new('Processing %k', {base => 0, token => 'Albania'})
-       or die "Error 0010: Term::Sk->new, (code $Term::Sk::errcode) $Term::Sk::errmsg";
+    my $ctr = Term::Sk->new('Processing %k', {base => 0, token => 'Albania'});
     foreach my $country (@list_of_european_nations) {
       $ctr->token($country);
       ## do something for each country
@@ -609,7 +585,7 @@
 
 =item option {commify => sub{...}}
 
-This option allows to register a subroutine that formats the counters.
+This option allows one to register a subroutine that formats the counters.
 
 =item option {test => 1}
 
@@ -654,29 +630,13 @@
 
   printf "after  (len=%3d): '%s'\n", length($flatfile), $flatfile;
 
-You can also control (within limits) the internal chunk size and the internal backup size using the
-functions set_chunk_size() and set_bkup_size():
-
-  use Term::Sk qw(rem_backspace set_chunk_size and set_bkup_size);
-
-  set_chunk_size(5000);
-  set_bkup_size(60);
-
-  my $flatfile = "Test hijabc\010\010\010xyzklm";
-
-  printf "before (len=%3d): '%s'\n", length($flatfile), $flatfile;
-
-  rem_backspace(\$flatfile);
-
-  printf "after  (len=%3d): '%s'\n", length($flatfile), $flatfile;
-
 =head1 AUTHOR
 
 Klaus Eichner, January 2008
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2008 by Klaus Eichner
+Copyright (C) 2008-2011 by Klaus Eichner
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself.

Modified: branches/upstream/libterm-sk-perl/current/t/0010_test.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-sk-perl/current/t/0010_test.t?rev=75107&op=diff
==============================================================================
--- branches/upstream/libterm-sk-perl/current/t/0010_test.t (original)
+++ branches/upstream/libterm-sk-perl/current/t/0010_test.t Sat Jun  4 10:11:37 2011
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 66;
+use Test::More tests => 57;
 
 use_ok('Term::Sk');
 
@@ -157,54 +157,15 @@
     Term::Sk::rem_backspace(\$flatfile);
 
     is($flatfile, 'Test hijxyzklm',                             'Test-0480: backspaces have been removed');
-    is(Term::Sk::log_info(), '[I=20,B=3]',                      'Test-0490: log_info() for backspaces');
-}
-
-{
-    my $flatfile = "z\010\010\010";
-
-    Term::Sk::rem_backspace(\$flatfile);
-
-    like(Term::Sk::log_info(), qr{\[\*\* \s Buffer \s underflow \s \*\*\]}xms,
-                                                                'Test-0500: provoked underflow');
-    like(Term::Sk::log_info(), qr{\[I=4,B=3\]}xms,              'Test-0510: log_info() for provoked underflow');
-}
-
-{
-    my $flatfile = "ab\nc\010\010\010";
-
-    Term::Sk::rem_backspace(\$flatfile);
-
-    like(Term::Sk::log_info(), qr{\[\*\* \s Ctlchar:}xms,       'Test-0520: provoked shortline');
-    like(Term::Sk::log_info(), qr{\[I=7,B=3\]}xms,              'Test-0530: log_info() for provoked shortline');
-}
-
-
-{
-    my $flatfile = ('abcde' x 37).("\010" x 28).'fghij';
-
-    Term::Sk::set_chunk_size(200);
-    Term::Sk::set_bkup_size(15);
-
-    Term::Sk::rem_backspace(\$flatfile);
-
-    is(length($flatfile), 162,                                  'Test-0540: length abcde (200,15)');
-    is(Term::Sk::log_info(), '[I=200,B=15][I=18,B=13]',         'Test-0550: log_info() for abcde (200,15)');
-    is(substr($flatfile, -10), 'cdeabfghij',                    'Test-0560: trailing characters for abcde (200,15)');
 }
 
 {
     my $flatfile = ('abcde' x 37).("\010" x 28).'fghij';
 
-    Term::Sk::set_chunk_size(180);
-    Term::Sk::set_bkup_size(15);
-
     Term::Sk::rem_backspace(\$flatfile);
 
-    like(Term::Sk::log_info(), qr{\[I=180,B=0\]}xms,            'Test-0570: log_info() for abcde (180,15) is different');
-    like(Term::Sk::log_info(), qr{\[I=38,B=28\]}xms,            'Test-0572: log_info() for abcde (180,15) is different');
-    like(Term::Sk::log_info(), qr{\[\*\* \s Buffer \s underflow \s \*\*\]}xms,
-                                                                'Test-0580: abcde (180,15) provoked underflow');
+    is(length($flatfile), 162,                                  'Test-0540: length abcde (200,15)');
+    is(substr($flatfile, -10), 'cdeabfghij',                    'Test-0560: trailing characters for abcde (200,15)');
 }
 
 {




More information about the Pkg-perl-cvs-commits mailing list