Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split project into workspaces #163

Merged
merged 3 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ target
*.rs.bk
Cargo.lock

# node (for cspell)
/node_modules
/npm-debug.log
/package-lock.json

# IDE files
.idea
.vscode
Expand Down
42 changes: 5 additions & 37 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,5 @@
[package]
name = "os_info"
version = "2.0.2"
authors = ["Jan Schulte <hello@unexpected-co.de>", "Stanislav Tkach <stanislav.tkach@gmail.com>"]
description = "Detect the operating system type and version."
documentation = "https://docs.rs/os_info"
homepage = "https://github.com/darkeld3r/os_info"
repository = "https://github.com/darkeld3r/os_info"
readme = "README.md"
keywords = ["os", "os_type", "os_version", "os_info"]
categories = ["os"]
license = "MIT"
edition = "2018"

[badges]
codecov = { repository = "DarkEld3r/os_info", branch = "master", service = "github" }
is-it-maintained-issue-resolution = { repository = "DarkEld3r/os_info" }
is-it-maintained-open-issues = { repository = "DarkEld3r/os_info" }

[features]
default = ["serde"]

[dependencies]
log = "0.4.5"
serde = { version = "1.0.0", features = ["derive"], optional = true }
env_logger = "0.7.1"
structopt = "0.3"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.8", features = ["minwindef", "ntdef", "ntstatus", "sysinfoapi", "winnt", "winuser", "libloaderapi", "processthreadsapi"] }

[dev-dependencies]
itertools = "0.9.0"
pretty_assertions = "0.6.1"
doc-comment = "0.3.1"
assert_cmd = "1.0.1"
predicates = "1.0.4"
[workspace]
members = [
"os_info",
"cli",
]
27 changes: 27 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "os_info_cli"
version = "1.0.0"
authors = ["Stanislav Tkach <stanislav.tkach@gmail.com>"]
description = "Detect the operating system type and version."
documentation = "https://docs.rs/os_info"
homepage = "https://github.com/darkeld3r/os_info"
repository = "https://github.com/darkeld3r/os_info"
readme = "../README.md"
keywords = ["cli", "os", "os_type", "os_version", "os_info"]
categories = ["command-line-interface", "os"]
license = "MIT"
edition = "2018"

[[bin]]
name = "os_info"
path = "src/main.rs"

[dependencies]
os_info = { version = "", default-features = false, path = "../os_info" }
log = "0.4.5"
env_logger = "0.7.1"
structopt = "0.3"

[dev-dependencies]
assert_cmd = "1.0.1"
predicates = "1.0.4"
File renamed without changes.
33 changes: 17 additions & 16 deletions tests/cli.rs → cli/tests/cli.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
use std::path::Path;

use assert_cmd::Command;
use predicates::prelude::*;

const BIN_NAME: &str = env!("CARGO_BIN_EXE_os_info");

#[test]
fn path_is_correct() {
assert!(Path::new(BIN_NAME).is_file());
}

#[test]
fn no_args() {
Command::cargo_bin(env!("CARGO_PKG_NAME"))
.expect("cargo_bin failed")
Command::new(BIN_NAME)
.assert()
.success()
.stdout(all_predicate());
}

#[test]
fn all() {
Command::cargo_bin(env!("CARGO_PKG_NAME"))
.expect("cargo_bin failed")
Command::new(BIN_NAME)
.arg("--all")
.assert()
.success()
Expand All @@ -22,8 +29,7 @@ fn all() {

#[test]
fn type_short() {
Command::cargo_bin(env!("CARGO_PKG_NAME"))
.expect("cargo_bin failed")
Command::new(BIN_NAME)
.arg("-t")
.assert()
.success()
Expand All @@ -32,8 +38,7 @@ fn type_short() {

#[test]
fn type_long() {
Command::cargo_bin(env!("CARGO_PKG_NAME"))
.expect("cargo_bin failed")
Command::new(BIN_NAME)
.arg("--type")
.assert()
.success()
Expand All @@ -42,8 +47,7 @@ fn type_long() {

#[test]
fn version_short() {
Command::cargo_bin(env!("CARGO_PKG_NAME"))
.expect("cargo_bin failed")
Command::new(BIN_NAME)
.arg("-v")
.assert()
.success()
Expand All @@ -52,8 +56,7 @@ fn version_short() {

#[test]
fn version_long() {
Command::cargo_bin(env!("CARGO_PKG_NAME"))
.expect("cargo_bin failed")
Command::new(BIN_NAME)
.arg("--version")
.assert()
.success()
Expand All @@ -62,8 +65,7 @@ fn version_long() {

#[test]
fn bitness_short() {
Command::cargo_bin(env!("CARGO_PKG_NAME"))
.expect("cargo_bin failed")
Command::new(BIN_NAME)
.arg("-b")
.assert()
.success()
Expand All @@ -72,8 +74,7 @@ fn bitness_short() {

#[test]
fn bitness_long() {
Command::cargo_bin(env!("CARGO_PKG_NAME"))
.expect("cargo_bin failed")
Command::new(BIN_NAME)
.arg("--bitness")
.assert()
.success()
Expand Down
33 changes: 33 additions & 0 deletions os_info/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "os_info"
version = "2.0.2"
authors = ["Jan Schulte <hello@unexpected-co.de>", "Stanislav Tkach <stanislav.tkach@gmail.com>"]
description = "Detect the operating system type and version."
documentation = "https://docs.rs/os_info"
homepage = "https://github.com/darkeld3r/os_info"
repository = "https://github.com/darkeld3r/os_info"
readme = "../README.md"
keywords = ["os", "os_type", "os_version", "os_info"]
categories = ["os"]
license = "MIT"
edition = "2018"

[badges]
codecov = { repository = "DarkEld3r/os_info", branch = "master", service = "github" }
is-it-maintained-issue-resolution = { repository = "DarkEld3r/os_info" }
is-it-maintained-open-issues = { repository = "DarkEld3r/os_info" }

[features]
default = ["serde"]

[dependencies]
log = "0.4.5"
serde = { version = "1.0.0", features = ["derive"], optional = true }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.8", features = ["minwindef", "ntdef", "ntstatus", "sysinfoapi", "winnt", "winuser", "libloaderapi", "processthreadsapi"] }

[dev-dependencies]
itertools = "0.9.0"
pretty_assertions = "0.6.1"
doc-comment = "0.3.1"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions os_info/tests/md_doc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// spell-checker:ignore doctest

doc_comment::doctest!("../../README.md");
3 changes: 0 additions & 3 deletions tests/md_doc.rs

This file was deleted.