2017-11-18 18:39:10 +00:00
|
|
|
import 'package:file/file.dart';
|
2017-04-05 20:38:03 +00:00
|
|
|
import 'package:path/path.dart' as path;
|
|
|
|
|
|
|
|
class MustacheContext {
|
|
|
|
Directory viewDirectory;
|
|
|
|
|
|
|
|
Directory partialDirectory;
|
|
|
|
|
|
|
|
String extension;
|
|
|
|
|
|
|
|
MustacheContext([this.viewDirectory, this.partialDirectory, this.extension]);
|
|
|
|
|
|
|
|
File resolveView(String viewName) {
|
2017-11-18 18:39:10 +00:00
|
|
|
return viewDirectory.childFile('${viewName}${extension}');
|
2017-04-05 20:38:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
File resolvePartial(String partialName) {
|
2017-11-18 18:39:10 +00:00
|
|
|
return partialDirectory.childFile('${partialName}${extension}');
|
2017-04-05 20:38:03 +00:00
|
|
|
}
|
|
|
|
}
|