]> git.r.bdr.sh - rbdr/page/blobdiff - src/file_handler/file_strategies/gemini.rs
Add static file copying
[rbdr/page] / src / file_handler / file_strategies / gemini.rs
index ffa2a9f1e8a0930cafa1f6f691f710ca80f8f53f..2427422834433fbda727f6052f2fbc09784405be 100644 (file)
@@ -2,7 +2,7 @@ pub struct Strategy {}
 
 use std::path::PathBuf;
 
-use crate::file_handler::{FileType, FileHandlerStrategy};
+use crate::file_handler::{File, FileType, FileHandlerStrategy};
 
 impl FileHandlerStrategy for Strategy {
     fn is(&self, path: &PathBuf) -> bool {
@@ -16,11 +16,14 @@ impl FileHandlerStrategy for Strategy {
         FileType::Gemini
     }
 
-    fn can_handle(&self, path: &PathBuf) -> bool {
-        self.is(path)
+    fn can_handle(&self, file_type: &FileType) -> bool {
+        match file_type {
+            FileType::Gemini => true,
+            _ => false,
+        }
     }
 
-    fn handle(&self, path: &PathBuf) {
-        println!("Should convert {}", path.display())
+    fn handle(&self, source: &PathBuf, destination: &PathBuf, file: &File) {
+        println!("Should parse and copy {}", file.path.display())
     }
 }