|
Lines 131-143
sub GetPluginsMetadata {
Link Here
|
| 131 |
} |
131 |
} |
| 132 |
)->_resultset->get_column('plugin_class'); |
132 |
)->_resultset->get_column('plugin_class'); |
| 133 |
|
133 |
|
| 134 |
my @metafiles = File::Find::Rule->file()->name('META.yml')->in( @pluginsdir ); |
134 |
my @metafiles = File::Find::Rule->file()->name('PLUGIN.yml')->in( @pluginsdir ); |
| 135 |
|
135 |
|
| 136 |
my @plugins; |
136 |
my @plugins; |
| 137 |
while ( my $plugin_class = $plugin_classes->next ) { |
137 |
while ( my $plugin_class = $plugin_classes->next ) { |
| 138 |
my $plugin_path = $plugin_class; |
138 |
my $plugin_path = $plugin_class; |
| 139 |
$plugin_path =~ s/::/\//g; # Take class name, transform :: to / to get path |
139 |
$plugin_path =~ s/::/\//g; # Take class name, transform :: to / to get path |
| 140 |
my $yaml_to_find = "$plugin_path/META.yml"; |
140 |
my $yaml_to_find = "$plugin_path/PLUGIN.yml"; |
| 141 |
$plugin_path =~ s/$/.pm/; # Add .pm to the end |
141 |
$plugin_path =~ s/$/.pm/; # Add .pm to the end |
| 142 |
|
142 |
|
| 143 |
# Find the full path to the file, it's somewhere in the list of metafiles we found when this module as loaded |
143 |
# Find the full path to the file, it's somewhere in the list of metafiles we found when this module as loaded |
|
Lines 146-152
sub GetPluginsMetadata {
Link Here
|
| 146 |
my $plugin_metadata; |
146 |
my $plugin_metadata; |
| 147 |
if ( -r $meta_yaml ) { # If the metafile exists and is readable, use it |
147 |
if ( -r $meta_yaml ) { # If the metafile exists and is readable, use it |
| 148 |
$plugin_metadata = YAML::LoadFile($meta_yaml); |
148 |
$plugin_metadata = YAML::LoadFile($meta_yaml); |
| 149 |
} else { # Fall back to loading the plugin to get the metadata if there is no META.yml file to read |
149 |
} else { # Fall back to loading the plugin to get the metadata if there is no PLUGIN.yml file to read |
| 150 |
load $plugin_class; |
150 |
load $plugin_class; |
| 151 |
my $plugin = $plugin_class->new({ |
151 |
my $plugin = $plugin_class->new({ |
| 152 |
enable_plugins => $self->{'enable_plugins'} |
152 |
enable_plugins => $self->{'enable_plugins'} |
| 153 |
- |
|
|