package Kwiki::Installer;
use Spoon::Installer -Base;

sub set_file_content {
    # Can't use super here because of mixin squashes things down into one
    # namespace. May need to make mixins more flexible.
    my $content = Spoon::Installer::set_file_content($self, @_);
    my $path = shift;
    $content = $self->warn_config($content)
      if $self->file_is_config($path);
    return $content;
}

sub file_is_config {
    my $path = shift;
    $path =~ /config\/\w+\.yaml$/;
}

sub warn_config {
    my $content = shift;
    my $warn = <<END;
# DO NOT EDIT THIS FILE
# Put overrides in the top level config.yaml
# See: http://www.kwiki.org/?ChangingConfigDotYaml
#
END
    return $content if(index($content,$warn) >= 0);
    return $warn . $content;
}
