-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from ChristophWurst/release/030
Version bump
- Loading branch information
Showing
7 changed files
with
65 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "krankerl" | ||
version = "0.2.0" | ||
version = "0.3.0" | ||
authors = ["Christoph Wurst <[email protected]>"] | ||
description = "A CLI helper to manage Nextcloud apps" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
pub mod app; | ||
pub mod krankerl; | ||
mod reader; | ||
|
||
pub use self::reader::{ConfigFileReader, ConfigReader}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use std::fs::File; | ||
use std::io::Read; | ||
use std::path::Path; | ||
|
||
use error; | ||
|
||
pub trait ConfigReader { | ||
fn read(&self, path: &Path) -> Result<String, error::Error>; | ||
} | ||
|
||
pub struct ConfigFileReader {} | ||
|
||
impl ConfigFileReader { | ||
pub fn new() -> Self { | ||
ConfigFileReader {} | ||
} | ||
} | ||
|
||
impl ConfigReader for ConfigFileReader { | ||
fn read(&self, path: &Path) -> Result<String, error::Error> { | ||
let mut file = File::open(path)?; | ||
let mut contents = String::new(); | ||
file.read_to_string(&mut contents)?; | ||
|
||
Ok(contents) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters