Changeset 3286
- Timestamp:
- 03/12/09 07:48:28 (3 years ago)
- File:
-
- 1 edited
-
trunk/Padre/lib/Padre/PluginManager.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/PluginManager.pm
r3185 r3286 21 21 use strict; 22 22 use warnings; 23 23 24 use Carp qw{croak}; 24 25 use File::Path (); 25 26 use File::Spec (); 27 use File::Spec::Functions qw{ catfile }; 26 28 use Scalar::Util (); 27 29 use Params::Util qw{_IDENTIFIER _CLASS _INSTANCE}; 30 use Padre::Config::Constants qw{ $PADRE_PLUGIN_DIR }; 28 31 use Padre::Util (); 29 32 use Padre::PluginHandle (); … … 133 136 ##################################################################### 134 137 # Bulk Plugin Operations 138 139 # 140 # $pluginmgr->reset_my_plugin( $overwrite ); 141 # 142 # reset the my plugin if needed. if $overwrite is set, remove it first. 143 # 144 sub reset_my_plugin { 145 my ($self, $overwrite) = @_; 146 147 # do not overwrite it unless stated so. 148 my $dst = catfile( $PADRE_PLUGIN_DIR, 'My.pm' ); 149 return if -e $dst && !$overwrite; 150 151 # find the My Plugin 152 my $src = catfile( dirname($INC{'Padre/Config.pm'}), 'Plugin', 'My.pm' ); 153 die "Could not find the original My plugin" unless -e $src; 154 155 # copy the My Plugin 156 unlink $dst; 157 copy($src, $dst) or die "Could not copy the My plugin ($src) to $dst: $!"; 158 chmod( 0644, $dst); 159 } 160 135 161 136 162 # Disable (but don't unload) all plugins when Padre exits.
Note: See TracChangeset
for help on using the changeset viewer.
