r66963 - in /branches/upstream/libtext-lorem-perl: ./ current/ current/bin/ current/lib/ current/lib/Text/ current/t/

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Tue Jan 4 23:08:43 UTC 2011


Author: periapt-guest
Date: Tue Jan  4 23:08:25 2011
New Revision: 66963

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66963
Log:
[svn-inject] Installing original source of libtext-lorem-perl (0.3)

Added:
    branches/upstream/libtext-lorem-perl/
    branches/upstream/libtext-lorem-perl/current/
    branches/upstream/libtext-lorem-perl/current/Build.PL
    branches/upstream/libtext-lorem-perl/current/CHANGES
    branches/upstream/libtext-lorem-perl/current/INSTALL
    branches/upstream/libtext-lorem-perl/current/MANIFEST
    branches/upstream/libtext-lorem-perl/current/META.yml
    branches/upstream/libtext-lorem-perl/current/Makefile.PL
    branches/upstream/libtext-lorem-perl/current/README
    branches/upstream/libtext-lorem-perl/current/bin/
    branches/upstream/libtext-lorem-perl/current/bin/lorem
    branches/upstream/libtext-lorem-perl/current/lib/
    branches/upstream/libtext-lorem-perl/current/lib/Text/
    branches/upstream/libtext-lorem-perl/current/lib/Text/Lorem.pm
    branches/upstream/libtext-lorem-perl/current/t/
    branches/upstream/libtext-lorem-perl/current/t/01_words.t
    branches/upstream/libtext-lorem-perl/current/t/02_singleton.t

Added: branches/upstream/libtext-lorem-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/Build.PL?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/Build.PL (added)
+++ branches/upstream/libtext-lorem-perl/current/Build.PL Tue Jan  4 23:08:25 2011
@@ -1,0 +1,14 @@
+#!/usr/bin/perl
+
+
+use Module::Build;
+# See perldoc Module::Build for details of how this works
+
+Module::Build->new(
+		   module_name       => 'Text::Lorem',
+		   license           => 'perl',
+		   build_requires    => {
+				         Test::More => 0,
+				        },
+                  create_makefile_pl => 'passthrough'
+		  )->create_build_script;

Added: branches/upstream/libtext-lorem-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/CHANGES?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/CHANGES (added)
+++ branches/upstream/libtext-lorem-perl/current/CHANGES Tue Jan  4 23:08:25 2011
@@ -1,0 +1,4 @@
+0.2 2004-01-12
+  + Added support for creating multiple instances of the Text::Lorem object.
+0.3 2004-03-25
+  + Added command line utility submitted by Darren Chamberlain

Added: branches/upstream/libtext-lorem-perl/current/INSTALL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/INSTALL?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/INSTALL (added)
+++ branches/upstream/libtext-lorem-perl/current/INSTALL Tue Jan  4 23:08:25 2011
@@ -1,0 +1,10 @@
+To install Text::Lorem, you need Module::Build installed. The included
+Makefile.PL will prompt you to use CPAN.pm to install it if you don't
+already have it.
+
+The installation process:
+
+    perl Build.PL
+    ./Build
+    ./Build test
+    ./Build install

Added: branches/upstream/libtext-lorem-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/MANIFEST?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/MANIFEST (added)
+++ branches/upstream/libtext-lorem-perl/current/MANIFEST Tue Jan  4 23:08:25 2011
@@ -1,0 +1,11 @@
+bin/lorem
+Build.PL
+CHANGES
+INSTALL
+lib/Text/Lorem.pm
+Makefile.PL
+MANIFEST
+META.yml
+README
+t/01_words.t
+t/02_singleton.t

Added: branches/upstream/libtext-lorem-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/META.yml?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/META.yml (added)
+++ branches/upstream/libtext-lorem-perl/current/META.yml Tue Jan  4 23:08:25 2011
@@ -1,0 +1,14 @@
+--- #YAML:1.0
+name: Text-Lorem
+version: 0.3
+author:
+  - Adeola Awoyemi (adeola at fotango.com)
+abstract: Generate random Latin looking text
+license: perl
+build_requires:
+  Test::More: 0
+provides:
+  Text::Lorem:
+    file: lib/Text/Lorem.pm
+    version: 0.3
+generated_by: Module::Build version 0.24

Added: branches/upstream/libtext-lorem-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/Makefile.PL?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/Makefile.PL (added)
+++ branches/upstream/libtext-lorem-perl/current/Makefile.PL Tue Jan  4 23:08:25 2011
@@ -1,0 +1,29 @@
+# Note: this file was auto-generated by Module::Build::Compat version 0.03
+    
+    unless (eval "use Module::Build::Compat 0.02; 1" ) {
+      print "This module requires Module::Build to install itself.\n";
+      
+      require ExtUtils::MakeMaker;
+      my $yn = ExtUtils::MakeMaker::prompt
+	('  Install Module::Build now from CPAN?', 'y');
+      
+      unless ($yn =~ /^y/i) {
+	die " *** Cannot install without Module::Build.  Exiting ...\n";
+      }
+      
+      require Cwd;
+      require File::Spec;
+      require CPAN;
+      
+      # Save this 'cause CPAN will chdir all over the place.
+      my $cwd = Cwd::cwd();
+      my $makefile = File::Spec->rel2abs($0);
+      
+      CPAN::Shell->install('Module::Build::Compat')
+	or die " *** Cannot install without Module::Build.  Exiting ...\n";
+      
+      chdir $cwd or die "Cannot chdir() back to $cwd: $!";
+      exec $^X, $makefile, @ARGV;  # Redo now that we have Module::Build
+    }
+    Module::Build::Compat->run_build_pl(args => \@ARGV);
+    Module::Build::Compat->write_makefile(build_class => 'Module::Build');

Added: branches/upstream/libtext-lorem-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/README?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/README (added)
+++ branches/upstream/libtext-lorem-perl/current/README Tue Jan  4 23:08:25 2011
@@ -1,0 +1,54 @@
+NAME
+    Text::Lorem - Generate random latin looking text
+
+SYNOPSIS
+     #!/usr/bin/perl
+ 
+     use strict;
+     use warnings;
+     use Text::Lorem;
+ 
+     my $text = Text::Lorem->new();
+
+     # Generate a string of text with 5 words
+     $words = $text->words(5);
+
+     # Generate a string of text with 2 sentences
+     $sentences = $text->sentences(2);
+
+     #Generate 3 paragraphs
+     $paragraphs = $text->paragraphs(3);
+
+DESCRIPTION
+    Often when developing a website its important to have placeholders for
+    content. This module generates prescribed amounts of fake latin text.
+
+CONSTRUCTOR
+    new()
+        The default constructor, `new' takes no arguments and returns a
+        Text::Lorem object.
+
+METHODS
+    words( INTEGER )
+        Returns INTEGER fake latin words.
+
+    sentences( INTEGER )
+        Returns INTEGER sentences in fake latin.
+
+    paragraphs( INTEGER )
+        Returns INTEGER paragraphs of fake latin text.
+
+THANKS
+    Thanks to the guys who pushed me off the cliff called comfort and into
+    the scary world of Perl: james Duncan, Leon Brocard.
+
+AUTHOR
+    Adeola Awoyemi (adeola at fotango.com)
+
+SEE ALSO
+      WWW::Lipsum(3) and http://lipsum.com/
+
+COPYRIGHT
+    Copyright 2003 Fotango Ltd. All rights reserved. This software is
+    released under the same license as Perl itself.
+

Added: branches/upstream/libtext-lorem-perl/current/bin/lorem
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/bin/lorem?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/bin/lorem (added)
+++ branches/upstream/libtext-lorem-perl/current/bin/lorem Tue Jan  4 23:08:25 2011
@@ -1,0 +1,72 @@
+#!/usr/bin/perl -w
+
+use strict;
+use vars qw($opt_v $opt_w $opt_s $opt_p);
+
+use Getopt::Std;
+use Text::Lorem;
+
+getopts("vw:s:p:");
+
+if ($opt_v) {
+    print usage();
+    exit 0;
+}
+
+die usage()
+    if ((defined($opt_w) + defined($opt_s) + defined($opt_p)) > 1);
+
+my $lorem = Text::Lorem->new;
+if ($opt_w) {
+    print $lorem->words($opt_w);
+}
+elsif ($opt_s) {
+    print $lorem->sentences($opt_s);
+}
+elsif ($opt_p) {
+    print $lorem->paragraphs($opt_p);
+}
+else {
+    print $lorem->paragraphs(1);
+}
+
+sub usage {
+    return <<USAGE;
+$0 - Generate random Latin looking text using Text::Lorem
+
+Usage:
+    $0 -w NUMBER_OF_WORDS
+    $0 -s NUMBER_OF_SENTENSES
+    $0 -p NUMBER_OF_PARAGRAPHS
+
+-w, -s, and -p are mutually exclusive.
+USAGE
+}
+
+__END__
+
+=head1 NAME
+
+lorem - Generate random Latin looking text using Text::Lorem
+
+=head1 SYNOPSIS
+
+Generate 3 paragraphs of Latin looking text:
+
+    $ lorem -p 3
+
+Generate 5 Latin looking words:
+
+    $ lorem -w 5
+
+Generate a Latin looking sentence:
+
+    $ lorem -s 1
+
+=head1 DESCRIPTION
+
+F<lorem> is a simple command-line wrapper around the C<Text::Lorem>
+module.  It provides the same three basic methods:  Generate C<words>,
+generate C<sentences>, and generate C<paragraphs>.
+
+

Added: branches/upstream/libtext-lorem-perl/current/lib/Text/Lorem.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/lib/Text/Lorem.pm?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/lib/Text/Lorem.pm (added)
+++ branches/upstream/libtext-lorem-perl/current/lib/Text/Lorem.pm Tue Jan  4 23:08:25 2011
@@ -1,0 +1,175 @@
+package Text::Lorem;
+
+use strict;
+use warnings;
+use vars qw($VERSION);
+
+$VERSION = "0.3";
+
+my $lorem_singleton;
+
+sub new {
+  my $class = shift;
+  $lorem_singleton ||= bless {},$class;
+  return $lorem_singleton;
+}
+
+sub generate_wordlist {
+  my $self = shift;
+  [ map { s/\W//; lc($_) }split(/\s+/, <DATA>) ];
+}
+
+sub wordlist {
+  my $self = shift;
+  $self->{ wordlist } ||= $self->generate_wordlist();
+}
+
+sub wordcount {
+  my $self = shift;
+  return scalar(@{$self->{ wordlist }});
+}
+
+sub get_word {
+  my $self = shift;
+  return $self->wordlist->[ int( rand( $self->wordcount ) ) ];
+}
+
+sub words {
+  my $self = shift;
+  my $num  = shift;
+  my @words;
+  push @words, $self->get_word() for (1..$num);
+  return join(' ', @words);
+}
+
+sub get_sentence {
+  my $self = shift;
+  my $words = $self->words( 4 + int( rand( 6 ) ) );
+  ucfirst( $words );
+}
+
+sub sentences {
+  my $self = shift;
+  my $num = shift;
+  my @sentences;
+  push @sentences, $self->get_sentence for (1..$num);
+  join( '. ', @sentences ) . '.';
+}
+
+sub get_paragraph {
+  my $self = shift;
+  my $sentences = $self->sentences(3 + int( rand( 4 ) ) );
+  
+}
+
+sub paragraphs {
+  my $self = shift;
+  my $num = shift;
+  my @paragraphs;
+  push @paragraphs, $self->get_paragraph for (1..$num);
+  join( "\n\n", @paragraphs );
+}
+
+1;
+
+=pod
+
+=head1 NAME
+
+Text::Lorem - Generate random Latin looking text
+
+=head1 SYNOPSIS
+
+    use Text::Lorem;
+   
+    my $text = Text::Lorem->new();
+  
+    # Generate a string of text with 5 words
+    $words = $text->words(5);
+  
+    # Generate a string of text with 2 sentences
+    $sentences = $text->sentences(2);
+  
+    # Generate 3 paragraphs
+    $paragraphs = $text->paragraphs(3);
+
+=head1 DESCRIPTION
+
+Often when developing a website or other application it's important to have placeholders for content.  This module generates
+prescribed amounts of fake Latin text.
+
+=head1 CONSTRUCTOR
+
+=over 4
+
+=item C<new()>
+
+The default constructor, C<new()> takes no arguments and returns a Text::Lorem object.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item C<words( INTEGER )>
+
+Returns INTEGER fake Latin words.
+
+=item C<sentences( INTEGER )>
+
+Returns INTEGER sentences in fake Latin.
+
+=item C<paragraphs( INTEGER )>
+
+Returns INTEGER paragraphs of fake Latin text.
+
+=back
+
+=head1 THANKS
+
+Thanks to the guys who pushed me off the cliff called comfort and into the scary world of Perl: James Duncan, Leon Brocard.
+
+=head1 AUTHOR
+
+Adeola Awoyemi (adeola at fotango.com)
+
+=head1 SEE ALSO
+
+  L<WWW::Lipsum> and L<http://lipsum.com/>
+
+=head1 COPYRIGHT
+
+Copyright 2003 Fotango Ltd. All rights reserved. L<http://opensource.fotango.com/>
+This software is released under the same license as Perl itself.
+
+=cut
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+__DATA__
+alias consequatur aut perferendis sit voluptatem accusantium doloremque aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis Nemo enim ipsam voluptatem quia voluptas sit suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae  et iusto odio dignissimos ducimus qui blanditiis praesentium laudantium, totam rem voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, Sed ut perspiciatis unde omnis iste natus error similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo porro quisquam est, qui minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? At vero eos et accusamus officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores doloribus asperiores repellat.

Added: branches/upstream/libtext-lorem-perl/current/t/01_words.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/t/01_words.t?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/t/01_words.t (added)
+++ branches/upstream/libtext-lorem-perl/current/t/01_words.t Tue Jan  4 23:08:25 2011
@@ -1,0 +1,16 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 8;
+
+use_ok("Text::Lorem");
+ok( my $object = Text::Lorem->new(),            "Made a new object" );
+ok( my $words = $object->words(3),              "Got some words" );
+is( my @foo = split( /\s+/, $words ), 3,        "There were 3 words" );
+ok( my $sentences = $object->sentences(3),      "Got some sentences" );
+is( my @bar = split( /\./, $sentences ), 3,     "There were 3 sentences" );
+ok( my $paragraphs = $object->paragraphs(4),    "Got some paragraphs" );
+is( my @baz = split ( /\n\n/, $paragraphs ), 4, "There were 4 paragraphs" );
+

Added: branches/upstream/libtext-lorem-perl/current/t/02_singleton.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-lorem-perl/current/t/02_singleton.t?rev=66963&op=file
==============================================================================
--- branches/upstream/libtext-lorem-perl/current/t/02_singleton.t (added)
+++ branches/upstream/libtext-lorem-perl/current/t/02_singleton.t Tue Jan  4 23:08:25 2011
@@ -1,0 +1,12 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 5;
+
+use_ok("Text::Lorem");
+ok( my $object = Text::Lorem->new(),            "Made a new object" );
+ok( my $words = $object->words(3),              "Got some words" );
+ok( my $object_bis = Text::Lorem->new(),            "Made a new object" );
+ok( my $words_bis = $object_bis->words(3),              "Got some words" );




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