diff --git a/.gitignore b/.gitignore index 50281a442..fb74feb51 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,17 @@ -# Generated by Cargo -# will have compiled files and executables /target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock Cargo.lock +/gh-pages +__pycache__ + +*.so +*.out +*.pyc +*.pid +*.sock +*~ +target/ +*.egg-info/ # These are backup files generated by rustfmt **/*.rs.bk diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..faa27938b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,32 @@ +language: rust +rust: + - 1.18.0 + - 1.19.0 + - 1.20.0 + - nightly + +sudo: required +dist: trusty + +# Add clippy +before_script: + #- | + # if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then + # ( ( cargo install clippy && export CLIPPY=true ) || export CLIPPY=false ); + # fi + - export PATH=$PATH:~/.cargo/bin + +script: + - make test + # - make clippy + +# Upload docs +after_success: + - | + if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_RUST_VERSION" == "1.20.0" ]]; then + cargo doc --no-deps && + echo "" > target/doc/index.html && + git clone https://github.com/davisp/ghp-import.git && + ./ghp-import/ghp_import.py -n -p -f -m "Documentation upload" -r https://"$GH_TOKEN"@github.com/"$TRAVIS_REPO_SLUG.git" target/doc && + echo "Uploaded documentation" + fi diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..ec9d1b726 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "actix-http" +version = "0.1.0" +authors = ["Nikolay Kim "] +description = "Actix http support" +readme = "README.md" +keywords = ["actor", "http"] +homepage = "https://github.com/fafhrd91/actix-http" +repository = "https://github.com/fafhrd91/actix-http.git" +documentation = "https://fafhrd91.github.io/actix-http/actix-http/" +categories = ["network-programming", "asynchronous"] +license = "Apache-2.0" +exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"] +build = "build.rs" + +[lib] +name = "actix_http" +path = "src/lib.rs" + +[dependencies] +# tokio +bytes = "0.4" +mio = "0.6" +futures = "0.1" +tokio-core = "0.1" +tokio-io = "0.1" +tokio-signal = "0.1" +tokio-uds = "0.1" + +# logging +time = "*" +log = "0.3" +syslog = "3.2" +env_logger = "0.4" + +[dependencies.actix] +#path = "../actix" +git = "https://github.com/fafhrd91/actix.git" +features = ["signal"] + +[dev-dependencies] +skeptic = "0.13" + +[build-dependencies] +skeptic = "0.13" + +[profile.release] +lto = true +opt-level = 3 +debug = true diff --git a/LICENSE b/LICENSE index 8dada3eda..6cdf2d16c 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2017-NOW Nikolay Kim Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..f1a134f00 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +.PHONY: default build test doc clean + +CARGO_FLAGS := --features "$(FEATURES)" + +default: test + +build: + cargo build $(CARGO_FLAGS) + +test: build clippy + cargo test $(CARGO_FLAGS) + +# cd examples/word-count && python setup.py install && pytest -v tests + +clippy: + if $$CLIPPY; then cargo clippy $(CARGO_FLAGS); fi + +doc: build + cargo doc --no-deps $(CARGO_FLAGS) + +clean: + rm -r target + +gh-pages: + git clone --branch gh-pages git@github.com:fafhrd91/ctx.git gh-pages + +.PHONY: gh-pages-doc +gh-pages-doc: doc | gh-pages + cd gh-pages && git pull + rm -r gh-pages/doc + cp -r target/doc gh-pages/ + rm gh-pages/doc/.lock + cd gh-pages && git add . + cd gh-pages && git commit -m "Update documentation" + +publish: default gh-pages-doc + cargo publish + cd gh-pages && git push diff --git a/build.rs b/build.rs new file mode 100644 index 000000000..ec0571008 --- /dev/null +++ b/build.rs @@ -0,0 +1,6 @@ +extern crate skeptic; + +fn main() { + // generates doc tests for `README.md`. + skeptic::generate_doc_tests(&["README.md"]); +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 000000000..f36843b62 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1 @@ +//! Actix http framework diff --git a/tests/skeptic.rs b/tests/skeptic.rs new file mode 100644 index 000000000..ff46c9c01 --- /dev/null +++ b/tests/skeptic.rs @@ -0,0 +1 @@ +include!(concat!(env!("OUT_DIR"), "/skeptic-tests.rs"));