Skip to content

Commit

Permalink
(cargo-release) version 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andoriyu committed Mar 16, 2020
1 parent 7e8724f commit 9849244
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uclicious"
version = "0.1.0"
version = "0.1.1"
authors = ["Andrey Cherkashin <[email protected]>"]
edition = "2018"
categories = ["config"]
Expand All @@ -14,10 +14,10 @@ readme = "README.md"
[dependencies]
libucl-bind = { package = "uclicious-libucl-sys", version = "0.8.1" }
bitflags = "1.2.1"
uclicious_derive = { path = "uclicious_derive", optional = true, version = "=0.1.0" }
uclicious_derive = { path = "uclicious_derive", optional = true, version = "=0.1.1" }

[dev-dependencies]
uclicious_derive = { path = "uclicious_derive", version = "=0.1.0"}
uclicious_derive = { path = "uclicious_derive", version = "=0.1.1"}

[features]
default = ["derive"]
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ a_float = 3.14
an_integer = 69420
is_it_good = yes
buffer_size = 1KB
interval = 1s
"#;
parser.add_chunk_full(input, Priority::default(), DEFAULT_DUPLICATE_STRATEGY).unwrap();
let result = parser.get_object().unwrap();
Expand All @@ -34,6 +35,8 @@ assert_eq!(lookup_result, true);

let lookup_result = result.lookup("buffer_size").unwrap().as_i64().unwrap();
assert_eq!(lookup_result, 1024);
let lookup_result = result.lookup("interval").unwrap().as_time().unwrap();
assert_eq!(lookup_result, 1.0f64);
```

In order to get around rust rules library implemets its own trait FromObject for some basic types:
Expand Down Expand Up @@ -62,6 +65,7 @@ use uclicious::*;
use std::path::PathBuf;
use std::net::SocketAddr;
use std::collections::HashMap;
use std::time::Duration;

#[derive(Debug,Uclicious)]
#[ucl(var(name = "test", value = "works"))]
Expand All @@ -82,6 +86,7 @@ struct Connection {
#[ucl(default)]
option: Option<String>,
gates: HashMap<String, bool>,
interval: Duration,
}

#[derive(Debug,Uclicious)]
Expand All @@ -104,6 +109,7 @@ let input = r#"
subsection {
host = [host1, host2]
}
interval = 10ms
gates {
feature_1 = on
feature_2 = off
Expand All @@ -127,6 +133,13 @@ If you choose to derive builder then `::builder()` method will be added to targe
- Has following nested attributes:
- `flags`
- a path to function that returns flags.
- `filevars(..)`
- call `set_filevars` on a parser.
- Has following nested attributes:
- `path`
- a string representation of filepath.
- `expand`
- (optional) if set, then variables would be expanded to absolute.
- `var(..)`
- Optional attribute to register string variables with the parser.
- Has following nested attributes:
Expand Down
2 changes: 1 addition & 1 deletion uclicious_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uclicious_derive"
version = "0.1.0"
version = "0.1.1"
authors = ["Andrey Cherkashin <[email protected]>"]
edition = "2018"
license = "BSD-2-Clause"
Expand Down

0 comments on commit 9849244

Please sign in to comment.