Skip to content

Commit

Permalink
upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
softprops committed Apr 26, 2017
1 parent 9425300 commit cae358b
Show file tree
Hide file tree
Showing 10 changed files with 279 additions and 225 deletions.
19 changes: 9 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[package]
name = "commodore"
version = "0.2.2"
version = "0.3.0"
authors = ["softprops <d.tangren@gmail.com>"]
description = "Slack Command API handler library"
documentation = "https://softprops.github.io/commodore"
homepage = "https://github.com/softprops/commodore"
repository = "https://github.com/softprops/commodore"
keywords = ["hyper", "slack", "webhook"]
license = "MIT"
build = "build.rs"

[dev-dependencies]
env_logger = "0.3"

[build-dependencies]
serde_codegen = "0.8"

[dependencies]
hyper = "0.9"
hyper = "0.10"
hyper-native-tls = "0.2"
log = "0.3"
regex = "0.1"
serde = "0.8"
serde_json = "0.8"
url = "1.2"
regex = "0.2"
serde = "0.9"
serde_derive = "0.9"
serde_json = "0.9"
url = "1.4"
error-chain = "0.10"
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016 Doug Tangren
Copyright (c) 2016-2017 Doug Tangren

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -17,4 +17,4 @@ 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.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
Commodore allows you to easily extend your [Slack](https://slack.com/) experience with [Rust](https://www.rust-lang.org/) via Slack's [Command API](https://api.slack.com/slash-commands).

## rust docs

Find them [here](https://softprops.github.io/commodore)
[Documentation](https://softprops.github.io/commodore)

## Install

Note this crate relies on hyper for handling http. You will want to include the following in your `Cargo.toml` file.
> Note: this crate relies on hyper for handling http. You will want to include the following in your `Cargo.toml` file.
```toml
[dependencies]
commodore = "0.2"
hyper = "0.9"
commodore = "0.3"
hyper = "0.10"
```

## usage
Expand Down Expand Up @@ -84,4 +82,4 @@ fn main() {
}
```

Doug Tangren (softprops) 2016
Doug Tangren (softprops) 2016-2017
13 changes: 0 additions & 13 deletions build.rs

This file was deleted.

31 changes: 16 additions & 15 deletions examples/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ extern crate commodore;
use commodore::{Attachment, Field, Response};

fn main() {
let response = Response::builder()
.text("hallo")
.in_channel()
.attach(
Attachment::builder()
.text("attached")
.color("red")
.field(
Field {
title: "foo".to_owned(),
value: "value".to_owned(),
short: false
}
let response = Response::builder()
.text("hallo")
.in_channel()
.attach(
Attachment::builder()
.text("attached")
.color("red")
.field(
Field {
title: "foo".to_owned(),
value: "value".to_owned(),
short: false,
},
)
.build(),
)
.build()
).build();
.build();
println!("{:#?}", response);
}
33 changes: 18 additions & 15 deletions examples/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,24 @@ use std::time::Duration;
pub fn main() {
env_logger::init().unwrap();
let mut mux = Mux::new();
mux.command("/commodore", "secrettoken", |c: &Command,
_: &Option<Captures>,
responder: Box<Responder>|
-> Option<Response> {
info!("handler recv cmd {:#?}", c);
thread::spawn(move || {
// simulate doing something important
thread::sleep(Duration::from_secs(3));
responder.respond(Response::ephemeral("some time later"));
});
Some(Response::ephemeral("got it"))
});
mux.command(
"/commodore",
"secrettoken",
|c: &Command, _: &Option<Captures>, responder: Box<Responder>| -> Option<Response> {
info!("handler recv cmd {:#?}", c);
thread::spawn(
move || {
// simulate doing something important
thread::sleep(Duration::from_secs(3));
responder.respond(Response::ephemeral("some time later"));
},
);
Some(Response::ephemeral("got it"))
},
);
let svc = Server::http("0.0.0.0:4567")
.unwrap()
.handle(mux)
.unwrap();
.unwrap()
.handle(mux)
.unwrap();
println!("listening on {}", svc.socket);
}
7 changes: 6 additions & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
reorder_imports = true
reorder_imports = true
fn_args_layout = "Block"
array_layout = "Block"
where_style = "Rfc"
generics_indent = "Block"
fn_call_style = "Block"

0 comments on commit cae358b

Please sign in to comment.