Add method to check job extension on path
This commit is contained in:
parent
da4e79463f
commit
518f0b284f
14
src/job.rs
14
src/job.rs
|
@ -63,6 +63,20 @@ impl Job {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn has_job_file_extension(path: &Path) -> bool {
|
||||||
|
match path.extension() {
|
||||||
|
Some(x) => {
|
||||||
|
if ! "job".eq(x) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
None => {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
pub fn new(url: &str, selector: &str, conf: &Conf) -> Job {
|
pub fn new(url: &str, selector: &str, conf: &Conf) -> Job {
|
||||||
let mut job = Job::default(conf);
|
let mut job = Job::default(conf);
|
||||||
job.url = url.to_string();
|
job.url = url.to_string();
|
||||||
|
|
Loading…
Reference in New Issue