Changeset 3289


Ignore:
Timestamp:
03/12/09 08:02:52 (3 years ago)
Author:
jquelin
Message:

$PADRE_PLUGIN_DIR is in fact $PADRE_PLUGIN_LIBDIR

Location:
trunk/Padre/lib/Padre
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Config/Constants.pm

    r3285 r3289  
    1818use base qw{ Exporter }; 
    1919 
    20 my @dirs   = qw{ $PADRE_CONFIG_DIR $PADRE_PLUGIN_DIR   }; 
     20my @dirs   = qw{ $PADRE_CONFIG_DIR $PADRE_PLUGIN_DIR $PADRE_PLUGIN_LIBDIR }; 
    2121my @files  = qw{ $CONFIG_FILE_HOST $CONFIG_FILE_USER    }; 
    2222my @stores = qw{ $HOST $HUMAN $PROJECT                  }; 
     
    3535 
    3636# files & dirs 
    37 our $PADRE_CONFIG_DIR = _find_padre_config_dir(); 
    38 our $PADRE_PLUGIN_DIR = _find_padre_plugin_dir(); 
    39 our $CONFIG_FILE_USER = catfile( $PADRE_CONFIG_DIR, 'config.yml' ); 
    40 our $CONFIG_FILE_HOST = catfile( $PADRE_CONFIG_DIR, 'config.db'  ); 
     37our $PADRE_CONFIG_DIR    = _find_padre_config_dir(); 
     38our $PADRE_PLUGIN_DIR    = catdir( $PADRE_CONFIG_DIR, 'plugins' ); 
     39our $PADRE_PLUGIN_LIBDIR = catdir( $PADRE_PLUGIN_DIR, 'Padre', 'Plugin' ); 
     40our $CONFIG_FILE_USER    = catfile( $PADRE_CONFIG_DIR, 'config.yml' ); 
     41our $CONFIG_FILE_HOST    = catfile( $PADRE_CONFIG_DIR, 'config.db'  ); 
     42 
     43{ 
     44    # check if plugin directory exists, create it otherwise 
     45    unless ( -e $PADRE_PLUGIN_LIBDIR ) { 
     46        mkpath($PADRE_PLUGIN_LIBDIR) or 
     47        die "Cannot create plugins dir '$PADRE_PLUGIN_LIBDIR': $!"; 
     48    } 
     49} 
     50 
     51 
    4152 
    4253# settings types (based on firefox) 
     
    166177Private directory where Padre can look for plugins. 
    167178 
     179=item * $PADRE_PLUGIN_LIBDIR 
     180 
     181Subdir of $PADRE_PLUGIN_DIR with the path C<Padre/Plugin> added (or whatever 
     182depending on your platform) so that perl can load a C<Padre::Plugin::> plugin. 
    168183 
    169184=back 
     
    188203=item * dirs 
    189204 
    190 Imports C<$PADRE_CONFIG_DIR> and C<$PADRE_PLUGIN_DIR>. 
     205Imports C<$PADRE_CONFIG_DIR>, C<$PADRE_PLUGIN_DIR> and C<$PADRE_PLUGIN_LIBDIR>. 
    191206 
    192207=item * files 
  • trunk/Padre/lib/Padre/PluginManager.pm

    r3287 r3289  
    2828use Scalar::Util             (); 
    2929use Params::Util             qw{_IDENTIFIER _CLASS _INSTANCE}; 
    30 use Padre::Config::Constants qw{ $PADRE_PLUGIN_DIR }; 
     30use Padre::Config::Constants qw{ $PADRE_PLUGIN_LIBDIR }; 
    3131use Padre::Util              (); 
    3232use Padre::PluginHandle      (); 
     
    149149 
    150150    # do not overwrite it unless stated so. 
    151     my $dst = catfile( $PADRE_PLUGIN_DIR, 'My.pm' ); 
     151    my $dst = catfile( $PADRE_PLUGIN_LIBDIR, 'My.pm' ); 
    152152    return if -e $dst && !$overwrite; 
    153153     
Note: See TracChangeset for help on using the changeset viewer.