Skip to content

Commit

Permalink
🚚 hyphen > underscore (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
bayne authored Jan 20, 2020
1 parent 0fd160e commit b6ca5b7
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
[package]
authors = ["Brian Payne <[email protected]>"]
edition = "2018"
name = "dot_http"
name = "dot-http"
version = "0.1.0"
readme = "README.md"
description = "dot_http is a text-based scriptable HTTP client. It is a simple language that resembles the actual HTTP protocol but with additional features to make it practical for someone who builds and tests APIs."
repository = "https://github.com/bayne/dot_http"
description = "dot-http is a text-based scriptable HTTP client. It is a simple language that resembles the actual HTTP protocol but with additional features to make it practical for someone who builds and tests APIs."
repository = "https://github.com/bayne/dot-http"
keywords = ["rest client", "http", "scriptable", "javascript", "API"]
categories = ["command-line-utilities", "development-tools::testing", "web-programming::http-client"]
license = "Apache-2.0"

[[bin]]
name = "dot-http"
path = "src/main.rs"

[badges]
maintenance = { status = "experimental" }

Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!-- cargo-sync-readme start -->

# dot_http
# dot-http

![Verify build](https://github.com/bayne/dot_http/workflows/Verify/badge.svg)
![Verify build](https://github.com/bayne/dot-http/workflows/Verify/badge.svg)
![gitmoji](https://img.shields.io/badge/gitmoji-%20%F0%9F%98%9C%20%F0%9F%98%8D-FFDD67.svg?style=flat-square)
![Powered by Rust](https://img.shields.io/badge/Powered%20By-Rust-orange?style=flat-square)

dot_http is a text-based scriptable HTTP client. It is a simple language that resembles the actual HTTP protocol but with just a smidgen of magic to make it more practical for someone who builds and tests APIs.
dot-http is a text-based scriptable HTTP client. It is a simple language that resembles the actual HTTP protocol but with just a smidgen of magic to make it more practical for someone who builds and tests APIs.

![demo](https://user-images.githubusercontent.com/712014/72685883-36b2f700-3aa3-11ea-8a89-0e454391579f.gif)

Expand All @@ -17,36 +17,36 @@ dot_http is a text-based scriptable HTTP client. It is a simple language that re
Enter the following in a command prompt:

```text,no_run
curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git bayne/dot_http
curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git bayne/dot-http
```

### Binary releases

The easiest way for most users is simply to download the prebuilt binaries.
You can find binaries for various platforms on the
[release](https://github.com/bayne/dot_http/releases) page.
[release](https://github.com/bayne/dot-http/releases) page.

### Cargo

First, install [cargo](https://rustup.rs/). Then:

```bash,no_run
$ cargo install dot_http
$ cargo install dot-http
```

You will need to use the nightly release for this to work; if in doubt run

```bash,no_run
rustup run nightly cargo install dot_http
rustup run nightly cargo install dot-http
```

## Usage

See `dot_http --help` for usage.
See `dot-http --help` for usage.

### Vim

See this [plugin](https://github.com/bayne/vim_dot_http) to use dot_http within vim.
See this [plugin](https://github.com/bayne/vim-dot-http) to use dot-http within vim.

### The request

Expand All @@ -59,7 +59,7 @@ Accept: */*
```
Executing that script just prints the response to stdout:
```text,no_run
$ dot_http simple.http
$ dot-http simple.http
GET http://httpbin.org/get
HTTP/1.1 200 OK
Expand Down Expand Up @@ -112,7 +112,7 @@ X-Auth-Token: {{token}}

Note that the variables are replaced by their values
```text,no_run
$ dot_http simple_with_variables.http
$ dot-http simple_with_variables.http
POST http://httpbin.org/post
HTTP/1.1 200 OK
Expand Down Expand Up @@ -174,11 +174,11 @@ Specifying different environments when invoking the command results in different
for the variables in the script

```text,no_run
$ dot_http -e dev env_demo.http
$ dot-http -e dev env_demo.http
GET http://localhost
X-Auth-Token: SuperSecretToken
$ dot_http -e prod env_demo.htp
$ dot-http -e prod env_demo.htp
GET http://example.com
X-Auth-Token: ProductionToken
```
Expand Down Expand Up @@ -215,7 +215,7 @@ X-Auth-Token: {{auth_token}}
Data from a previous request

```text,no_run
$ dot_http test.http
$ dot-http test.http
POST http://httpbin.org/post
HTTP/1.1 200 OK
Expand Down Expand Up @@ -253,7 +253,7 @@ connection: keep-alive
Can populate data in a future request

```text,no_run
$ dot_http -l 16 test.http
$ dot-http -l 16 test.http
PUT http://httpbin.org/put
HTTP/1.1 200 OK
Expand Down Expand Up @@ -294,6 +294,6 @@ Contributions and suggestions are very welcome!
Please create an issue before submitting a PR, PRs will only be accepted if they reference an existing issue. If you have a suggested change please create an issue first so that we can discuss it.

## License
[Apache License 2.0](https://github.com/bayne/dot_http/blob/master/LICENSE)
[Apache License 2.0](https://github.com/bayne/dot-http/blob/master/LICENSE)

<!-- cargo-sync-readme end -->
8 changes: 4 additions & 4 deletions src/controller/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ fn test() {
.unwrap();

let script_file = script_file.into_temp_path();
let mut dot_http = Controller::default();
let mut controller = Controller::default();

let offset = 1;
let env = String::from("dev");

dot_http
controller
.execute(offset, env, &script_file, &snapshot_file, &env_file)
.unwrap();
}
Expand Down Expand Up @@ -85,12 +85,12 @@ Accept: */*
.unwrap();

let script_file = script_file.into_temp_path();
let mut dot_http = Controller::default();
let mut controller = Controller::default();

let offset = 17;
let env = String::from("dev");

dot_http
controller
.execute(offset, env, &script_file, &snapshot_file, &env_file)
.unwrap();
}
32 changes: 16 additions & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! # dot_http
//! # dot-http
//!
//! ![Verify build](https://github.com/bayne/dot_http/workflows/Verify/badge.svg)
//! ![Verify build](https://github.com/bayne/dot-http/workflows/Verify/badge.svg)
//! ![gitmoji](https://img.shields.io/badge/gitmoji-%20%F0%9F%98%9C%20%F0%9F%98%8D-FFDD67.svg?style=flat-square)
//! ![Powered by Rust](https://img.shields.io/badge/Powered%20By-Rust-orange?style=flat-square)
//!
//! dot_http is a text-based scriptable HTTP client. It is a simple language that resembles the actual HTTP protocol but with just a smidgen of magic to make it more practical for someone who builds and tests APIs.
//! dot-http is a text-based scriptable HTTP client. It is a simple language that resembles the actual HTTP protocol but with just a smidgen of magic to make it more practical for someone who builds and tests APIs.
//!
//! ![demo](https://user-images.githubusercontent.com/712014/72685883-36b2f700-3aa3-11ea-8a89-0e454391579f.gif)
//!
Expand All @@ -15,36 +15,36 @@
//! Enter the following in a command prompt:
//!
//! ```text,no_run
//! curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git bayne/dot_http
//! curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git bayne/dot-http
//! ```
//!
//! ### Binary releases
//!
//! The easiest way for most users is simply to download the prebuilt binaries.
//! You can find binaries for various platforms on the
//! [release](https://github.com/bayne/dot_http/releases) page.
//! [release](https://github.com/bayne/dot-http/releases) page.
//!
//! ### Cargo
//!
//! First, install [cargo](https://rustup.rs/). Then:
//!
//! ```bash,no_run
//! $ cargo install dot_http
//! $ cargo install dot-http
//! ```
//!
//! You will need to use the nightly release for this to work; if in doubt run
//!
//! ```bash,no_run
//! rustup run nightly cargo install dot_http
//! rustup run nightly cargo install dot-http
//! ```
//!
//! ## Usage
//!
//! See `dot_http --help` for usage.
//! See `dot-http --help` for usage.
//!
//! ### Vim
//!
//! See this [plugin](https://github.com/bayne/vim_dot_http) to use dot_http within vim.
//! See this [plugin](https://github.com/bayne/vim-dot-http) to use dot-http within vim.
//!
//! ### The request
//!
Expand All @@ -57,7 +57,7 @@
//! ```
//! Executing that script just prints the response to stdout:
//! ```text,no_run
//! $ dot_http simple.http
//! $ dot-http simple.http
//! GET http://httpbin.org/get
//!
//! HTTP/1.1 200 OK
Expand Down Expand Up @@ -110,7 +110,7 @@
//!
//! Note that the variables are replaced by their values
//! ```text,no_run
//! $ dot_http simple_with_variables.http
//! $ dot-http simple_with_variables.http
//! POST http://httpbin.org/post
//!
//! HTTP/1.1 200 OK
Expand Down Expand Up @@ -172,11 +172,11 @@
//! for the variables in the script
//!
//! ```text,no_run
//! $ dot_http -e dev env_demo.http
//! $ dot-http -e dev env_demo.http
//! GET http://localhost
//! X-Auth-Token: SuperSecretToken
//!
//! $ dot_http -e prod env_demo.htp
//! $ dot-http -e prod env_demo.htp
//! GET http://example.com
//! X-Auth-Token: ProductionToken
//! ```
Expand Down Expand Up @@ -213,7 +213,7 @@
//! Data from a previous request
//!
//! ```text,no_run
//! $ dot_http test.http
//! $ dot-http test.http
//! POST http://httpbin.org/post
//!
//! HTTP/1.1 200 OK
Expand Down Expand Up @@ -251,7 +251,7 @@
//! Can populate data in a future request
//!
//! ```text,no_run
//! $ dot_http -l 16 test.http
//! $ dot-http -l 16 test.http
//! PUT http://httpbin.org/put
//!
//! HTTP/1.1 200 OK
Expand Down Expand Up @@ -292,7 +292,7 @@
//! Please create an issue before submitting a PR, PRs will only be accepted if they reference an existing issue. If you have a suggested change please create an issue first so that we can discuss it.
//!
//! ## License
//! [Apache License 2.0](https://github.com/bayne/dot_http/blob/master/LICENSE)
//! [Apache License 2.0](https://github.com/bayne/dot-http/blob/master/LICENSE)
#[macro_use]
extern crate pest_derive;
Expand Down

0 comments on commit b6ca5b7

Please sign in to comment.