Skip to content

Commit

Permalink
feat(cargo-jrest): migrate global bin to Cargo custom command
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Jul 5, 2023
1 parent f20aa4b commit 4e280a8
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[workspace]
members = ["jrest", "jrest_hooks"]
members = ["cargo-jrest", "jrest", "jrest_hooks"]
23 changes: 23 additions & 0 deletions cargo-jrest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "cargo-jrest"
description = "Jrest Cargo command."
license = "MIT"
version = "0.1.2"

edition = "2021"
rust-version = "1.70.0"

authors = ["Ivan Gabriele <ivan.gabriele@gmail.com>"]
categories = ["development-tools::testing"]
homepage = "https://github.com/ivangabriele/jrest#readme"
readme = "README.md"
repository = "https://github.com/ivangabriele/jrest"

include = ["src/**/*.rs", "CHANGELOG.md", "LICENSE", "README.md"]

[dependencies]
clap = { version = "4.3.10", features = ["derive"] }
tokio = { version = "1.29.1", features = ["process", "full"] }
serde_json = "1.0.100"

[dev-dependencies]
14 changes: 14 additions & 0 deletions cargo-jrest/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright 2023-present, Ivan Gabriele.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45 changes: 45 additions & 0 deletions cargo-jrest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Cargo Jrest

[![Crates.io Package](https://img.shields.io/crates/v/jrest?style=flat-square)](https://crates.io/crates/jrest)
[![Docs.rs Documentation](https://img.shields.io/docsrs/jrest/latest?style=flat-square)](https://docs.rs/jrest/latest/jrest)
[![Test Workflow Status](https://img.shields.io/github/actions/workflow/status/ivangabriele/jrest/test.yml?label=Tests&style=flat-square)](https://github.com/ivangabriele/jrest/actions?query=branch%3Amain+workflow%3ATest++)
[![Code Coverage](https://img.shields.io/codecov/c/github/ivangabriele/jrest/main?style=flat-square)](https://app.codecov.io/github/ivangabriele/jrest)

**Jrest** Cargo command.

> ⚠️ This is a work in progress.
But it should get regular updates since I'm using it every week on my own open-source projects.

---

- [Installation](#installation)
- [Usage](#usage)
- [Roadmap](#roadmap)

---

## Installation

```sh
cargo install cargo-jrest
```

## Usage

```sh
Jrest Cargo command.

Usage: cargo-jrest [TESTNAME]

Arguments:
[TESTNAME]

Options:
-h, --help Print help
-V, --version Print version
```

## Roadmap

_To be defined_
File renamed without changes.
15 changes: 1 addition & 14 deletions jrest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,8 @@ repository = "https://github.com/ivangabriele/jrest"

include = ["src/**/*.rs", "CHANGELOG.md", "LICENSE", "README.md"]

[lib]
name = "jrest"
path = "src/lib.rs"

[[bin]]
name = "jrest"
path = "src/bin.rs"

[dependencies]
num = "0.4.0"
quote = "1.0.29"
syn = { version = "2.0.23", features = ["extra-traits", "fold", "full"] }
jrest_hooks = { version = "=0.1.2", optional = true, path = "../jrest_hooks" }
clap = { version = "4.3.10", features = ["derive"] }
tokio = { version = "1.29.1", features = ["process", "full"] }
serde_json = "1.0.100"
jrest_hooks = { version = "=0.2.0", optional = true, path = "../jrest_hooks" }

[dev-dependencies]
2 changes: 1 addition & 1 deletion jrest_hooks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jrest_hooks"
description = "Jrest hooks: after_all, after_each, before_all, berfore_each, skip."
description = "Jrest `after()`, `after_each()`, `before()`, `before_each()` and `skip()` hooks."
license = "MIT"
version = "0.1.2"

Expand Down
2 changes: 2 additions & 0 deletions jrest_hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
[![Test Workflow Status](https://img.shields.io/github/actions/workflow/status/ivangabriele/jrest/test.yml?label=Tests&style=flat-square)](https://github.com/ivangabriele/jrest/actions?query=branch%3Amain+workflow%3ATest++)
[![Code Coverage](https://img.shields.io/codecov/c/github/ivangabriele/jrest/main?style=flat-square)](https://app.codecov.io/github/ivangabriele/jrest)

**Jrest** `after()`, `after_each()`, `before()`, `before_each()` and `skip()` hooks.

> ⚠️ This is a work in progress.
But it should get regular updates since I'm using it every week on my own open-source projects.
Expand Down

0 comments on commit 4e280a8

Please sign in to comment.