Skip to content

Commit

Permalink
Clean the repository
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed Nov 14, 2024
1 parent f05c601 commit e2587c2
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 463 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: build

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
check:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile=minimal --component clippy --component rustfmt
- run: cargo clippy --all-features -- -D warnings
- run: cargo fmt --all -- --check

test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile=minimal
- run: cargo test --all-features
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

15 changes: 2 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
[package]
name = "configuration"
version = "0.7.2"
version = "0.8.0"
license = "Apache-2.0/MIT"
authors = ["Ivan Ukhov <[email protected]>"]
description = "The package provides a malleable tree structure."
description = "The package provides a means of configuration."
documentation = "https://docs.rs/configuration"
homepage = "https://github.com/stainless-steel/configuration"
repository = "https://github.com/stainless-steel/configuration"

[features]
default = ["toml"]

[dependencies]
options = "0.5"

[dependencies.toml]
version = "0.1"
optional = true
default-features = false
40 changes: 8 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,16 @@
# Configuration [![Version][version-img]][version-url] [![Status][status-img]][status-url]
# Configuration [![Package][package-img]][package-url] [![Documentation][documentation-img]][documentation-url] [![Build][build-img]][build-url]

The package provides a malleable tree structure.

## [Documentation][documentation]

## Example

```rust
let tree = configuration::format::TOML::parse(r#"
message = "one"
[foo.bar]
message = "two"
[foo.baz]
answer = 42
"#).unwrap();

assert_eq!(tree.get::<String>("message").unwrap(), "one");
assert_eq!(tree.get::<String>("foo.message").unwrap(), "one");
assert_eq!(tree.get::<String>("foo.bar.message").unwrap(), "two");
assert_eq!(tree.get::<String>("foo.baz.message").unwrap(), "one");

let tree = tree.branch("foo.baz").unwrap();

assert_eq!(tree.get::<i64>("answer").unwrap(), &42);
```
The package provides a means of configuration.

## Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a
pull request. Note that any contribution submitted for inclusion in the project
will be licensed according to the terms given in [LICENSE.md](LICENSE.md).

[documentation]: https://docs.rs/configuration
[status-img]: https://travis-ci.org/stainless-steel/configuration.svg?branch=master
[status-url]: https://travis-ci.org/stainless-steel/configuration
[version-img]: https://img.shields.io/crates/v/configuration.svg
[version-url]: https://crates.io/crates/configuration
[build-img]: https://github.com/stainless-steel/configuration/workflows/build/badge.svg
[build-url]: https://github.com/stainless-steel/configuration/actions/workflows/build.yml
[documentation-img]: https://docs.rs/configuration/badge.svg
[documentation-url]: https://docs.rs/configuration
[package-img]: https://img.shields.io/crates/v/configuration.svg
[package-url]: https://crates.io/crates/configuration
7 changes: 0 additions & 7 deletions src/format/mod.rs

This file was deleted.

73 changes: 0 additions & 73 deletions src/format/toml.rs

This file was deleted.

50 changes: 1 addition & 49 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,49 +1 @@
//! Malleable tree structure.
//!
//! ```
//! let tree = configuration::format::TOML::parse(r#"
//! message = "one"
//!
//! [foo.bar]
//! message = "two"
//!
//! [foo.baz]
//! answer = 42
//! "#).unwrap();
//!
//! assert_eq!(tree.get::<String>("message").unwrap(), "one");
//! assert_eq!(tree.get::<String>("foo.message").unwrap(), "one");
//! assert_eq!(tree.get::<String>("foo.bar.message").unwrap(), "two");
//! assert_eq!(tree.get::<String>("foo.baz.message").unwrap(), "one");
//!
//! let tree = tree.branch("foo.baz").unwrap();
//!
//! assert_eq!(tree.get::<i64>("answer").unwrap(), &42);
//! ```
extern crate options;

#[cfg(feature = "toml")]
extern crate toml;

macro_rules! ok(
($result:expr) => (match $result {
Ok(result) => result,
Err(error) => raise!(error),
});
);

macro_rules! raise(
($message:expr) => (return Err(::Error($message.to_string())));
($($argument:tt)*) => (return Err(::Error(format!($($argument)*))));
);

pub mod format;

mod node;
mod result;
mod tree;

pub use node::Node;
pub use result::{Error, Result};
pub use tree::Tree;
//! Means of configuration.
64 changes: 0 additions & 64 deletions src/node.rs

This file was deleted.

28 changes: 0 additions & 28 deletions src/result.rs

This file was deleted.

Loading

0 comments on commit e2587c2

Please sign in to comment.