You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(381) |
Nov
(176) |
Dec
(310) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(334) |
Feb
(96) |
Mar
(149) |
Apr
(214) |
May
(120) |
Jun
(56) |
Jul
(10) |
Aug
(273) |
Sep
(182) |
Oct
(56) |
Nov
(125) |
Dec
(22) |
2003 |
Jan
(63) |
Feb
(181) |
Mar
(498) |
Apr
(433) |
May
(39) |
Jun
(512) |
Jul
(276) |
Aug
(156) |
Sep
(101) |
Oct
(66) |
Nov
(24) |
Dec
(161) |
2004 |
Jan
(1) |
Feb
(377) |
Mar
(68) |
Apr
(26) |
May
(107) |
Jun
(333) |
Jul
(13) |
Aug
|
Sep
(76) |
Oct
(88) |
Nov
(170) |
Dec
(91) |
2005 |
Jan
(52) |
Feb
(239) |
Mar
(402) |
Apr
(15) |
May
(2) |
Jun
(1) |
Jul
(13) |
Aug
|
Sep
(71) |
Oct
(34) |
Nov
|
Dec
|
2006 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(7) |
Oct
(2) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Salve J. N. <sj...@us...> - 2005-02-08 13:30:25
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9184/t Modified Files: config_package.t Log Message: Rename second use of @names to @alt_names Index: config_package.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/config_package.t,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** config_package.t 8 Feb 2005 01:48:21 -0000 1.10 --- config_package.t 8 Feb 2005 13:30:15 -0000 1.11 *************** *** 66,75 **** 'Foo Bar', 'Bar Foo (ba...@fo...)', ] ); ! my @names = $c->author_names; ! is( scalar @names, 2, 'Number of alt author names returned' ); ! is( $names[0], 'Foo Bar', 'First alt result from author_names()' ); ! is( $names[1], 'Bar Foo', 'Second alt result from author_names()' ); my @emails = $c->author_emails; --- 66,75 ---- 'Foo Bar', 'Bar Foo (ba...@fo...)', ] ); ! my @alt_names = $c->author_names; ! is( scalar @alt_names, 2, 'Number of alt author names returned' ); ! is( $alt_names[0], 'Foo Bar', 'First alt result from author_names()' ); ! is( $alt_names[1], 'Bar Foo', 'Second alt result from author_names()' ); my @emails = $c->author_emails; |
From: Salve J. N. <sj...@us...> - 2005-02-08 13:00:26
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29804/doc/Manual Modified Files: Changes.pod Log Message: minor POD error Index: Changes.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Changes.pod,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Changes.pod 8 Feb 2005 01:49:10 -0000 1.65 --- Changes.pod 8 Feb 2005 13:00:09 -0000 1.66 *************** *** 79,83 **** =back ! L<OpenInteract2::Manage::Package::Export =over 4 --- 79,83 ---- =back ! L<OpenInteract2::Manage::Package::Export> =over 4 |
From: Chris W. <la...@us...> - 2005-02-08 12:32:56
|
Update of /cvsroot/openinteract/OpenInteract2/sample/package_cpan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18594/package_cpan Added Files: module_include.t README Makefile.PL FILES Brick.pm App.pm Log Message: add files necessary to make a CPAN module from a package --- NEW FILE: module_include.t --- # -*-perl-*- use strict; use Test::More tests => [% package_modules.size + 2 %]; require_ok( '[% full_app_class %]' ); require_ok( '[% full_brick_class %]' ); [% FOREACH module = package_modules.sort -%] require_ok( '[% module %]' ); [% END -%] --- NEW FILE: README --- sample/package_cpan: The files here are used as templates for creating a new CPAN distribution from a package. NOTE: If you add a file here be sure to add an entry in FILES so we know it should be copied over to the dist when it's created. --- NEW FILE: Makefile.PL --- use ExtUtils::MakeMaker; my %opts = ( 'NAME' => '[% full_app_class %]', 'VERSION' => '[% package_version %]', 'PL_FILES' => {}, 'NO_META' => 1, 'PREREQ_PM' => { 'OpenInteract2::Action' => 1.66, # proxy for OI2 [% FOREACH module = required_modules -%] [% module %] => 0, [% END -%] }, ); if ( $ExtUtils::MakeMaker::VERSION >= 5.43 ) { $opts{AUTHOR} = '[% author_names.join( ', ' ) %]', $opts{ABSTRACT} = q{[% abstract %]}, } WriteMakefile( %opts ); --- NEW FILE: FILES --- Makefile.PL --> Makefile.PL App.pm --> lib OpenInteract2 App [% subclass %].pm Brick.pm --> lib OpenInteract2 Brick [% subclass %].pm module_include.t --> t 00_basic_include.t --- NEW FILE: Brick.pm --- package [% full_brick_class %]; use strict; use base qw( OpenInteract2::Brick ); use OpenInteract2::Exception; my %INLINED_SUBS = ( [% FOREACH file_info = package_files -%] '[% file_info.name %]' => '[% file_info.inline_name %]', [% END -%] ); sub get_name { return '[% package_name %]'; } sub get_resources { return ( [% FOREACH file_info = package_files -%] '[% file_info.name %]' => [ '[% file_info.destination %]', '[% file_info.evaluate %]' ], [% END -%] ); } sub load { my ( $self, $resource_name ) = @_; my $inline_sub_name = $INLINED_SUBS{ $resource_name }; unless ( $inline_sub_name ) { OpenInteract2::Exception->throw( "Resource name '$resource_name' not found ", "in ", ref( $self ), "; cannot load content." ); } return $self->$inline_sub_name(); } OpenInteract2::Brick->register_factory_type( get_name() => __PACKAGE__ ); =pod =head1 NAME [% full_brick_class %] - Installation data for OpenInteract2 package '[% package_name %]' =head1 SYNOPSIS oi2_manage install_package --package=[% package_name %] =head1 DESCRIPTION You generally don't use this class directly. See the docs for L<[% full_app_class %]> and L<OpenInteract2::Brick> for more. =head1 SEE ALSO L<[% full_app_class %]> =head1 COPYRIGHT Copyright (c) 2005 [% author_names.join( ', ' ) %]. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS [% FOREACH author_info = authors %] [% author_info.name %] E<lt>[% author_info.email %]E<gt> [% END %] =cut [% FOREACH file_info = package_files %] sub [% file_info.inline_name %] { return <<'SUPERLONGSTRING'; [% file_info.contents %] SUPERLONGSTRING } [% END %] --- NEW FILE: App.pm --- package [% full_app_class %]; use strict; use base qw( Exporter OpenInteract2::App ); use OpenInteract2::Manage; $[% full_app_class %]::VERSION = '[% package_version %]'; @[% full_app_class %]::EXPORT = qw( install ); sub get_brick_name { return '[% brick_name %]'; } # Not a method, just an exported sub sub install { my ( $website_dir ) = @_; my $manage = OpenInteract2::Manage->new( 'install_package' ); $manage->param( website_dir => $website_dir ); $manage->param( package_class => __PACKAGE__ ); return $manage->execute; } =pod [% package_pod %] =back |
From: Chris W. <la...@us...> - 2005-02-08 12:32:19
|
Update of /cvsroot/openinteract/OpenInteract2/sample/package_cpan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18377/package_cpan Log Message: Directory /cvsroot/openinteract/OpenInteract2/sample/package_cpan added to the repository |
From: Chris W. <la...@us...> - 2005-02-08 12:31:02
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17761 Modified Files: build_bricks BUILDING_FROM_CVS Log Message: OIN-124: fix order of build and add 'use lib' to build_bricks Index: build_bricks =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/build_bricks,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** build_bricks 8 Feb 2005 01:49:30 -0000 1.6 --- build_bricks 8 Feb 2005 12:30:50 -0000 1.7 *************** *** 7,10 **** --- 7,11 ---- use strict; + use lib qw( lib ); use File::Basename qw( basename ); use MIME::Base64 qw( encode_base64 ); Index: BUILDING_FROM_CVS =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/BUILDING_FROM_CVS,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BUILDING_FROM_CVS 8 Feb 2005 01:54:30 -0000 1.4 --- BUILDING_FROM_CVS 8 Feb 2005 12:30:51 -0000 1.5 *************** *** 10,15 **** > cd /path/to/OpenInteract2-CVS - > perl build_docs > perl build_bricks > perl Makefile.PL or perl Build.PL > make or ./Build --- 10,15 ---- > cd /path/to/OpenInteract2-CVS > perl build_bricks + > perl build_docs > perl Makefile.PL or perl Build.PL > make or ./Build *************** *** 31,50 **** But you'll run into two problems building from CVS vs. from a ! distribution. The first is related to documentation and the second to ! inlined resource files used to build packages and websites. ! ! ! Problem: Docs ! --------------- ! ! The OI2::Manual namespace is generated using the 'build_docs' command: ! ! > cd /path/to/OpenInteract-CVS ! > ./build_docs (or 'perl build docs') ! ! This also generates the docs for the OI website -- see the newly ! created 'site/docs' for the HTML documentation. Note that it has SSI ! directives embedded in it, but that's easy to work around if you need ! to... --- 31,36 ---- But you'll run into two problems building from CVS vs. from a ! distribution. The first is related to inlined resource files used to ! build packages and websites and the second to documentation. *************** *** 93,96 **** --- 79,96 ---- + Problem: Docs + --------------- + + The OI2::Manual namespace is generated using the 'build_docs' command: + + > cd /path/to/OpenInteract-CVS + > ./build_docs (or 'perl build docs') + + This also generates the docs for the OI website -- see the newly + created 'site/docs' for the HTML documentation. Note that it has SSI + directives embedded in it, but that's easy to work around if you need + to... + + Problem: SPOPS --------------- |
From: Chris W. <la...@us...> - 2005-02-08 01:57:50
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32167 Modified Files: MANIFEST Log Message: add ::CreateCPAN Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/MANIFEST,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** MANIFEST 2 Feb 2005 16:15:35 -0000 1.111 --- MANIFEST 8 Feb 2005 01:57:42 -0000 1.112 *************** *** 98,101 **** --- 98,102 ---- lib/OpenInteract2/Manage/Package.pm lib/OpenInteract2/Manage/Package/Check.pm + lib/OpenInteract2/Manage/Package/CreateCPAN.pm lib/OpenInteract2/Manage/Package/CreatePackage.pm lib/OpenInteract2/Manage/Package/Export.pm |
From: Chris W. <la...@us...> - 2005-02-08 01:56:41
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31915/lib/OpenInteract2/Manage Removed Files: CreateSourceDirectory.pm Log Message: OIN-121: no longer needed --- CreateSourceDirectory.pm DELETED --- |
From: Chris W. <la...@us...> - 2005-02-08 01:55:12
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31527 Modified Files: Build.PL Makefile.PL Log Message: remove File::DirSync as a dependency Index: Build.PL =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/Build.PL,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Build.PL 24 Jan 2005 17:25:14 -0000 1.22 --- Build.PL 8 Feb 2005 01:54:50 -0000 1.23 *************** *** 30,34 **** 'Email::Valid' => 0.12, 'Exception::Class' => 1.10, - 'File::DirSync' => 1.11, 'File::MMagic' => 0, 'Getopt::Long' => 2.32, --- 30,33 ---- Index: Makefile.PL =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/Makefile.PL,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Makefile.PL 24 Jan 2005 17:25:14 -0000 1.29 --- Makefile.PL 8 Feb 2005 01:54:50 -0000 1.30 *************** *** 31,35 **** 'Email::Valid' => 0.12, 'Exception::Class' => 1.10, - 'File::DirSync' => 1.11, 'File::MMagic' => 0, 'Getopt::Long' => 2.32, --- 31,34 ---- |
From: Chris W. <la...@us...> - 2005-02-08 01:54:40
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31456 Modified Files: BUILDING_FROM_CVS Log Message: OIN-124: update the build instructions to get rid of package building Index: BUILDING_FROM_CVS =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/BUILDING_FROM_CVS,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BUILDING_FROM_CVS 31 Jan 2005 14:06:46 -0000 1.3 --- BUILDING_FROM_CVS 8 Feb 2005 01:54:30 -0000 1.4 *************** *** 6,18 **** by-version distribution. ! Quick Help --------------- ! > cd /path/to/OpenInteract2-CVS/ > perl build_docs > perl build_bricks - > cd pkg/ - > ./export_all - > cd .. > perl Makefile.PL or perl Build.PL > make or ./Build --- 6,15 ---- by-version distribution. ! Quick Start --------------- ! > cd /path/to/OpenInteract2-CVS > perl build_docs > perl build_bricks > perl Makefile.PL or perl Build.PL > make or ./Build *************** *** 33,40 **** > make install or ./Build install ! But you'll run into three problems building from CVS vs. from a ! distribution. The first is related to documentation, the second to ! inlined resource files used to build packages and websites, and the ! third to package distributions. --- 30,36 ---- > make install or ./Build install ! But you'll run into two problems building from CVS vs. from a ! distribution. The first is related to documentation and the second to ! inlined resource files used to build packages and websites. *************** *** 67,123 **** This should output something like: ! Generated lib/OpenInteract2/Brick/Messages.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/WebsiteConfig.pm with 6 inlined files ! Generated lib/OpenInteract2/Brick/Daemon.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/Package.pm with 8 inlined files ! Generated lib/OpenInteract2/Brick/Apache.pm with 5 inlined files ! Generated lib/OpenInteract2/Brick/CGI.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/Widgets.pm with 57 inlined files ! Generated lib/OpenInteract2/Brick/Apache2.pm with 2 inlined files ! ! ! Problem: Packages ! --------------- ! ! When you check OpenInteract out from CVS you get all the packages ! distributed with OpenInteract in their respective directories. But ! they're not in the distribution (.zip) format that the build/test ! procedures expect. ! ! How do you know this has happened? You try to build OpenInteract in ! the normal Perl method and get something like the following: ! ! > perl Makefile.PL ! Checking if your kit is complete... ! Warning: the following files are missing in your kit: ! pkg/base-2.22.zip ! pkg/base_box-1.13.zip ! pkg/base_error-2.13.zip ! ... ! Please inform the author. ! Writing Makefile for OpenInteract ! ! To build the packages for the OI2 distribution (also necessary for ! testing), just run: ! ! > cd /path/to/OpenInteract-CVS/pkg ! > ./export_all ! ! This will result in a number of messages from the 'oi2_manage export_package' ! command to let you know whether there are too many or too few files in ! each package and the filename of the package written out. ! ! After running the command, you should have a number of .zip files in ! the pkg/ directory. Try to run the procedure from above again: ! ! > cd .. ! > make clean or ./Build realclean ! > perl Makefile.PL or perl Build.PL ! ! You should then see the pleasing: ! ! Checking if your kit is complete... ! Looks good ! Writing Makefile for OpenInteract Now you can go ahead and build the distribution and test it out --- 63,91 ---- This should output something like: ! Generated lib/OpenInteract2/Brick/Daemon.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/Package.pm with 8 inlined files ! Generated lib/OpenInteract2/Brick/Widgets.pm with 57 inlined files ! Generated lib/OpenInteract2/Brick/Apache.pm with 5 inlined files ! Generated lib/OpenInteract2/Brick/Messages.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/CGI.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/WebsiteConfig.pm with 6 inlined files ! Generated lib/OpenInteract2/Brick/PackageCPAN.pm with 4 inlined files ! Generated lib/OpenInteract2/Brick/Apache2.pm with 2 inlined files ! Generated lib/OpenInteract2/Brick/AppBase.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppBaseBox.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppBaseError.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppBaseGroup.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppBasePage.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppBaseSecurity.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppBaseTemplate.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppBaseTheme.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppBaseUser.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppComments.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppFullText.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppLookup.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppNews.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppObjectActivity.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppSystemDoc.pm with 1 inlined files ! Generated lib/OpenInteract2/Brick/AppWhatsNew.pm with 1 inlined files Now you can go ahead and build the distribution and test it out |
From: Chris W. <la...@us...> - 2005-02-08 01:49:38
|
Update of /cvsroot/openinteract/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30530 Modified Files: build_bricks Log Message: move the brick-generation template to OI2::Brick Index: build_bricks =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/build_bricks,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** build_bricks 2 Feb 2005 13:20:03 -0000 1.5 --- build_bricks 8 Feb 2005 01:49:30 -0000 1.6 *************** *** 9,23 **** use File::Basename qw( basename ); use MIME::Base64 qw( encode_base64 ); use Template; my %SPECS = ( 'sample/package' => [ ! 'Package', 'All resources used for creating a package', 'oi2_manage create_package --package=foo', 'This class just holds all the static resources used when creating a package.', ], 'sample/apache' => [ ! 'Apache', 'All resources used for creating Apache 1.x configurations in a new website', 'oi2_manage create_website --website_dir=/path/to/site', --- 9,30 ---- use File::Basename qw( basename ); use MIME::Base64 qw( encode_base64 ); + use OpenInteract2::Brick; use Template; my %SPECS = ( 'sample/package' => [ ! 'Package', 'package', 'All resources used for creating a package', 'oi2_manage create_package --package=foo', 'This class just holds all the static resources used when creating a package.', ], + 'sample/package_cpan' => [ + 'PackageCPAN', 'package_cpan', + 'All resources used for creating a CPAN distribution from a package', + 'oi2_manage create_cpan --package_dir=/path/to/mypackage', + 'This class just holds all the static resources used when creating a CPAN distribution from a package.', + ], 'sample/apache' => [ ! 'Apache', 'apache', 'All resources used for creating Apache 1.x configurations in a new website', 'oi2_manage create_website --website_dir=/path/to/site', *************** *** 26,30 **** ], 'sample/apache2' => [ ! 'Apache2', 'All resources used for creating Apache 2.x configurations in a new website', 'oi2_manage create_website --website_dir=/path/to/site', --- 33,37 ---- ], 'sample/apache2' => [ ! 'Apache2', 'apache2', 'All resources used for creating Apache 2.x configurations in a new website', 'oi2_manage create_website --website_dir=/path/to/site', *************** *** 33,37 **** ], 'sample/daemon' => [ ! 'Daemon', 'Configuration used for creating the standalone webserver', 'oi2_manage create_website --website_dir=/path/to/site', --- 40,44 ---- ], 'sample/daemon' => [ ! 'Daemon', 'daemon', 'Configuration used for creating the standalone webserver', 'oi2_manage create_website --website_dir=/path/to/site', *************** *** 39,43 **** ], 'sample/website/cgi-bin' => [ ! 'CGI', 'Script for running OI2 as a CGI', 'oi2_manage create_website --website_dir=/path/to/site', --- 46,50 ---- ], 'sample/website/cgi-bin' => [ ! 'CGI', 'cgi', 'Script for running OI2 as a CGI', 'oi2_manage create_website --website_dir=/path/to/site', *************** *** 45,49 **** ], 'sample/website/conf' => [ ! 'WebsiteConfig', 'Various non-server-specific configuration files for OI2 website', 'oi2_manage create_website --website_dir=/path/to/site', --- 52,56 ---- ], 'sample/website/conf' => [ ! 'WebsiteConfig', 'website_config', 'Various non-server-specific configuration files for OI2 website', 'oi2_manage create_website --website_dir=/path/to/site', *************** *** 51,55 **** ], 'sample/website/msg' => [ ! 'Messages', 'All global localization messages', 'oi2_manage create_website --website_dir=/path/to/site', --- 58,62 ---- ], 'sample/website/msg' => [ ! 'Messages', 'messages', 'All global localization messages', 'oi2_manage create_website --website_dir=/path/to/site', *************** *** 57,61 **** ], 'sample/website/template' => [ ! 'Widgets', 'All global TT2 template files', 'oi2_manage create_website --website_dir=/path/to/site', --- 64,68 ---- ], 'sample/website/template' => [ ! 'Widgets', 'widgets', 'All global TT2 template files', 'oi2_manage create_website --website_dir=/path/to/site', *************** *** 64,74 **** ); { unless ( -d 'sample' ) { die "You must run this from the root of the OI2 source directory\n"; } ! my $oi2_version = read_version(); my $template = Template->new(); - my $brick_template = join( '', <DATA> ); my @brick_params = (); --- 71,82 ---- ); + my ( $OI2_VERSION ); + { unless ( -d 'sample' ) { die "You must run this from the root of the OI2 source directory\n"; } ! $OI2_VERSION = read_version(); my $template = Template->new(); my @brick_params = (); *************** *** 77,88 **** my @brick_files = read_brick_files( $brick_dir ); my $brick_name = $brick_info->[0]; my %params = ( brick_dir => $brick_dir, brick_name => $brick_name, ! lc_brick_name => lc $brick_name, ! brick_summary => $brick_info->[1], ! brick_example => $brick_info->[2], ! brick_description => $brick_info->[3], ! oi2_version => $oi2_version, all_files => \@brick_files, ); --- 85,99 ---- my @brick_files = read_brick_files( $brick_dir ); my $brick_name = $brick_info->[0]; + my $full_description = join( "\n\n", + $brick_info->[4], get_oi2_version_description(), + ); + my %params = ( brick_dir => $brick_dir, brick_name => $brick_name, ! lc_brick_name => $brick_info->[1], ! brick_summary => $brick_info->[2], ! brick_example => $brick_info->[3], ! brick_description => $full_description, all_files => \@brick_files, ); *************** *** 92,108 **** # Now do the same with packages, but base64 them first... - my $pkg_desc = 'This class holds the Base64-encoded versions of ' . - 'package file "%s" shipped with OpenInteract2. Once you ' . - 'decode them you should store them as a ZIP file ' . - 'and then read them in with Archive::Zip or some ' . - 'other utility.'; my %pkg_brick_base = ( brick_dir => 'pkg', brick_name => 'App%s', - lc_brick_name => 'pkg_%s', brick_summary => "Base-64 encoded OI2 package '%s' shipped with distribution", brick_example => 'oi2_manage create_website --website_dir=/path/to/site', ! brick_description => $pkg_desc, ! oi2_version => $oi2_version, ); foreach my $pkg_file ( read_package_files( 'pkg/' ) ) { --- 103,112 ---- # Now do the same with packages, but base64 them first... my %pkg_brick_base = ( brick_dir => 'pkg', brick_name => 'App%s', brick_summary => "Base-64 encoded OI2 package '%s' shipped with distribution", brick_example => 'oi2_manage create_website --website_dir=/path/to/site', ! ); foreach my $pkg_file ( read_package_files( 'pkg/' ) ) { *************** *** 112,123 **** my $cc_base_name = ucfirst( $base_name ); $cc_base_name =~ s/_(\w)/uc($1)/ge; ! $pkg_brick{brick_name} = sprintf( ! $pkg_brick{brick_name}, $cc_base_name ); ! $pkg_brick{lc_brick_name} = sprintf( ! $pkg_brick{lc_brick_name}, $base_name ); ! $pkg_brick{brick_summary} = sprintf( ! $pkg_brick{brick_summary}, $pkg_file->{name} ); ! $pkg_brick{brick_description} = sprintf( ! $pkg_brick{brick_description}, $pkg_file->{name} ); $pkg_brick{all_files} = [ $pkg_file ]; push @brick_params, \%pkg_brick; --- 116,126 ---- my $cc_base_name = ucfirst( $base_name ); $cc_base_name =~ s/_(\w)/uc($1)/ge; ! my $pkg_brick_name = "pkg_$base_name"; ! $pkg_brick{brick_name} = sprintf( $pkg_brick{brick_name}, $cc_base_name ); ! $pkg_brick{lc_brick_name} = $pkg_brick_name; ! $pkg_brick{brick_summary} = sprintf( $pkg_brick{brick_summary}, $pkg_file->{name} ); ! $pkg_brick{brick_description} = get_package_description( ! $pkg_file->{name}, $pkg_brick_name ! ); $pkg_brick{all_files} = [ $pkg_file ]; push @brick_params, \%pkg_brick; *************** *** 130,134 **** --- 133,143 ---- } + my $brick_template = OpenInteract2::Brick->get_brick_class_template(); + foreach my $brick_param ( @brick_params ) { + $brick_param->{authors} = [ + { name => 'Chris Winters', email => 'ch...@cw...' }, + ]; + $brick_param->{author_names} = [ 'Chris Winters' ]; my $brick_name = $brick_param->{brick_name}; my $output_file = "$brick_lib_dir/$brick_name.pm"; *************** *** 184,190 **** open( ZIP, '<', $zipfile ) || die "Cannot read '$zipfile': $!"; ! my ( $buf, $content ); while ( read( ZIP, $buf, 60*57 ) ) { ! $content .= encode_base64( $buf ); } close( ZIP ); --- 193,199 ---- open( ZIP, '<', $zipfile ) || die "Cannot read '$zipfile': $!"; ! my ( $buf, @contents ); while ( read( ZIP, $buf, 60*57 ) ) { ! push @contents, encode_base64( $buf ); } close( ZIP ); *************** *** 195,201 **** destination => "pkg $base_filename", evaluate => 'no', ! contents => $content, }; } return @specs; } --- 204,211 ---- destination => "pkg $base_filename", evaluate => 'no', ! contents => join( '', @contents ), }; } + return @specs; } *************** *** 217,292 **** } ! __DATA__ ! package OpenInteract2::Brick::[% brick_name %]; ! ! use strict; ! use base qw( OpenInteract2::Brick ); ! use OpenInteract2::Exception; ! ! my %INLINED_SUBS = ( ! [% FOREACH file_info = all_files -%] ! '[% file_info.name %]' => '[% file_info.inline_name %]', ! [% END -%] ! ); ! ! sub get_name { ! return '[% lc_brick_name %]'; ! } ! ! sub get_resources { ! return ( ! [% FOREACH file_info = all_files -%] ! '[% file_info.name %]' => [ '[% file_info.destination %]', '[% file_info.evaluate %]' ], ! [% END -%] ! ); ! } ! ! sub load { ! my ( $self, $resource_name ) = @_; ! my $inline_sub_name = $INLINED_SUBS{ $resource_name }; ! unless ( $inline_sub_name ) { ! OpenInteract2::Exception->throw( ! "Resource name '$resource_name' not found ", ! "in ", ref( $self ), "; cannot load content." ); ! } ! return $self->$inline_sub_name(); ! } ! ! OpenInteract2::Brick->register_factory_type( get_name() => __PACKAGE__ ); ! ! =pod ! ! =head1 NAME ! ! OpenInteract2::Brick::[% brick_name %] - [% brick_summary %] ! ! =head1 SYNOPSIS ! ! [% brick_example | indent(2) %] ! ! =head1 DESCRIPTION ! ! [% brick_description %] ! ! These resources are associated with OpenInteract2 version [% oi2_version %]. ! =head1 COPYRIGHT ! Copyright (c) 2005 Chris Winters. All rights reserved. ! This library is free software; you can redistribute it and/or modify ! it under the same terms as Perl itself. ! =head1 AUTHORS ! Chris Winters E<lt>ch...@cw...E<gt> ! =cut ! [% FOREACH file_info = all_files %] ! sub [% file_info.inline_name %] { ! return <<'SOMELONGSTRING'; ! [% file_info.contents %] ! SOMELONGSTRING } - [% END %] --- 227,261 ---- } ! sub get_package_description { ! my ( $pkg_file, $pkg_brick_name ) = @_; ! my $version_info = get_oi2_version_description(); ! return sprintf( <<'DESC', $pkg_file, $pkg_brick_name, $version_info ); ! Are you sure you even need to be reading this? If you are just looking ! to install a package just follow the instructions from the SYNOPSIS. ! Still here? This class holds the Base64-encoded versions of package ! file "%s" shipped with OpenInteract2. Once you decode them you ! should store them as a ZIP file and then read them in with ! Archive::Zip or some other utility. ! A typical means to do this is: ! my $brick = OpenInteract2::Brick->new( '%s' ); ! # there's only one resource in this brick... ! my ( $pkg_name ) = $brick->list_resources; ! my $pkg_info = $brick->load_resource( $pkg_name ); ! my $pkg_file = OpenInteract2::Util->decode_base64_and_store( ! \$pkg_info->{content} ! ); ! # $pkg_file now references a file on the filesystem that you can ! # manipulate as normal ! %s ! DESC ! } ! sub get_oi2_version_description { ! return "These resources are associated with OpenInteract2 version $OI2_VERSION."; } |
From: Chris W. <la...@us...> - 2005-02-08 01:49:18
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30481/doc/Manual Modified Files: Changes.pod Log Message: latest changes Index: Changes.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Changes.pod,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Changes.pod 2 Feb 2005 13:24:08 -0000 1.64 --- Changes.pod 8 Feb 2005 01:49:10 -0000 1.65 *************** *** 56,59 **** --- 56,70 ---- =head2 Minor Changes + L<OpenInteract2::Config> + + =over 4 + + =item * + + Add C<author_names()> and C<author_emails()> to pull the names and + emails from the 'author' key. + + =back + L<OpenInteract2::Context> *************** *** 92,95 **** --- 103,117 ---- files are formatted so we can extract a language from them. + =item * + + Add simple method C<name_as_class()> to display the package name with + a leading uppercase letter and camel-case internally. + + =item * + + Add method C<copy_contents_to()> for copying the contents of a package + to a directory, reporting what files it copied and what files were not + because they were identical. + =back *************** *** 103,106 **** --- 125,132 ---- arbitrary data. + =item * + + Added C<is_same_file( $path_a, $path_b )>. + =back |
From: Chris W. <la...@us...> - 2005-02-08 01:48:31
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30324/t Modified Files: config_package.t Log Message: check the author_names(), author_emails() Index: config_package.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/config_package.t,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** config_package.t 26 Sep 2004 16:06:01 -0000 1.9 --- config_package.t 8 Feb 2005 01:48:21 -0000 1.10 *************** *** 6,10 **** use lib 't/'; require 'utils.pl'; ! use Test::More tests => 26; my $package = 'OITest'; --- 6,10 ---- use lib 't/'; require 'utils.pl'; ! use Test::More tests => 38; my $package = 'OITest'; *************** *** 35,38 **** --- 35,52 ---- is_deeply( $c->author( \@author ), \@author, 'Authors set' ); + my @names = $c->author_names; + is( scalar @names, 2, + 'Number of author names returned' ); + is( $names[0], 'Me', + 'First result from author_names()' ); + is( $names[1], 'You', + 'Second result from author_names()' ); + my @emails = $c->author_emails; + is( scalar @emails, 2, + 'Number of author emails returned' ); + is( $emails[0], 'me...@me...', + 'First result from author_emails()' ); + is( $emails[1], 'yo...@yo...', + 'Second result from author_emails()' ); is_deeply( $c->template_plugin( \%plugin ), \%plugin, 'Plugin set' ); *************** *** 47,50 **** --- 61,84 ---- is( $c->description( $description ), $description, 'Description set' ); + + # check alternate author formattings + $c->author( [ + 'Foo Bar', 'Bar Foo (ba...@fo...)', + ] ); + my @names = $c->author_names; + is( scalar @names, 2, + 'Number of alt author names returned' ); + is( $names[0], 'Foo Bar', + 'First alt result from author_names()' ); + is( $names[1], 'Bar Foo', + 'Second alt result from author_names()' ); + my @emails = $c->author_emails; + is( scalar @emails, 2, + 'Number of author emails returned' ); + is( $emails[0], '', + 'First alt result from author_emails()' ); + is( $emails[1], 'ba...@fo...', + 'Second alt result from author_emails()' ); + my $write_file = get_use_file( 'test-write_package.conf', 'name' ); is( $c->filename( $write_file ), $write_file, |
From: Chris W. <la...@us...> - 2005-02-08 01:47:12
|
Update of /cvsroot/openinteract/OpenInteract2/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30119/script Modified Files: oi2_manage Log Message: dereference the debugging flag so we can actually use it Index: oi2_manage =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/script/oi2_manage,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** oi2_manage 25 Jan 2005 02:48:10 -0000 1.30 --- oi2_manage 8 Feb 2005 01:46:58 -0000 1.31 *************** *** 145,148 **** --- 145,151 ---- delete @OPT{ qw( help man status task ) }; + # derefrence the debug entry + $OPT{debug} = $OPT_debug; + my $task = eval { OpenInteract2::Manage->new( $task_name, \%OPT ) }; if ( $@ ) { |
From: Chris W. <la...@us...> - 2005-02-08 01:45:08
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_page/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29705/pkg/base_page/doc Modified Files: base_page.pod Log Message: cosmetic Index: base_page.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_page/doc/base_page.pod,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** base_page.pod 8 Jul 2003 12:04:48 -0000 1.2 --- base_page.pod 8 Feb 2005 01:44:59 -0000 1.3 *************** *** 295,303 **** sub my_index { ! my ( $self ) = @_; ! my %params = ( page_directory => $self->param( 'page_directory' ), ! directory => $self->param( 'directory' ) ); ! return $self->generate_content( \%params, ! { name => 'mypkg::my_index' } ); } ------------------------------ --- 295,306 ---- sub my_index { ! my ( $self ) = @_; ! my %params = ( ! page_directory => $self->param( 'page_directory' ), ! directory => $self->param( 'directory' ) ! ); ! return $self->generate_content( \%params, { ! name => 'mypkg::my_index' ! } ); } ------------------------------ *************** *** 309,313 **** ------------------------------ <h1>Sample handler</h1> ! <p>A directory index request was made for [% directory %] and the handler was registered for the directory [% page_directory.directory %] and --- 312,316 ---- ------------------------------ <h1>Sample handler</h1> ! <p>A directory index request was made for [% directory %] and the handler was registered for the directory [% page_directory.directory %] and *************** *** 351,355 **** ------------------------------ <h1>Sample handler</h1> ! <p>A directory index request was made for /mysampledir and the handler was registered for the directory /mysampledir/ and --- 354,358 ---- ------------------------------ <h1>Sample handler</h1> ! <p>A directory index request was made for /mysampledir and the handler was registered for the directory /mysampledir/ and *************** *** 365,369 **** ------------------------------ <h1>Sample handler</h1> ! <p>A directory index request was made for /mysampledir/subdir/ and the handler was registered for the directory /mysampledir/ and --- 368,372 ---- ------------------------------ <h1>Sample handler</h1> ! <p>A directory index request was made for /mysampledir/subdir/ and the handler was registered for the directory /mysampledir/ and *************** *** 373,380 **** Sweet! - =head1 BUGS - - None known. - =head1 TO DO --- 376,379 ---- |
From: Chris W. <la...@us...> - 2005-02-08 01:44:20
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29594/lib/OpenInteract2/Manage/Website Modified Files: Upgrade.pm Log Message: move the file copy status up to OI2::Manage Index: Upgrade.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/Upgrade.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Upgrade.pm 2 Feb 2005 16:16:52 -0000 1.16 --- Upgrade.pm 8 Feb 2005 01:44:06 -0000 1.17 *************** *** 50,74 **** my $brick = OpenInteract2::Brick->new( 'widgets' ); my $status = $brick->copy_all_resources_to( $website_dir ); ! foreach my $file ( @{ $status->{copied} } ) { ! $self->_ok( ! 'copy updated template files', ! "File $file copied", ! filename => $file ! ); ! } ! foreach my $file ( @{ $status->{skipped} } ) { ! $self->_ok( ! 'copy updated template files', ! "File $file skipped, marked as read-only", ! filename => $file ! ); ! } ! foreach my $file ( @{ $status->{same} } ) { ! $self->_ok( ! 'copy updated template files', ! "File $file skipped, source and destination same", ! filename => $file ! ); ! } $self->notify_observers( progress => 'Widget copy complete' ); } --- 50,54 ---- my $brick = OpenInteract2::Brick->new( 'widgets' ); my $status = $brick->copy_all_resources_to( $website_dir ); ! $self->_set_file_copy_status( $status ); $self->notify_observers( progress => 'Widget copy complete' ); } |
From: Chris W. <la...@us...> - 2005-02-08 01:39:04
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28477/lib/OpenInteract2/Manage/Website Modified Files: UpdatePackageFromWebsite.pm Log Message: get rid of File::DirSync and use the newly-created method from OI2::Package to copy the files over Index: UpdatePackageFromWebsite.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/UpdatePackageFromWebsite.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UpdatePackageFromWebsite.pm 2 Feb 2005 16:17:27 -0000 1.3 --- UpdatePackageFromWebsite.pm 8 Feb 2005 01:38:52 -0000 1.4 *************** *** 5,9 **** use strict; use base qw( OpenInteract2::Manage::Website ); - use File::DirSync; use File::Spec::Functions qw( catfile ); use OpenInteract2::Context qw( CTX ); --- 5,8 ---- *************** *** 102,123 **** sub _sync_dirs { my ( $self ) = @_; - my $package = $self->param( 'package_object' ); ! my $site_package_dir = $package->directory; ! ! my $dirsync = File::DirSync->new({ ! src => $site_package_dir, ! dst => $self->param( 'package_dir' ), ! verbose => 0, ! nocache => 0, ! localmode => 0, ! }); ! $dirsync->ignore( 'CVS' ); ! $dirsync->ignore( '.svn' ); ! $dirsync->dirsync(); ! $self->_add_status( ! $self->_create_sync_status( $dirsync, $site_package_dir ) ! ); ! return 1; } --- 101,108 ---- sub _sync_dirs { my ( $self ) = @_; my $package = $self->param( 'package_object' ); ! my $source_dir = $package->directory; ! my $status = $package->copy_contents_to( $self->param( 'package_dir' ) ); ! $self->_set_copy_file_status( $status ); } *************** *** 125,131 **** my ( $self ) = @_; my $action = 'write changelog'; - my $package = $self->param( 'package_object' ); - my $changes = OpenInteract2::Config::PackageChanges->new({ package => $package, --- 110,114 ---- |
From: Chris W. <la...@us...> - 2005-02-08 01:38:03
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28263/lib/OpenInteract2/Manage/Website Modified Files: Create.pm Log Message: cosmetic (renamed one of the bricks) Index: Create.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/Create.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Create.pm 2 Feb 2005 16:16:52 -0000 1.28 --- Create.pm 8 Feb 2005 01:37:54 -0000 1.29 *************** *** 112,116 **** $self->_copy_from_bricks( $website_dir, 'apache', 'apache2', 'cgi', 'daemon', ! 'messages', 'websiteconfig', 'widgets' ); $self->notify_observers( progress => 'All files from sample website copied' ); --- 112,116 ---- $self->_copy_from_bricks( $website_dir, 'apache', 'apache2', 'cgi', 'daemon', ! 'messages', 'website_config', 'widgets' ); $self->notify_observers( progress => 'All files from sample website copied' ); |
From: Chris W. <la...@us...> - 2005-02-08 01:37:28
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28131/lib/OpenInteract2/Manage/Package Added Files: CreateCPAN.pm Log Message: OIN-72: add new management task to create CPAN-distributable tarball --- NEW FILE: CreateCPAN.pm --- package OpenInteract2::Manage::Package::CreateCPAN; # $Id: CreateCPAN.pm,v 1.1 2005/02/08 01:37:18 lachoy Exp $ use strict; use base qw( OpenInteract2::Manage::Package ); use Cwd qw( cwd ); use ExtUtils::Manifest; use File::Basename qw( dirname ); use File::Copy qw( cp ); use File::Path qw( mkpath rmtree ); use File::Spec::Functions qw( catfile ); use Log::Log4perl qw( get_logger ); use MIME::Base64 qw( encode_base64 ); use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); use OpenInteract2::Exception qw( oi_error ); $OpenInteract2::Manage::Package::CreateCPAN::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); my @BINARIES = qw( gz zip gif png jpg ico pdf doc ); my $DIST_DIR = "tmp-build-cpan"; sub get_name { return 'create_cpan'; } sub get_brief_description { return 'Create a CPAN distribution from your package.'; } sub get_parameters { my ( $self ) = @_; return { package_dir => { description => q{Directory of package to export (default: pwd)}, default => cwd(), is_required => 'yes', }, make_bin => { description => q{Binary for your "make" implementation (default: 'make')}, default => 'make', is_required => 'yes', }, keep_dir => { description => q{If set to "yes" we keep the generated CPAN directory (default: 'no')}, default => 'no', is_required => 'yes', }, }; } sub validate_param { my ( $self, $name, $value ) = @_; if ( $name eq 'package_dir' ) { return $self->_check_package_dir( $value ); } return $self->SUPER::validate_param( $name, $value ); } sub tear_down_task { my ( $self ) = @_; my $keep_dir = lc $self->param( 'keep_dir' ); if ( -d $DIST_DIR && $keep_dir ne 'yes' ) { rmtree( $DIST_DIR ); } } sub run_task { my ( $self ) = @_; my $package_dir = $self->param( 'package_dir' ); my $package = OpenInteract2::Package->new({ directory => $package_dir }); my $subclass_name = $package->name_as_class; my $app_class_name = "OpenInteract2::App::$subclass_name"; my $brick_class_name = "OpenInteract2::Brick::$subclass_name"; my $config = $package->config; my $modules = $config->module || []; my @author_names = join( ', ', $config->author_names ); my @author_emails = join( ', ', $config->author_emails ); my ( @authors ); for ( 0..scalar @author_names ) { push @authors, { name => $author_names[$_], email => $author_emails[$_] }; } $self->_create_dist_dir(); my $module_file_specs = $package->get_module_files; my @module_files = map { join( '/', @{ $_ } ) } @{ $module_file_specs }; my @package_modules = $self->_copy_package_modules( $package, \@module_files ); my @brick_files = $self->_read_files_for_brick( $package, \@module_files ); my %replacements = ( package_name => $package->name, brick_name => $package->name, full_app_class => $app_class_name, full_brick_class => $brick_class_name, subclass => $subclass_name, authors => \@authors, author_names => \@author_names, abstract => $config->description, required_modules => $modules, package_modules => \@package_modules, package_version => $package->version, package_files => \@brick_files, package_pod => '', ); my $brick = OpenInteract2::Brick->new( 'package_cpan' ); $brick->copy_all_resources_to( $DIST_DIR, \%replacements ); my $dist_file = $self->_create_distribution( $subclass_name ); $self->_ok( 'create CPAN distribution', 'Created distribution ok', filename => $dist_file, ); } sub _create_dist_dir { my ( $self ) = @_; if ( -d $DIST_DIR ) { my $num_removed = rmtree( $DIST_DIR ); unless ( $num_removed > 0 ) { oi_error "Failed to remove directory '$DIST_DIR'; please ", "remove manually and re-run task."; } } mkdir( $DIST_DIR ) || oi_error "Cannot create temporary directory '$DIST_DIR': $!"; } # copy modules into cpan dist dir sub _copy_package_modules { my ( $self, $package, $module_files ) = @_; my $package_dir = $package->directory; my @package_modules = (); foreach my $file ( @{ $module_files } ) { my $full_src = catfile( $package_dir, $file ); my $full_dest = catfile( $DIST_DIR, 'lib', $file ); my $dest_dir = dirname( $full_dest ); unless ( -d $dest_dir ) { mkpath( $dest_dir ); } cp( $full_src, $full_dest ) || oi_error "Cannot copy '$full_src' to '$full_dest': $!"; my $module = $file; $module =~ s/\.pm$//; $module =~ s|/|::|g; push @package_modules, $module; } return @package_modules; } # copy non-modules files into brick as resources sub _read_files_for_brick { my ( $self, $package, $module_files ) = @_; my @brick_files = (); my $package_dir = $package->directory; my %module_check = map { $_ => 1 } @{ $module_files }; my %seen_names = (); my $package_files = $package->get_files; foreach my $file ( @{ $package_files } ) { next if ( $module_check{ $file } ); # modules are separate my @file_pieces = split /\//, $file; my $brick_name = $file_pieces[-1]; if ( $seen_names{ $brick_name } ) { $brick_name = join ( '_', @file_pieces ); } $seen_names{ $brick_name }++; my $inline_name = uc( $brick_name ); $inline_name =~ s/\W/_/g; push @brick_files, { name => $brick_name, inline_name => $inline_name, destination => join( ' ', @file_pieces ), evaluate => 'no', contents => $self->_read_package_file_contents( $package_dir, $file ), }; } return @brick_files; } sub _read_package_file_contents { my ( $self, $package_dir, $file ) = @_; my $full_path = catfile( $package_dir, $file ); my $binary_pat = join( '|', @BINARIES ); if ( $full_path =~ /$binary_pat$/ ) { open( IN, '<', $full_path ) || oi_error "Cannot read '$full_path': $!"; my @content = (); my ( $buf ); while ( read( IN, $buf, 60*57 ) ) { push @content, encode_base64( $buf ); } return join( ', ', @content ); } else { return OpenInteract2::Util->read_file( $full_path ); } } sub _create_distribution { my ( $self, $subclass_name ) = @_; chdir( $DIST_DIR ); ExtUtils::Manifest::mkmanifest(); my ( $dist_file ); eval { do './Makefile.PL'; my $make_cmd = $self->param( 'make_bin' ); system( $make_cmd, 'dist' ); opendir( ARCHIVE, '.' ) || die "Cannot open current directory for reading: $!\n"; ( $dist_file ) = grep /$subclass_name/, grep /\.tar\.gz$/, readdir( ARCHIVE ); closedir( ARCHIVE ); rename( $dist_file, catfile( '..', $dist_file ) ) || die "Cannot move archive: $!\n"; chdir( '..' ); }; if ( $@ ) { chdir( '..' ); oi_error( $@ ); } return $dist_file; } OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ ); 1; __END__ =head1 NAME OpenInteract2::Manage::Package::CreateCPAN - Create a CPAN distribution from a package =head1 SYNOPSIS # From command-line: $ oi2_manage create_cpan # Programmatically: #!/usr/bin/perl use strict; use OpenInteract2::Manage; my $website_dir = '/home/httpd/mysite'; my %PARAMS = ( package_dir = '/path/to/my/package' ); my $task = OpenInteract2::Manage->new( 'create_cpan', \%PARAMS ); my @status = $task->execute; foreach my $s ( @status ) { my $ok_label = ( $s->{is_ok} eq 'yes' ) ? 'OK' : 'NOT OK'; print "Status? $ok_label\n", "$s->{message}\n"; } =head1 DESCRIPTION This task creates a CPAN distribution from your package contents and metadata. You should be able to send the generated distribution to anyone else for them to run the standard install: perl Makefile.PL make make test make install For installing directly to a webserver you can do: perl Makefile.PL WEBSITE_DIR=/path/to/mysite make make test make install And the files will be copied to the right place. =head1 OPTIONS =head2 Required =over 4 =item B<package_dir>=/path/to/package Path to your package; defaults to current directory if not given. =item B<make_bin>=nmake Name of your 'make' command; defaults to 'make' if not given. =back =head2 Optional =over 4 =item B<keep_dir>=yes/no Whether to keep the directory we use to create the CPAN package; defaults to 'no'. =back =head1 STATUS INFORMATION Includes no additional status information. =head1 COPYRIGHT Copyright (C) 2005 Chris Winters. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS Chris Winters, E<lt>ch...@cw...E<gt> |
From: Chris W. <la...@us...> - 2005-02-08 01:29:13
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Package In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25910/lib/OpenInteract2/Manage/Package Modified Files: Export.pm Log Message: move up to parent Index: Export.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Package/Export.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Export.pm 26 Jan 2005 02:36:10 -0000 1.14 --- Export.pm 8 Feb 2005 01:28:58 -0000 1.15 *************** *** 41,58 **** } - # We only want to see if 'package_dir' contains a package if the - # 'package' parameter is not defined - - sub _check_package_dir { - my ( $self, $package_dir ) = @_; - unless ( -d $package_dir ) { - return "Value for 'package_dir' [$package_dir] is not " . - "a valid directory"; - } - my $packages = $self->param( 'package' ) || []; - return if ( scalar @{ $packages } > 0 ); - return $self->_package_in_dir( $package_dir ); - } - sub run_task { my ( $self ) = @_; --- 41,44 ---- |
From: Chris W. <la...@us...> - 2005-02-08 01:28:43
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25783/lib/OpenInteract2/Manage Modified Files: Package.pm Log Message: pull up a subclass implementation for others to use (_check_package_dir()) Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Package.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Package.pm 17 Feb 2004 04:30:20 -0000 1.14 --- Package.pm 8 Feb 2005 01:28:34 -0000 1.15 *************** *** 35,38 **** --- 35,51 ---- } + # We only want to see if 'package_dir' contains a package if the + # 'package' parameter is not defined + + sub _check_package_dir { + my ( $self, $package_dir ) = @_; + unless ( -d $package_dir ) { + return "Value given for 'package_dir' ($package_dir) is not " . + "a valid directory"; + } + my $packages = $self->param( 'package' ) || []; + return if ( scalar @{ $packages } > 0 ); + return $self->_package_in_dir( $package_dir ); + } # Test whether directory $package_dir is actually a package directory |
From: Chris W. <la...@us...> - 2005-02-08 01:27:34
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25454/lib/OpenInteract2/Config Modified Files: Package.pm Log Message: add author_names() and author_emails() Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config/Package.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Package.pm 25 Jan 2005 02:47:24 -0000 1.20 --- Package.pm 8 Feb 2005 01:27:23 -0000 1.21 *************** *** 100,103 **** --- 100,136 ---- + sub author_names { + my ( $self ) = @_; + my ( $names, $emails ) = $self->_parse_authors; + return @{ $names }; + } + + sub author_emails { + my ( $self ) = @_; + my ( $names, $emails ) = $self->_parse_authors; + return @{ $emails }; + } + + sub _parse_authors { + my ( $self ) = @_; + my $authors = $self->author; + return ( [], [] ) unless ( ref $authors ); + my @names = (); + my @emails = (); + foreach my $author ( @{ $authors } ) { + my ( $name, $d1, $email, $d2 ) = $author =~ /^([\w\s]+)(\(|<)\s*(.*)\s*(\)|>)\s*$/; + # ...they didn't put an email in + unless ( $name ) { + $name = $author; + $email = ''; + } + $name =~ s/^\s+//; + $name =~ s/\s+$//; + push @names, $name; + push @emails, $email; + } + return ( \@names, \@emails ); + } + sub get_spops_files { my ( $self ) = @_; *************** *** 414,417 **** --- 447,460 ---- Returns: object + B<author_names()> + + Returns a list of all author names pulled out of the 'author' + property. + + B<author_emails()> + + Returns a list of all author emails pulled out of the 'author' + property. + B<get_spops_files()> |
From: Chris W. <la...@us...> - 2005-02-08 01:12:53
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19832/lib/OpenInteract2 Modified Files: Util.pm Log Message: add 'read_file()' (just a slurp) and 'is_same_file()' comparison Index: Util.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Util.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Util.pm 2 Feb 2005 13:12:14 -0000 1.18 --- Util.pm 8 Feb 2005 01:12:35 -0000 1.19 *************** *** 60,63 **** --- 60,75 ---- # FILE ROUTINES + sub read_file { + my ( $class, $filename ) = @_; + unless ( -f $filename ) { + oi_error "Cannot open '$filename': file does not exist"; + } + open( MOD, '<', $filename ) + || oi_error "Cannot read '$filename': $!"; + my $contents = join( '', <MOD> ); + close( MOD ); + return $contents; + } + sub read_file_lines { my ( $class, $filename ) = @_; *************** *** 104,107 **** --- 116,130 ---- } + sub is_same_file { + my ( $class, $src_file, $dest_file ) = @_; + return 0 unless ( -f $src_file and -f $dest_file ); + my $src_size = (stat( $src_file ))[7]; + my $dest_size = (stat( $dest_file ))[7]; + return 0 unless ( $src_size == $dest_size ); + my $src_md5 = $class->digest_file( $src_file ); + my $dest_md5 = $class->digest_file( $dest_file ); + return ( $src_md5 eq $dest_md5 ); + } + sub digest_file { my ( $class, $file ) = @_; *************** *** 404,407 **** --- 427,434 ---- =head1 FILE METHODS + B<read_file( $filename )> + + Slurps in C<$filename> to scalar, returns contents. + B<read_file_lines( $filename )> *************** *** 413,416 **** --- 440,449 ---- Returns content of C<$flename> evaluated as a Perl data structure. + B<is_same_file( $path_a, $path_b )> + + Returns result of comparing content in C<$path_a> and content in + C<$path_b> -- that is, if their file sizes are equal and both have the + same MD5 digest value this will return true, otherwise false. + B<digest_file( $filename )> |
From: Chris W. <la...@us...> - 2005-02-08 01:11:37
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19575/lib/OpenInteract2 Modified Files: Setup.pm Log Message: just add a 'use' Index: Setup.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup.pm,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Setup.pm 28 Jan 2005 14:00:25 -0000 1.58 --- Setup.pm 8 Feb 2005 01:11:27 -0000 1.59 *************** *** 13,16 **** --- 13,17 ---- use OpenInteract2::Setup::DependencySource; use OpenInteract2::URL; # don't get rid of this... + use OpenInteract2::Util; $OpenInteract2::Setup::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); |
From: Chris W. <la...@us...> - 2005-02-08 01:10:57
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19431/lib/OpenInteract2 Modified Files: Package.pm Log Message: add name_as_class() (small) and copy_contents_to() (larger) Index: Package.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Package.pm,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Package.pm 2 Feb 2005 15:47:21 -0000 1.46 --- Package.pm 8 Feb 2005 01:10:41 -0000 1.47 *************** *** 11,15 **** use File::Basename qw( basename dirname ); use File::Copy qw( cp ); ! use File::Path (); use File::Spec::Functions qw( :ALL ); use File::Temp qw( tempdir ); --- 11,15 ---- use File::Basename qw( basename dirname ); use File::Copy qw( cp ); ! use File::Path qw( mkpath ); use File::Spec::Functions qw( :ALL ); use File::Temp qw( tempdir ); *************** *** 167,170 **** --- 167,178 ---- } + sub name_as_class { + my ( $self, $name ) = @_; + $name ||= $self->name; + my $class_name = ucfirst $name; + $class_name =~ s/_(\w)/\U$1\U/g; + return $class_name; + } + # don't use split here since the package name might have a '-' in it # (shouldn't happen, but still) *************** *** 433,436 **** --- 441,471 ---- + ######################################## + # COPY PACKAGE FILES + + sub copy_contents_to { + my ( $self, $dest_dir ) = @_; + my $src_dir = $self->directory; + my @copied = (); + my @same = (); + foreach my $file ( @{ $self->get_files } ) { + my $src_path = catfile( $src_dir, $file ); + my $dest_path = catfile( $dest_dir, $file ); + if ( OpenInteract2::Util->is_same_file( $src_path, $dest_path ) ) { + push @same, $file; + } + else { + $self->_create_full_path( $dest_path ); + cp( $src_path, $dest_path ) + || oi_error "Cannot copy '$src_path' -> '$dest_path': $!"; + push @copied, $file; + } + } + return { + copied => \@copied, + same => \@same, + }; + } + ######################################## *************** *** 574,578 **** # operation fails -- you don't need '|| die $!' ! File::Path::mkpath( $dirname, undef, 0755 ); return 1; --- 609,613 ---- # operation fails -- you don't need '|| die $!' ! mkpath( $dirname, undef, 0755 ); return 1; *************** *** 842,850 **** require OpenInteract2::Brick; my $brick = OpenInteract2::Brick->new( 'package' ); ! my $class_name = ucfirst $name; ! $class_name =~ s/_(\w)/\U$1\U/g; return $brick->copy_all_resources_to( $dest_dir, { package_name => $name, ! class_name => $class_name }); } --- 877,884 ---- require OpenInteract2::Brick; my $brick = OpenInteract2::Brick->new( 'package' ); ! my $class_name = $class->name_as_class( $name ); return $brick->copy_all_resources_to( $dest_dir, { package_name => $name, ! class_name => $class_name, }); } *************** *** 1499,1502 **** --- 1533,1549 ---- # Name: foo-1.52 + B<name_as_class()> + + Displays the package name as suitable for a class: leading uppercase + with camel-case internally replacing all underscores. For instance: + + $package->name( 'foo' ); + print "Class name: ", $package->name_as_class; + # Class name: Foo + + $package->name( 'music_listener' ); + print "Class name: ", $package->name_as_class; + # Class name: MusicListener + B<get_files( [ $force_read ] )> *************** *** 1522,1525 **** --- 1569,1591 ---- Returns: the full path to the distribution file created. + See also: L<OpenInteract2::Manage::Package::CreateCPAN> for creating a + CPAN distribution from your package. + + B<copy_contents_to( $destination_dir )> + + Copies all files from this package (those identified in 'MANIFEST') to + C<$destination_dir>. If C<$destination_dir> does not exist we create + it; if it does exist we overwrite any different files that match the + paths from the source package. ('Different' means the files must be of + a different size and have a different MD5 digest.) + + You typically want to use this for copying a package installed to a + website to another package -- for syncing up a directory it would + probably be faster to just use L<Archive::Zip>. + + Returns: hashref with two keys, 'copied' and 'same', each pointing to + an arrayref of relative files appropriate to the key. ('Relative' + means the path from MANIFEST, e.g. 'OpenInteract2/Action/MyAction.pm'). + B<check( \%params )> |
From: Chris W. <la...@us...> - 2005-02-08 01:09:23
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19059/lib/OpenInteract2 Modified Files: Manage.pm Log Message: add _set_copy_file_status() and get rid of _create_sync_status() since nothing is using File::DirSync anymore Index: Manage.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** Manage.pm 2 Feb 2005 13:15:04 -0000 1.44 --- Manage.pm 8 Feb 2005 01:09:13 -0000 1.45 *************** *** 470,477 **** sub _fail { my ( $self, $action, $msg, %additional ) = @_; ! $self->_add_status({ is_ok => 'no', ! action => $action, ! message => $msg, ! %additional }); return; } --- 470,479 ---- sub _fail { my ( $self, $action, $msg, %additional ) = @_; ! $self->_add_status({ ! is_ok => 'no', ! action => $action, ! message => $msg, ! %additional, ! }); return; } *************** *** 479,486 **** sub _ok { my ( $self, $action, $msg, %additional ) = @_; ! $self->_add_status({ is_ok => 'yes', ! action => $action, ! message => $msg, ! %additional }); return; } --- 481,490 ---- sub _ok { my ( $self, $action, $msg, %additional ) = @_; ! $self->_add_status({ ! is_ok => 'yes', ! action => $action, ! message => $msg, ! %additional, ! }); return; } *************** *** 517,560 **** # Creates status entry with all files removed/skipped/updated ! sub _create_sync_status { ! my ( $self, $dirsync, $dir ) = @_; ! my %status = (); ! my @failed = $dirsync->entries_failed; ! if ( scalar @failed ) { ! %status = ( is_ok => 'no', ! message => "Following files from $dir had failures: " . ! join( ', ', @failed ) ); ! } ! else { ! %status = ( is_ok => 'yes', ! message => "Mirrored $dir directory ok" ); ! } ! my @updated = $dirsync->entries_updated; ! if ( scalar @updated ) { ! $status{updated} = "Updated items: " . join( ', ', @updated ); ! } ! else { ! $status{updated} = 'No items updated'; ! } ! ! my @removed = $dirsync->entries_removed; ! if ( scalar @removed ) { ! $status{removed} = "Removed items: " . join( ', ', @removed ); ! } ! else { ! $status{removed} = 'No items removed'; } ! ! my @skipped = $dirsync->entries_skipped; ! if ( scalar @skipped ) { ! $status{skipped} = "Skipped items: " . join( ', ', @skipped ); } ! else { ! $status{skipped} = 'No items skipped'; } - return \%status; } - ######################################## # FACTORY --- 521,552 ---- # Creates status entry with all files removed/skipped/updated ! sub _set_copy_file_status { ! my ( $self, $status ) = @_; ! $status->{copied} ||= []; ! $status->{skipped} ||= []; ! $status->{same} ||= []; ! foreach my $file ( @{ $status->{copied} } ) { ! $self->_ok( ! 'copy updated template files', ! "File $file copied", ! filename => $file ! ); } ! foreach my $file ( @{ $status->{skipped} } ) { ! $self->_ok( ! 'copy updated template files', ! "File $file skipped, marked as read-only", ! filename => $file ! ); } ! foreach my $file ( @{ $status->{same} } ) { ! $self->_ok( ! 'copy updated template files', ! "File $file skipped, source and destination same", ! filename => $file ! ); } } ######################################## # FACTORY |