Skip to content

Commit

Permalink
Replace Class::Load with Module::Runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
kentfredric committed Aug 18, 2014
1 parent b3e218b commit ce750ec
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ Release history for Git-PurePerl-Walker
{{$NEXT}}
[00 Minor]
- Replace Path::Class with Path::Tiny in code and tests.
- Replace Class::Load with Module::Runtime

[Dependencies::Stats]
- Dependencies changed since 0.003001, see misc/*.deps* for details
- develop: +1 ↑1 (suggests: ↑2)
- runtime: +1 -1
- runtime: +2 -2

0.003001 2014-08-15T23:07:22Z
[00 Trivial]
Expand Down
10 changes: 5 additions & 5 deletions lib/Git/PurePerl/Walker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ our $VERSION = '0.004000';

use Moose qw( has );
use Path::Tiny qw();
use Class::Load qw( );
use Module::Runtime qw( );
use Git::PurePerl::Walker::Types qw( GPPW_Repository GPPW_Methodish GPPW_Method GPPW_OnCommitish GPPW_OnCommit);
use namespace::autoclean;

Expand Down Expand Up @@ -207,8 +207,8 @@ sub _build_method {
my ($method) = $self->_method;

if ( not ref $method ) {
my $method_name = 'Git::PurePerl::Walker::Method::' . $method;
Class::Load::load_class($method_name);
my $method_name = Module::Runtime::compose_module_name( 'Git::PurePerl::Walker::Method', $method );
Module::Runtime::require_module($method_name);
$method = $method_name->new();
}
return $method->for_repository( $self->repo );
Expand All @@ -225,12 +225,12 @@ sub _build_on_commit {
if ( ref $on_commit and 'CODE' eq ref $on_commit ) {
my $on_commit_name = 'Git::PurePerl::Walker::OnCommit::CallBack';
my $callback = $on_commit;
Class::Load::load_class($on_commit_name);
Module::Runtime::require_module($on_commit_name);
$on_commit = $on_commit_name->new( callback => $callback, );
}
elsif ( not ref $on_commit ) {
my $on_commit_name = 'Git::PurePerl::Walker::OnCommit::' . $on_commit;
Class::Load::load_class($on_commit_name);
Module::Runtime::require_module($on_commit_name);
$on_commit = $on_commit_name->new();
}
return $on_commit->for_repository( $self->repo );
Expand Down
2 changes: 2 additions & 0 deletions misc/Changes.deps
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ This file contains changes in REQUIRED dependencies for standard CPAN phases (co

0.004000
[Added / runtime requires]
- Module::Runtime
- Path::Tiny

[Removed / runtime requires]
- Class::Load
- Path::Class

0.003001 2014-08-15T23:07:22Z
Expand Down
2 changes: 2 additions & 0 deletions misc/Changes.deps.all
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This file contains ALL changes in dependencies in both REQUIRED / OPTIONAL depen
- Dist::Zilla::Plugin::Author::KENTNL::RecommendFixes 0.001001

[Added / runtime requires]
- Module::Runtime
- Path::Tiny

[Changed / develop requires]
Expand All @@ -15,6 +16,7 @@ This file contains ALL changes in dependencies in both REQUIRED / OPTIONAL depen
- Dist::Zilla::PluginBundle::Author::KENTNL 2.017002 → 2.019000

[Removed / runtime requires]
- Class::Load
- Path::Class

0.003001 2014-08-15T23:07:22Z
Expand Down

0 comments on commit ce750ec

Please sign in to comment.