Skip to content

Commit

Permalink
New version: 0.4.0-rc.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Oct 31, 2018
1 parent 4b5000e commit 4dbd87a
Show file tree
Hide file tree
Showing 22 changed files with 587 additions and 29 deletions.
385 changes: 385 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions contrib/codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket_contrib_codegen"
version = "0.4.0-dev"
version = "0.4.0-rc.1"
authors = ["Sergio Benitez <[email protected]>"]
description = "Procedural macros for the Rocket contrib libraries."
documentation = "https://api.rocket.rs/v0.4/rocket_contrib/"
Expand All @@ -9,7 +9,7 @@ repository = "https://github.com/SergioBenitez/Rocket"
readme = "../../README.md"
keywords = ["rocket", "contrib", "code", "generation", "proc-macro"]
license = "MIT/Apache-2.0"
build = "../../core/lib/build.rs"
build = "build.rs"

[features]
database_attribute = []
Expand Down
56 changes: 56 additions & 0 deletions contrib/codegen/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//! This tiny build script ensures that rocket is not compiled with an
//! incompatible version of rust.
extern crate yansi;
extern crate version_check;

use yansi::Color::{Red, Yellow, Blue, White};
use version_check::{supports_features, is_min_version, is_min_date};

// Specifies the minimum nightly version needed to compile Rocket.
const MIN_DATE: &'static str = "2018-10-05";
const MIN_VERSION: &'static str = "1.31.0-nightly";

fn main() {
let ok_channel = supports_features();
let ok_version = is_min_version(MIN_VERSION);
let ok_date = is_min_date(MIN_DATE);
let triple = (ok_channel, ok_version, ok_date);

let print_version_err = |version: &str, date: &str| {
eprintln!("{} {}. {} {}.",
White.paint("Installed version is:"),
Yellow.paint(format!("{} ({})", version, date)),
White.paint("Minimum required:"),
Yellow.paint(format!("{} ({})", MIN_VERSION, MIN_DATE)));
};

if let (Some(ok_channel), Some((ok_version, version)), Some((ok_date, date))) = triple {
if !ok_channel {
eprintln!("{} {}",
Red.paint("Error:").bold(),
White.paint("Rocket requires a nightly or dev version of Rust."));
print_version_err(&*version, &*date);
eprintln!("{}{}{}",
Blue.paint("See the getting started guide ("),
White.paint("https://rocket.rs/v0.4/guide/getting-started/"),
Blue.paint(") for more information."));
panic!("Aborting compilation due to incompatible compiler.")
}

if !ok_version || !ok_date {
eprintln!("{} {}",
Red.paint("Error:").bold(),
White.paint("Rocket requires a more recent version of rustc."));
eprintln!("{}{}{}",
Blue.paint("Use `"),
White.paint("rustup update"),
Blue.paint("` or your preferred method to update Rust."));
print_version_err(&*version, &*date);
panic!("Aborting compilation due to incompatible compiler.")
}
} else {
println!("cargo:warning={}", "Rocket was unable to check rustc compatibility.");
println!("cargo:warning={}", "Build may fail due to incompatible rustc version.");
}
}
6 changes: 3 additions & 3 deletions contrib/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket_contrib"
version = "0.4.0-dev"
version = "0.4.0-rc.1"
authors = ["Sergio Benitez <[email protected]>"]
description = "Community contributed libraries for the Rocket web framework."
documentation = "https://api.rocket.rs/v0.4/rocket_contrib/"
Expand Down Expand Up @@ -35,8 +35,8 @@ redis_pool = ["databases", "redis", "r2d2_redis"]

[dependencies]
# Global dependencies.
rocket_contrib_codegen = { version = "0.4.0-rc", path = "../codegen", optional = true }
rocket = { version = "0.4.0-rc", path = "../../core/lib/" }
rocket_contrib_codegen = { version = "0.4.0-rc.1", path = "../codegen", optional = true }
rocket = { version = "0.4.0-rc.1", path = "../../core/lib/" }
log = "0.4"

# Serialization and templating dependencies.
Expand Down
2 changes: 1 addition & 1 deletion contrib/lib/src/databases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//!
//! ```toml
//! [dependencies.rocket_contrib]
//! version = "0.4.0-dev"
//! version = "0.4.0-rc.1"
//! default-features = false
//! features = ["diesel_sqlite_pool"]
//! ```
Expand Down
2 changes: 1 addition & 1 deletion contrib/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//!
//! ```toml
//! [dependencies.rocket_contrib]
//! version = "0.4.0-dev"
//! version = "0.4.0-rc.1"
//! default-features = false
//! features = ["json"]
//! ```
Expand Down
2 changes: 1 addition & 1 deletion contrib/lib/src/templates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//!
//! ```toml
//! [dependencies.rocket_contrib]
//! version = 0.4.0-dev
//! version = 0.4.0-rc.1
//! default-features = false
//! features = ["handlebars_templates", "tera_templates"]
//! ```
Expand Down
8 changes: 4 additions & 4 deletions core/codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket_codegen"
version = "0.4.0-dev"
version = "0.4.0-rc.1"
authors = ["Sergio Benitez <[email protected]>"]
description = "Procedural macros for the Rocket web framework."
documentation = "https://api.rocket.rs/v0.4/rocket_codegen/"
Expand All @@ -9,21 +9,21 @@ repository = "https://github.com/SergioBenitez/Rocket"
readme = "../../README.md"
keywords = ["rocket", "web", "framework", "code", "generation"]
license = "MIT/Apache-2.0"
build = "../lib/build.rs"
build = "build.rs"

[lib]
proc-macro = true

[dependencies]
indexmap = "1.0"
quote = "0.6.1"
rocket_http = { version = "0.4.0-dev", path = "../http/" }
rocket_http = { version = "0.4.0-rc.1", path = "../http/" }
devise = "0.1"

[build-dependencies]
yansi = "0.4"
version_check = "0.1.3"

[dev-dependencies]
rocket = { version = "0.4.0-dev", path = "../lib" }
rocket = { version = "0.4.0-rc.1", path = "../lib" }
compiletest_rs = { git = "https://github.com/laumann/compiletest-rs" }
56 changes: 56 additions & 0 deletions core/codegen/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//! This tiny build script ensures that rocket is not compiled with an
//! incompatible version of rust.
extern crate yansi;
extern crate version_check;

use yansi::Color::{Red, Yellow, Blue, White};
use version_check::{supports_features, is_min_version, is_min_date};

// Specifies the minimum nightly version needed to compile Rocket.
const MIN_DATE: &'static str = "2018-10-05";
const MIN_VERSION: &'static str = "1.31.0-nightly";

fn main() {
let ok_channel = supports_features();
let ok_version = is_min_version(MIN_VERSION);
let ok_date = is_min_date(MIN_DATE);
let triple = (ok_channel, ok_version, ok_date);

let print_version_err = |version: &str, date: &str| {
eprintln!("{} {}. {} {}.",
White.paint("Installed version is:"),
Yellow.paint(format!("{} ({})", version, date)),
White.paint("Minimum required:"),
Yellow.paint(format!("{} ({})", MIN_VERSION, MIN_DATE)));
};

if let (Some(ok_channel), Some((ok_version, version)), Some((ok_date, date))) = triple {
if !ok_channel {
eprintln!("{} {}",
Red.paint("Error:").bold(),
White.paint("Rocket requires a nightly or dev version of Rust."));
print_version_err(&*version, &*date);
eprintln!("{}{}{}",
Blue.paint("See the getting started guide ("),
White.paint("https://rocket.rs/v0.4/guide/getting-started/"),
Blue.paint(") for more information."));
panic!("Aborting compilation due to incompatible compiler.")
}

if !ok_version || !ok_date {
eprintln!("{} {}",
Red.paint("Error:").bold(),
White.paint("Rocket requires a more recent version of rustc."));
eprintln!("{}{}{}",
Blue.paint("Use `"),
White.paint("rustup update"),
Blue.paint("` or your preferred method to update Rust."));
print_version_err(&*version, &*date);
panic!("Aborting compilation due to incompatible compiler.")
}
} else {
println!("cargo:warning={}", "Rocket was unable to check rustc compatibility.");
println!("cargo:warning={}", "Build may fail due to incompatible rustc version.");
}
}
2 changes: 1 addition & 1 deletion core/codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//!
//! ```toml
//! [dependencies]
//! rocket = "0.4.0-dev"
//! rocket = "0.4.0-rc.1"
//! ```
//!
//! And to import all macros, attributes, and derives via `#[macro_use]` in the
Expand Down
4 changes: 2 additions & 2 deletions core/http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket_http"
version = "0.4.0-dev"
version = "0.4.0-rc.1"
authors = ["Sergio Benitez <[email protected]>"]
description = """
Types, traits, and parsers for HTTP requests, responses, and headers.
Expand Down Expand Up @@ -34,4 +34,4 @@ features = ["server"]
optional = true

[dev-dependencies]
rocket = { version = "0.4.0-dev", path = "../lib" }
rocket = { version = "0.4.0-rc.1", path = "../lib" }
6 changes: 3 additions & 3 deletions core/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rocket"
version = "0.4.0-dev"
version = "0.4.0-rc.1"
authors = ["Sergio Benitez <[email protected]>"]
description = """
Web framework for nightly with a focus on ease-of-use, expressibility, and speed.
Expand All @@ -18,8 +18,8 @@ categories = ["web-programming::http-server"]
tls = ["rocket_http/tls"]

[dependencies]
rocket_codegen = { version = "0.4.0-dev", path = "../codegen" }
rocket_http = { version = "0.4.0-dev", path = "../http" }
rocket_codegen = { version = "0.4.0-rc.1", path = "../codegen" }
rocket_http = { version = "0.4.0-rc.1", path = "../http" }
yansi = "0.4"
log = "0.4"
toml = "0.4.7"
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
//!
//! ```toml
//! [dependencies]
//! rocket = "0.4.0-dev"
//! rocket = "0.4.0-rc.1"
//! ```
//!
//! Then, add the following to the top of your `main.rs` file:
Expand Down
4 changes: 2 additions & 2 deletions scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ function relative() {
}

# Full and major version of Rocket
ROCKET_VERSION="0.4.0-dev"
ROCKET_VERSION="0.4.0-rc.1"
ROCKET_MAJOR_VERSION="0.4"
CURRENT_RELEASE=false
CURRENT_RELEASE=true

# Root of workspace-like directories.
PROJECT_ROOT=$(relative "") || exit $?
Expand Down
2 changes: 1 addition & 1 deletion site/guide/1-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For instance, the following set of commands runs the `hello_world` example:
```sh
git clone https://github.com/SergioBenitez/Rocket
cd Rocket
git checkout v0.4.0-dev
git checkout v0.4.0-rc.1
cd examples/hello_world
cargo run
```
Expand Down
4 changes: 2 additions & 2 deletions site/guide/10-pastebin.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Then add the usual Rocket dependencies to the `Cargo.toml` file:

```toml
[dependencies]
rocket = "0.4.0-dev"
rocket_codegen = "0.4.0-dev"
rocket = "0.4.0-rc.1"
rocket_codegen = "0.4.0-rc.1"
```

And finally, create a skeleton Rocket application to work off of in
Expand Down
2 changes: 1 addition & 1 deletion site/guide/2-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Now, add Rocket as a dependency in your `Cargo.toml`:

```
[dependencies]
rocket = "0.4.0-dev"
rocket = "0.4.0-rc.1"
```

Modify `src/main.rs` so that it contains the code for the Rocket `Hello, world!`
Expand Down
2 changes: 1 addition & 1 deletion site/guide/6-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ databases, you'd write in `Cargo.toml`:

```toml
[dependencies.rocket_contrib]
version = "0.4.0-dev"
version = "0.4.0-rc.1"
default-features = false
features = ["diesel_sqlite_pool"]
```
Expand Down
2 changes: 1 addition & 1 deletion site/guide/9-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ dependency in your `Cargo.toml` file:

```
[dependencies]
rocket = { version = "0.4.0-dev", features = ["tls"] }
rocket = { version = "0.4.0-rc.1", features = ["tls"] }
```

TLS is configured through the `tls` configuration parameter. The value of `tls`
Expand Down
4 changes: 2 additions & 2 deletions site/index.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
###############################################################################

[release]
version = "0.4.0-dev"
date = "Oct 28, 2018"
version = "0.4.0-rc.1"
date = "Oct 31, 2018"

###############################################################################
# Top features: displayed in the header under the introductory text.
Expand Down
41 changes: 41 additions & 0 deletions site/news/2018-10-31-version-0.4-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Rocket v0.4 Release Candidate

<p class="metadata"><strong>
Posted by <a href="https://sergio.bz">Sergio Benitez</a> on October 31, 2018
</strong></p>

I am delighted to announce that a release candidate for Rocket v0.4 is available
today! This release brings over a year of features, improvements, and
refinements, resolving some of the most called for requests and bringing Rocket
measurably closer to stable compatibility.

The release candidate is an opportunity to discover issues with Rocket v0.4 and
its documentation before its general release. We encourage all users to migrate
their applications to the release candidate and report any issues to the [GitHub
issue tracker].

Barring any major issues, the general release of Rocket v0.4 is planned for
Friday, November 9th, when we'll post a full news article covering the biggest
features and changes in Rocket v0.4. Until then, the [CHANGELOG] contains every
feature addition, change, and improvement since v0.3, as well as information on
migrating your applications to v0.4. All documentation, including the [guide]
and [API docs], has been updated in full for v0.4.

We're excited for your feedback, and we look forward to seeing you again on
Friday, November 9th for the general release!

[GitHub issue tracker]: https://github.com/SergioBenitez/Rocket/issues
[API docs]: https://api.rocket.rs/v0.4/rocket/
[guide]: ../../guide
[CHANGELOG]: https://github.com/SergioBenitez/Rocket/tree/v0.4/CHANGELOG.md#version-040-rc-oct-31-2018

## About Rocket

Rocket is a web framework for Rust with a focus on ease of use, expressibility,
and speed. Rocket makes it simple to write fast web applications without
sacrificing flexibility or type safety. All with minimal code.

Not already using Rocket? Join the tens of thousands of users and hundreds of
companies happily using Rocket today! Rocket's extensive documentation makes it
easy. Get started now by [reading through the guide](../../guide) or learning
more from [the overview](../../overview).
20 changes: 20 additions & 0 deletions site/news/index.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
[[articles]]
title = "Rocket v0.4 Release Candidate"
slug = "2018-10-31-version-0.4-rc"
author = "Sergio Benitez"
author_url = "https://sergio.bz"
date = "October 31, 2018"
snippet = """
I am delighted to announce that a release candidate for Rocket v0.4 is available
today! This release brings over a year of features, improvements, and
refinements, resolving some of the most called for requests and bringing Rocket
measurably closer to stable compatibility.
The release candidate is an opportunity to discover issues with Rocket v0.4 and
its documentation before its general release. We encourage all users to migrate
their applications to the release candidate and report any issues to the [GitHub
issue tracker].
[GitHub issue tracker]: https://github.com/SergioBenitez/Rocket/issues
"""

[[articles]]
title = "Rocket v0.3: Fairings, TLS, Private Cookies"
slug = "2017-07-14-version-0.3"
Expand Down

0 comments on commit 4dbd87a

Please sign in to comment.