Skip to content

Commit

Permalink
Item14237: Extracted Foswiki.spec into a separate entity.
Browse files Browse the repository at this point in the history
Now defined as mainSpec object attribute and added to the list of specs
files manually.
  • Loading branch information
vrurg committed Apr 15, 2017
1 parent 622770f commit a9118e0
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions core/lib/Foswiki/Config/Spec/Files.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ has list => (
builder => 'prepareList',
);

has mainSpec => (
is => 'rw',
lazy => 1,
clearer => 1,
isa => Foswiki::Object::isaCLASS(
'mainSpec', 'Foswiki::Config::Spec::File', noUndef => 1,
),
builder => 'prepareMainSpec',
);

sub _scanDir {
my $this = shift;
my $dir = shift;
Expand Down Expand Up @@ -79,12 +89,7 @@ sub collectSpecFiles {

my $baseDir = $this->baseDir;

push @specFileList,
$this->create(
'Foswiki::Config::Spec::File',
path => File::Spec->catfile( $baseDir, 'Foswiki.spec' ),
cfg => $this->cfg,
);
push @specFileList, $this->mainSpec;

foreach my $subDir (@subDirs) {
my $specDir = File::Spec->catdir( $baseDir, 'Foswiki', $subDir );
Expand All @@ -94,6 +99,18 @@ sub collectSpecFiles {
return @specFileList;
}

sub prepareMainSpec {
my $this = shift;

#say STDERR "Creating a new file object for Foswiki.spec";
my $msf = $this->create(
'Foswiki::Config::Spec::File',
path => File::Spec->catfile( $this->baseDir, 'Foswiki.spec' ),
cfg => $this->cfg,
);
return $msf;
}

sub prepareList {
my $this = shift;

Expand Down

0 comments on commit a9118e0

Please sign in to comment.