Repositories

grarr

(mirrored on github)

Modified Cargo.lock

@@ -3,42 +3,37 @@ name = "grarr"
version = "0.0.3"
dependencies = [
"chrono 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.37 (registry+https://github.com/rust-lang/crates.io-index)",
"git-appraise 0.0.1 (git+https://github.com/Nemo157/git-appraise-rs)",
"git2 0.3.4 (git+https://github.com/alexcrichton/git2-rs)",
"clippy 0.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
"git-appraise 0.1.0 (git+https://github.com/Nemo157/git-appraise-rs)",
"git2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gravatar 0.1.3 (git+https://github.com/Nemo157/rust-gravatar?rev=fix-type-resolve-failure)",
"hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"iron 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"logger 0.0.3 (git+https://github.com/iron/logger)",
"logger 0.0.3 (git+https://github.com/Nemo157/logger?rev=allow-no-status)",
"lru_time_cache 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"maud 0.7.4 (git+https://github.com/lfairy/maud)",
"maud 0.8.0 (git+https://github.com/lfairy/maud)",
"maud-pulldown-cmark 0.0.7 (git+https://git.nemo157.com/rust/maud-pulldown-cmark.git?rev=maud-update)",
"maud_macros 0.7.4 (git+https://github.com/lfairy/maud)",
"mime 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"pulldown-cmark 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"maud_macros 0.8.0 (git+https://github.com/lfairy/maud)",
"mime 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"params 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"pulldown-cmark 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"router 0.1.0 (git+https://github.com/Nemo157/router?rev=reverse_priority)",
"rust-crypto 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "advapi32-sys"
version = "0.1.2"
name = "aster"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.29.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "aster"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitflags"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -49,29 +44,42 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bodyparser"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"iron 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"persistent 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "chrono"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clippy"
version = "0.0.37"
version = "0.0.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cmake"
version = "0.1.12"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -79,7 +87,7 @@ name = "conduit-mime-types"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -87,13 +95,70 @@ name = "cookie"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"openssl 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding"
version = "0.2.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding-index-simpchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding-index-japanese"
version = "1.20141219.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding-index-korean"
version = "1.20141219.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding-index-simpchinese"
version = "1.20141219.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding-index-singlebyte"
version = "1.20141219.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding-index-tradchinese"
version = "1.20141219.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding_index_tests"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "error"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -103,15 +168,28 @@ dependencies = [
]
[[package]]
name = "gcc"
version = "0.3.21"
name = "formdata"
version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"textnonce 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gcc"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "gdi32-sys"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -126,24 +204,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "git-appraise"
version = "0.0.1"
source = "git+https://github.com/Nemo157/git-appraise-rs#078a5ccb691b968a4f91f4179102bb28424b3ded"
version = "0.1.0"
source = "git+https://github.com/Nemo157/git-appraise-rs#08019d62f90234f2fc0852c5cb1fc8f5737b79a6"
dependencies = [
"git2 0.3.4 (git+https://github.com/alexcrichton/git2-rs)",
"serde 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
"git2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "git2"
version = "0.3.4"
source = "git+https://github.com/alexcrichton/git2-rs#94247a3a89f02bee7fa1844f408d666a37f4ac1f"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.3.10 (git+https://github.com/alexcrichton/git2-rs)",
"url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -175,18 +254,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"language-tags 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
"solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -200,10 +279,10 @@ dependencies = [
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"modifier 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -217,7 +296,7 @@ dependencies = [
[[package]]
name = "language-tags"
version = "0.2.0"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -232,20 +311,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.6"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libgit2-sys"
version = "0.3.10"
source = "git+https://github.com/alexcrichton/git2-rs#94247a3a89f02bee7fa1844f408d666a37f4ac1f"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libssh2-sys 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"libssh2-sys 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -258,26 +338,24 @@ dependencies = [
[[package]]
name = "libssh2-sys"
version = "0.1.34"
version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libz-sys"
version = "1.0.0"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -285,13 +363,13 @@ name = "log"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "logger"
version = "0.0.3"
source = "git+https://github.com/iron/logger#78c20cbda030a03107fec91b5282183d6eee9997"
source = "git+https://github.com/Nemo157/logger?rev=allow-no-status#2f5b15bb98dbc0026a98f7bf97e9b1b6b97745b2"
dependencies = [
"iron 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -313,33 +391,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "maud"
version = "0.7.4"
source = "git+https://github.com/lfairy/maud#b738d9d533c093889dc557a14503d97a7db45993"
version = "0.8.0"
source = "git+https://github.com/lfairy/maud#9949933d41dc62959194437048a1960b8426b648"
[[package]]
name = "maud-pulldown-cmark"
version = "0.0.7"
source = "git+https://git.nemo157.com/rust/maud-pulldown-cmark.git?rev=maud-update#3ceba0ecdf8c0b86ea33a83b60385ffb95ad6daf"
dependencies = [
"maud 0.7.4 (git+https://github.com/lfairy/maud)",
"maud 0.8.0 (git+https://github.com/lfairy/maud)",
"pulldown-cmark 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "maud_macros"
version = "0.7.4"
source = "git+https://github.com/lfairy/maud#b738d9d533c093889dc557a14503d97a7db45993"
version = "0.8.0"
source = "git+https://github.com/lfairy/maud#9949933d41dc62959194437048a1960b8426b648"
dependencies = [
"maud 0.7.4 (git+https://github.com/lfairy/maud)",
"maud 0.8.0 (git+https://github.com/lfairy/maud)",
]
[[package]]
name = "mime"
version = "0.1.1"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -349,66 +427,88 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "nom"
version = "1.1.0"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num"
version = "0.1.30"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num_cpus"
version = "0.2.10"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl"
version = "0.7.5"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys-extras 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys-extras 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl-sys"
version = "0.7.5"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"user32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl-sys-extras"
version = "0.7.5"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "params"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bodyparser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"formdata 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
"iron 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"urlencoded 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "persistent"
version = "0.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"iron 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "pkg-config"
version = "0.3.6"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -437,37 +537,46 @@ dependencies = [
]
[[package]]
name = "quasi"
version = "0.4.0"
name = "pulldown-cmark"
version = "0.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quasi_codegen"
version = "0.4.0"
name = "quasi"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aster 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.29.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quasi_macros"
version = "0.4.0"
name = "quasi_codegen"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quasi_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"aster 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.29.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand"
version = "0.3.13"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex-syntax"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "route-recognizer"
version = "0.1.11"
source = "git+https://github.com/Nemo157/route-recognizer.rs?rev=reverse_priority#9c7422a8daa3ffbc25d23c8ce806d637d7cfa1cd"
@@ -486,21 +595,21 @@ name = "rust-crypto"
version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-serialize"
version = "0.3.16"
version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc_version"
version = "0.1.6"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -513,47 +622,65 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "semver"
version = "0.2.2"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nom 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nom 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde"
version = "0.6.11"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde_codegen"
version = "0.6.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"aster 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi_codegen 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.29.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_codegen"
version = "0.6.11"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aster 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.37 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi_macros 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"aster 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi_codegen 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex_syntax 0.29.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_json"
version = "0.6.0"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_macros"
version = "0.6.11"
name = "serde_json"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"clippy 0.0.37 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -566,11 +693,32 @@ dependencies = [
]
[[package]]
name = "syntex"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"syntex_syntax 0.29.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "syntex_syntax"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tempdir"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -583,12 +731,25 @@ dependencies = [
]
[[package]]
name = "textnonce"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "time"
version = "0.1.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -617,10 +778,10 @@ dependencies = [
[[package]]
name = "unicase"
version = "1.1.1"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc_version 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -637,6 +798,11 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-xid"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unsafe-any"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -650,23 +816,34 @@ version = "0.2.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "url"
version = "0.5.4"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "urlencoded"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bodyparser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"iron 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "user32-sys"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -680,8 +857,8 @@ name = "uuid"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -703,12 +880,3 @@ name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "ws2_32-sys"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

Modified Cargo.toml

@@ -6,17 +6,18 @@ authors = ["Wim Looman <[email protected]>"]
[dependencies]
git-appraise = { git = "https://github.com/Nemo157/git-appraise-rs" }
git2 = { git = "https://github.com/alexcrichton/git2-rs" }
git2 = "0.4.2"
hyper = "*"
iron = "*"
router = { git = "https://github.com/Nemo157/router", rev = "reverse_priority" }
logger = { git = "https://github.com/iron/logger" }
logger = { git = "https://github.com/Nemo157/logger", rev = "allow-no-status" }
typemap = "*"
mime = "*"
lru_time_cache = "*"
time = "*"
walkdir = "*"
params = "*"
chrono = "*"
pulldown-cmark = "*"

Modified src/commit_tree.rs

@@ -14,7 +14,7 @@ impl<'repo> CommitTree<'repo> {
let mut walker = try!(repo.revwalk());
try!(walker.push(commit.id()));
walker.simplify_first_parent();
let commits = try!(walker.map(|id| repo.find_commit(id)).collect());
let commits = try!(walker.map(|id| id.and_then(|id| repo.find_commit(id))).collect());
Ok(CommitTree::create(repo, commits, Vec::new()))
}
@@ -35,7 +35,7 @@ impl<'repo> CommitTree<'repo> {
walker.hide(ignored).unwrap();
}
walker.simplify_first_parent();
let commits = walker.map(|id| repo.find_commit(id).unwrap()).collect();
let commits = walker.map(|id| id.and_then(|id| repo.find_commit(id)).unwrap()).collect();
CommitTree::create(repo, commits, ignored)
}

Modified src/handler/base.rs

@@ -10,7 +10,7 @@ pub use router::Router;
pub use error::Error;
pub use repository_context::RepositoryContext;
pub use render::{ self, Wrapper, RepositoryWrapper };
pub use render::{ self, RepositoryWrapper };
pub use super::html::Html;
pub use super::route::Route;
pub use super::utils;

Modified src/handler/commit.rs

@@ -9,7 +9,7 @@ impl Handler for Commit {
let commit = itry!(context.commit(), status::NotFound);
let root = "/".to_owned() + &context.requested_path.to_string_lossy();
Html {
render: Wrapper(RepositoryWrapper(&context, &render::Commit(&root, &context.repository, &commit))),
render: RepositoryWrapper(&context, &render::Commit(&root, &context.repository, &commit)),
etag: Some(EntityTag::weak(versioned_sha1!())),
req: req,
}.into()

Modified src/handler/commits.rs

@@ -12,7 +12,7 @@ impl Handler for Commits {
let reference = context.reference().ok().and_then(|r| r.shorthand().map(ToOwned::to_owned)).unwrap_or_else(|| format!("{}", commit.id()));
let commits = itry!(CommitTree::new(&context.repository, &commit), status::InternalServerError);
Html {
render: Wrapper(RepositoryWrapper(&context, render::Commits(&("/".to_owned() + context.requested_path.to_str().unwrap()), &reference, commits))),
render: RepositoryWrapper(&context, render::Commits(&("/".to_owned() + context.requested_path.to_str().unwrap()), &reference, commits)),
etag: Some(EntityTag::weak(versioned_sha1!(commit.id().as_bytes()))),
req: req,
}.into()

Modified src/handler/error.rs

@@ -9,7 +9,7 @@ macro_rules! error_handler {
fn catch(&self, req: &mut Request, err: IronError) -> IronResult<Response> {
if err.response.status == Some(status::$name) {
Ok(Response::with((status::$name, Html {
render: &Wrapper(render::error::$name(&*err.error)),
render: &render::error::$name(&*err.error),
etag: None,
req: req,
})))

Modified src/handler/html.rs

@@ -6,6 +6,8 @@ use iron::response::Response;
use iron::{ status, IronResult };
use maud::RenderOnce;
use super::utils::{ self, CacheMatches };
use render::Wrapper;
use settings::Settings;
pub struct Html<'a, 'b: 'a, 'c: 'b, R: RenderOnce> {
pub req: &'a Request<'b, 'c>,
@@ -35,7 +37,8 @@ impl<'a, 'b, 'c, R: RenderOnce> Modifier<Response> for Html<'a, 'b, 'c, R> {
return;
}
}
let buffer = to_string!(^self.render);
let settings = self.req.extensions.get::<Settings>().cloned().unwrap_or_default();
let buffer = to_string!(^Wrapper(self.render, settings));
let mime = mime!(Text/Html; Charset=Utf8);
(mime, buffer).modify(response)
}

Modified src/handler/mod.rs

@@ -16,6 +16,7 @@ mod html;
mod base;
pub mod error;
mod tree_entry;
mod settings;
pub use self::avatar::Avatars;
pub use self::review::Review;
@@ -28,3 +29,4 @@ pub use self::tree_entry::TreeEntry;
pub use self::register::Register;
pub use self::statics::Static;
pub use self::settings::{ Settings, SettingsPost };

Modified src/handler/repositories.rs

@@ -41,7 +41,7 @@ impl Handler for Repositories {
fn handle(&self, req: &mut Request) -> IronResult<Response> {
let repos = get_repos(&self.root);
Html {
render: Wrapper(render::Repositories(repos)),
render: render::Repositories(repos),
etag: None,
req: req,
}.into()

Modified src/handler/repository.rs

@@ -10,7 +10,7 @@ impl Handler for Repository {
let resolved_head = itry!(head_ref.resolve(), status::InternalServerError);
let head_id = itry!(resolved_head.target().ok_or(Error::String("Couldn't resolve head")), status::InternalServerError);
Html {
render: Wrapper(RepositoryWrapper(&context, &render::Repository(&context.repository, &head_id))),
render: RepositoryWrapper(&context, &render::Repository(&context.repository, &head_id)),
etag: Some(EntityTag::weak(versioned_sha1!(head_id.as_bytes()))),
req: req,
}.into()

Modified src/handler/review.rs

@@ -15,7 +15,7 @@ impl Handler for Review {
let review = itry!(context.repository.review_for(id), status::NotFound);
let root = "/".to_owned() + &context.requested_path.to_string_lossy();
Html {
render: Wrapper(RepositoryWrapper(&context, &render::Review(&root, &review))),
render: RepositoryWrapper(&context, &render::Review(&root, &review)),
etag: None,
req: req,
}.into()

Modified src/handler/reviews.rs

@@ -7,12 +7,12 @@ pub struct Reviews;
impl Handler for Reviews {
fn handle(&self, req: &mut Request) -> IronResult<Response> {
let context = itry!(req.extensions.get::<RepositoryContext>().ok_or(Error::MissingExtension), status::InternalServerError);
let mut reviews: Vec<_> = context.repository.all_reviews().map(|revs| revs.collect()).ok().unwrap_or_default();
let mut reviews: Vec<_> = context.repository.all_reviews().and_then(|revs| revs.collect()).ok().unwrap_or_default();
reviews.sort_by(|a, b| a.request().timestamp().cmp(&b.request().timestamp()));
reviews.reverse();
let root = "/".to_owned() + &context.requested_path.to_string_lossy();
Html {
render: Wrapper(RepositoryWrapper(&context, &render::Reviews(&root, &reviews))),
render: RepositoryWrapper(&context, &render::Reviews(&root, &reviews)),
etag: None,
req: req,
}.into()

Added src/handler/settings.rs

@@ -0,0 +1,62 @@
use super::base::*;
use settings;
use iron::Plugin;
use iron::modifiers::Redirect;
use params::{ Map, Params, Value };
#[derive(Clone)]
pub struct Settings;
#[derive(Clone)]
pub struct SettingsPost;
impl Handler for Settings {
fn handle(&self, req: &mut Request) -> IronResult<Response> {
let settings = itry!(req.extensions.get::<settings::Settings>().ok_or(Error::MissingExtension), status::InternalServerError);
Html {
render: &render::Settings(settings),
etag: None,
req: req,
}.into()
}
}
impl Route for Settings {
fn method() -> Method {
Method::Get
}
fn route() -> Cow<'static, str> {
"/-/settings".into()
}
}
impl Handler for SettingsPost {
fn handle(&self, req: &mut Request) -> IronResult<Response> {
let settings = {
let map: Map = itry!(req.get::<Params>(), status::InternalServerError);
let settings = itry!(req.extensions.get::<settings::Settings>().ok_or(Error::MissingExtension), status::InternalServerError);
settings.with(
map.iter().filter_map(|(key, value)| match *value {
Value::String(ref value) => Some((&**key, &**value)),
_ => None,
}))
};
println!("{:?}", settings);
let html = Html {
render: &render::Settings(&settings),
etag: None,
req: req,
};
Ok(Response::with((status::SeeOther, Redirect(req.url.clone()), html, &settings)))
}
}
impl Route for SettingsPost {
fn method() -> Method {
Method::Post
}
fn route() -> Cow<'static, str> {
"/-/settings".into()
}
}

Modified src/handler/tree_entry.rs

@@ -24,7 +24,7 @@ impl Handler for TreeEntry {
}
let parent = "/".to_owned() + &context.requested_path.to_string_lossy() + "/tree/" + itry!(reference.shorthand().ok_or(Error::String("Could not get ref shorthand")), status::InternalServerError);
Html {
render: Wrapper(RepositoryWrapper(&context, &render::TreeEntry(&parent, Path::new(entry_path), entry))),
render: RepositoryWrapper(&context, &render::TreeEntry(&parent, Path::new(entry_path), entry)),
etag: Some(EntityTag::weak(versioned_sha1!(commit.id().as_bytes()))),
req: req,
}.into()

Modified src/main.rs

@@ -27,6 +27,7 @@ extern crate pulldown_cmark;
extern crate crypto;
extern crate unicase;
extern crate walkdir;
extern crate params;
#[macro_use]
mod macros;
@@ -39,6 +40,7 @@ mod error;
mod commit_tree;
mod repository_context;
mod repository_extension;
mod settings;
use std::env;
use std::path::Path;
@@ -64,6 +66,8 @@ fn main() {
.register(inject_repository_context(Path::new(&root), handler::Commits))
.register(inject_repository_context(Path::new(&root), handler::Repository))
.register(handler::Repositories { root: root.clone().into() })
.register(handler::Settings)
.register(handler::SettingsPost)
// .register(inject_repository_context(Path::new(&root), handler::Tree))
.register(inject_repository_context(Path::new(&root), handler::TreeEntry))
.register(statics![
@@ -72,6 +76,7 @@ fn main() {
"./static/css/highlight-solarized-light.css",
"./static/css/layout.css",
"./static/css/theme-solarized-dark.css",
"./static/css/theme-solarized-light.css",
"./static/css/font-awesome.min.css",
"./static/fonts/FontAwesome.otf",
"./static/fonts/fontawesome-webfont.eot",
@@ -92,6 +97,7 @@ fn main() {
let mut chain = Chain::new(router);
chain.link_before(logger_before);
chain.link_before(settings::Settings::default());
chain.link_after(handler::error::NotFound);
chain.link_after(handler::error::BadRequest);
chain.link_after(handler::error::InternalServerError);

Modified src/render/error.rs

@@ -2,24 +2,33 @@ use iron;
renderers! {
Error(error: &'a iron::Error) {
pre code ^error
pre.block-details code ^error
}
BadRequest(error: &'a iron::Error) {
h1 "Bad Request"
h2 "Details"
^Error(error)
div.block {
div.block-header {
h2 "Bad Request"
}
^Error(error)
}
}
NotFound(error: &'a iron::Error) {
h1 "Not Found"
h2 "Details"
^Error(error)
div.block {
div.block-header {
h2 "Not Found"
}
^Error(error)
}
}
InternalServerError(error: &'a iron::Error) {
h1 "Internal Server Error"
h2 "Details"
^Error(error)
div.block {
div.block-header {
h2 "Internal Server Error"
}
^Error(error)
}
}
}

Modified src/render/fa.rs

@@ -11,6 +11,8 @@ pub enum FA {
Question,
CodeFork,
Home,
Info,
Cog,
}
#[allow(dead_code)]
@@ -31,6 +33,8 @@ impl FA {
FA::Question => "fa fa-question",
FA::CodeFork => "fa fa-code-fork",
FA::Home => "fa fa-home",
FA::Info => "fa fa-info",
FA::Cog => "fa fa-cog",
}
}
}

Modified src/render/mod.rs

@@ -20,6 +20,7 @@ mod signature;
mod diff;
mod utils;
mod highlight;
mod settings;
pub use self::style::Style;
pub use self::event::{ Event, Events };
@@ -30,7 +31,7 @@ pub use self::ci_status::{ CIStatus };
pub use self::analysis::{ Analysis };
pub use self::avatar::{ Avatar };
pub use self::commit::{ Commit, Commits };
pub use self::repository::{ Repository, Repositories, RepositoryHeader, RepositoriesHeader };
pub use self::repository::{ Repository, Repositories, RepositoryHeader };
pub use self::repository_wrapper::{ RepositoryWrapper };
pub use self::error::{ Error };
pub use self::tree::{ TreeEntry };
@@ -39,3 +40,4 @@ pub use self::signature::Signature;
pub use self::diff::DiffCommit;
pub use self::utils::MaybeLink;
pub use self::highlight::HighlightJS;
pub use self::settings::Settings;

Modified src/render/repository.rs

@@ -90,19 +90,10 @@ renderers! {
}
Repositories(repos: Vec<(String, git2::Repository)>) {
^RepositoriesHeader
@for (path, repo) in repos {
^RepositoryStub(&path, &repo)
}
}
RepositoriesHeader {
div.block {
div.block-header {
h1 { a href="/" { "Repositories" } }
}
}
}
}
impl<'a> super::repository_wrapper::RepositoryTab for &'a Repository<'a> {

Modified src/render/repository_wrapper.rs

@@ -22,7 +22,6 @@ impl<'a, R: RenderOnce + RepositoryTab> RenderOnce for RepositoryWrapper<'a, R>
let RepositoryWrapper(context, content) = self;
let path = context.requested_path.to_string_lossy().into_owned();
html!(w, {
^super::RepositoriesHeader
div.block {
^super::RepositoryHeader(&path, &context.repository)
^RepositoryWrapperTabs(tab, path, context.repository.head().unwrap().shorthand().unwrap().to_owned())

Added src/render/settings.rs

@@ -0,0 +1,23 @@
use settings::{ self, Theme };
renderers! {
Settings(settings: &'a settings::Settings) {
div.block {
div.block-header {
h3 { "Settings" }
}
div.block-details {
form method="POST" {
label for="theme" { "Theme" }
select id="theme" name="theme" required? {
option value=^Theme::SolarizedDark selected?=(settings.theme == Theme::SolarizedDark) { "Solarized Dark" }
option value=^Theme::SolarizedLight selected?=(settings.theme == Theme::SolarizedLight) { "Solarized Light" }
}
button type="submit" {
"Submit"
}
}
}
}
}
}

Modified src/render/style.rs

@@ -1,7 +1,9 @@
use settings::Settings;
renderers! {
Style {
Style(settings: &'a Settings) {
link rel="stylesheet" href="/-/static/css/font-awesome.min.css" { }
link rel="stylesheet" href="/-/static/css/layout.css" { }
link rel="stylesheet" href="/-/static/css/theme-solarized-dark.css" { }
link rel="stylesheet" href=^(format!("/-/static/css/theme-{}.css", settings.theme)) { }
}
}

Modified src/render/wrapper.rs

@@ -1,8 +1,27 @@
use std::fmt;
use maud::{ Render, RenderOnce };
use super::Style;
use super::fa::FA;
use settings::Settings;
pub struct Wrapper<T>(pub T);
renderers! {
Header {
div.block {
div.block-header {
h1 {
a href="/" { "Repositories" }
small.float-right {
a href="/-/settings" { ^FA::Cog }
" "
a href="/-/about" { ^FA::Info }
}
}
}
}
}
}
pub struct Wrapper<T>(pub T, pub Settings);
impl<T: Render> Render for Wrapper<T> {
fn render(&self, mut w: &mut fmt::Write) -> fmt::Result {
@@ -11,9 +30,10 @@ impl<T: Render> Render for Wrapper<T> {
head {
meta name="viewport" content="width=device-width, initial-scale=1" {}
meta name="referrer" content="none-when-downgrade" {}
^Style
^Style(&self.1)
}
body {
^Header
^self.0
}
}
@@ -27,9 +47,10 @@ impl<T: RenderOnce> RenderOnce for Wrapper<T> {
html {
head {
meta name="viewport" content="width=device-width, initial-scale=1" {}
^Style
^Style(&self.1)
}
body {
^Header
^self.0
}
}

Added src/settings.rs

@@ -0,0 +1,92 @@
use std::fmt;
use std::str::FromStr;
use iron::IronResult;
use iron::headers::{ Cookie, CookiePair, SetCookie };
use iron::middleware::BeforeMiddleware;
use iron::request::Request;
use iron::response::Response;
use iron::modifiers::Header;
use iron::modifier::Modifier;
use typemap::Key;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Theme {
SolarizedDark,
SolarizedLight,
}
impl fmt::Display for Theme {
fn fmt(&self, w: &mut fmt::Formatter) -> fmt::Result {
w.write_str(match *self {
Theme::SolarizedDark => "solarized-dark",
Theme::SolarizedLight => "solarized-light",
})
}
}
impl FromStr for Theme {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"solarized-dark" => Ok(Theme::SolarizedDark),
"solarized-light" => Ok(Theme::SolarizedLight),
_ => Err(format!("Unrecognized theme '{}'", s)),
}
}
}
#[derive(Clone, Debug)]
pub struct Settings {
pub theme: Theme,
}
impl Default for Settings {
fn default() -> Settings {
Settings {
theme: Theme::SolarizedDark,
}
}
}
impl Key for Settings {
type Value = Settings;
}
impl Settings {
#[allow(single_match)] // Will have more in the future
pub fn with<'a, 'b, I: Iterator<Item=(&'a str, &'b str)>>(&self, settings: I) -> Settings {
let mut result = self.clone();
for (key, value) in settings {
match key {
"theme" => {
if let Ok(theme) = value.parse().map_err(|e| println!("{}", e)) {
result.theme = theme;
}
},
_ => (),
}
}
result
}
}
impl<'a> Modifier<Response> for &'a Settings {
fn modify(self, response: &mut Response) {
let mut theme = CookiePair::new("theme".to_owned(), self.theme.to_string());
theme.path = Some("/".to_owned());
Header(SetCookie(vec![theme])).modify(response);
}
}
impl BeforeMiddleware for Settings {
fn before(&self, req: &mut Request) -> IronResult<()> {
let settings = match req.headers.get() {
Some(&Cookie(ref cookies)) =>
self.with(cookies.iter().map(|pair| (&*pair.name, &*pair.value))),
None =>
self.clone(),
};
req.extensions.insert::<Settings>(settings);
Ok(())
}
}

Added src/static/css/theme-solarized-light.css

@@ -0,0 +1,50 @@
html * { color-profile: sRGB; }
body { color: #657b83; }
.ci-status a { color: #657b83; }
.expander[disabled] + label:hover { color: #657b83; }
h1, h2, h3, h4, h5, h6 { color: #586e75; }
code { color: #586e75; }
.diff .hunk-header { color: #586e75; }
.diff .hunk-header * { color: #586e75; }
a { color: #268bd2; }
a:hover { color: #3797db }
.status.running { color: #268bd2; }
.expander + label:hover { color: #268bd2; }
.email, .user { color: #d33682; }
.agent, .filename { color: #6c71c4; }
.ref { color: #2aa198; }
.id { color: #cb4b16; }
.timestamp { color: #b58900; }
pre, pre code { color: #839496; }
.status.success, .diff .addition .text:before { color: #859900; }
.status.failure, .diff .deletion .text:before { color: #dc322f; }
body { background-color: #fdf6e3; }
.block-header .ref, .block-header .id { background-color: #fdf6e3; }
.status { background-color: #fdf6e3; }
.tabs { background-color: #fdf6e3; }
pre, pre code { background-color: #002b36; }
code { background-color: #eee8d5; }
.repository-header { background-color: #eee8d5; }
.tabs .selected { background-color: #eee8d5; }
.expander + label { background-color: #eee8d5; }
.block-header { background-color: #eee8d5; }
.ref, .id { background-color: #eee8d5; }
.diff .hunk-header { background-color: #073642; }
.diff .addition { background-color: rgba(133, 153, 0, 0.2); }
.diff .deletion { background-color: rgba(220, 50, 47, 0.2); }
.block-details { border-color: #eee8d5; }
.tabs > * { border-color: #eee8d5; }
blockquote { border-color: #657b83; }
.expander + label { border-color: #fdf6e3; }
.expander + label:hover { border-color: #268bd2; }
.expander[disabled] + label:hover { border-color: #fdf6e3; }
pre .line:before { border-color: #93a1a1; }