Skip to content

Commit

Permalink
wip for removing MI catalyst plugin, and replacing with autogeneratin…
Browse files Browse the repository at this point in the history
…g a dist.ini
  • Loading branch information
karenetheridge committed Apr 28, 2023
1 parent 50b263e commit bdbfc92
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 175 deletions.
1 change: 0 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ my %META = (
'File::Copy::Recursive' => 0,
'Path::Class' => '0.09',
'Template' => '2.14',
'Module::Install' => '1.02',
},
},
develop => {
Expand Down
4 changes: 2 additions & 2 deletions lib/Catalyst/Devel.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ them. This is intended to make it easier to deploy Catalyst apps. The
runtime parts of Catalyst are now known as C<Catalyst::Runtime>.
C<Catalyst-Devel> includes the L<Catalyst::Helper> system, which
autogenerates scripts and tests; L<Module::Install::Catalyst>, a
L<Module::Install> extension for Catalyst; and requirements for a
autogenerates scripts, tests and a starter dist.ini for releasing;
and requirements for a
variety of development-related modules. The documentation remains with
L<Catalyst::Runtime>.
Expand Down
19 changes: 8 additions & 11 deletions lib/Catalyst/Helper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ sub mk_app {
|| 'Catalyst developer';

my $gen_scripts = ( $self->{makefile} ) ? 0 : 1;
my $gen_makefile = ( $self->{scripts} ) ? 0 : 1;
my $gen_dist_ini = ( $self->{scripts} ) ? 0 : 1;
my $gen_app = ( $self->{scripts} || $self->{makefile} ) ? 0 : 1;

if ($gen_app) {
Expand All @@ -117,8 +117,8 @@ sub mk_app {
$self->$_;
}
}
if ($gen_makefile) {
$self->_mk_makefile;
if ($gen_dist_ini) {
$self->_mk_dist_ini;
}
if ($gen_scripts) {
for ( qw/ _mk_cgi _mk_fastcgi _mk_server
Expand Down Expand Up @@ -376,19 +376,16 @@ sub _mk_rootclass {
file( $self->{c}, "Root.pm" ) );
}

sub _mk_makefile {
sub _mk_dist_ini {
my $self = shift;
$self->{path} = join('/', 'lib', split( '::', $self->{name} ) );
$self->{path} .= '.pm';
my $dir = $self->{dir};
$self->render_sharedir_file( 'Makefile.PL.tt', file($dir, "Makefile.PL") );
$self->render_sharedir_file( 'dist.ini.tt', file($dir, "dist.ini") );

if ( $self->{makefile} ) {

# deprecate the old Build.PL file when regenerating Makefile.PL
$self->_deprecate_file(
file( $self->{dir}, 'Build.PL' ) );
}
# deprecate the old Makefile.PL and Build.PL file when regenerating dist.ini
$self->_deprecate_file( file( $self->{dir}, 'Makefile.PL' ) );
$self->_deprecate_file( file( $self->{dir}, 'Build.PL' ) );
}

sub _mk_psgi {
Expand Down
134 changes: 0 additions & 134 deletions lib/Module/Install/Catalyst.pm

This file was deleted.

26 changes: 0 additions & 26 deletions share/Makefile.PL.tt

This file was deleted.

30 changes: 30 additions & 0 deletions share/dist.ini.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
; TODO
; IMPORTANT: if you delete this file your app will not work as
; expected. You have been warned.

name '[% dir %]';
all_from '[% path %]';

name = [% dir %]
author = Your Name
copyright_holder = Your Name
copyright_year = [% (localtime())[5] %]
license = Perl_5

[@Git::Starter]

[Prereqs]
Catalyst::Runtime = [% catalyst_version %]
Catalyst::Plugin::ConfigLoader = 0
Catalyst::Plugin::Static::Simple = 0
Catalyst::Action::RenderView = 0
Moose = 0
namespace::autoclean = 0
Config::General = 0 ; This should reflect the config file format you've chosen
; See Catalyst::Plugin::ConfigLoader for supported formats

[Prereqs / TestRequires]
Test::More = 0.88

[ExecDir]
dir = script
2 changes: 1 addition & 1 deletion t/generated_app.t
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ chdir($app_dir) or die "Cannot chdir to $app_dir: $!";
lib->import(catdir($dir, 'TestApp', 'lib'));

my @files = qw|
Makefile.PL
dist.ini
testapp.conf
testapp.psgi
lib/TestApp.pm
Expand Down

0 comments on commit bdbfc92

Please sign in to comment.