From eea1112103fe6c9c2ea146b864ee371d5a1d7213 Mon Sep 17 00:00:00 2001 From: Severen Redwood Date: Tue, 22 Mar 2016 20:09:13 +1300 Subject: [PATCH] Rename project to 'tutil' --- CHANGELOG.md | 3 +-- Cargo.toml | 4 ++-- README.md | 21 +++++++++++++++------ examples/simple.rs | 6 +++--- src/crayon.rs | 22 +++++++++++----------- src/lib.rs | 6 +++--- 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3b0acd..c77733d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,6 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). ## 0.1.0 - 2016-03-21 -Initial project commit. ### Added -- `rustty::pastel` module for terminal colourisation and styling. +- `tutil::pastel` module for terminal colourisation and styling. diff --git a/Cargo.toml b/Cargo.toml index 36f69f9..998b4aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "rustty" +name = "tutil" version = "0.1.0" license = "MPL-2.0" authors = ["Severen Redwood "] readme = "README.md" -homepage = "https://github.com/SShrike/rustty" +homepage = "https://github.com/SShrike/tutil" description = "A toolbox for developing command line applications." [dependencies] diff --git a/README.md b/README.md index e8b24ea..4a1419e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ -# RusTTY +# Tutil -RusTTY is a toolbox for developing command line applications in Rust, influenced -by the [TTY library][tty] for Ruby. RusTTY intends to reach feature parity with -the majority of TTY's features to the extent that is practical as well as have -an extensive and thorough test suite. +[![Travis CI][travis-ci-badge]][travis-ci] +[![Gitter][gitter-badge]][gitter] + +Tutil is a toolbox for developing command line applications in Rust, influenced +by the [TTY library][tty] for Ruby which intends to reach feature parity with +the majority of TTY's features to the extent that is practical in addition to +having an extensive and thorough test suite. ## Features @@ -27,7 +30,13 @@ Add the following to your `Cargo.toml` under the dependencies section: ```toml [dependencies] -rustty = "^0.1.0" +tutil = "^0.1.0" ``` + [tty]: http://peter-murach.github.io/tty/ + +[travis-ci]: https://travis-ci.org/SShrike/tutil +[travis-ci-badge]: https://img.shields.io/travis/SShrike/tutil.svg +[gitter]: https://gitter.im/SShrike/tutil +[gitter-badge]: https://img.shields.io/gitter/room/SShrike/tutil.svg diff --git a/examples/simple.rs b/examples/simple.rs index 6530300..6e7de2c 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1,7 +1,7 @@ -extern crate rustty; +extern crate tutil; -use rustty::crayon::Style; -use rustty::crayon::Color::*; +use tutil::crayon::Style; +use tutil::crayon::Color::*; fn main() { println!("{}", Red.on(Black).blink().paint("Hello world!")); diff --git a/src/crayon.rs b/src/crayon.rs index 96de345..bef9446 100644 --- a/src/crayon.rs +++ b/src/crayon.rs @@ -24,7 +24,7 @@ //! `Color`. For example, here is how you get red text and blue text: //! //! ``` -//! use rustty::crayon::Color::{Red, Blue}; +//! use tutil::crayon::Color::{Red, Blue}; //! //! println!("{}", Red.paint("Hello world in red!")); //! println!("{}", Blue.paint("Hello world in blue!")); @@ -40,7 +40,7 @@ //! //! ``` //! use std::string::ToString; -//! use rustty::crayon::Color::Blue; +//! use tutil::crayon::Color::Blue; //! //! let string = Blue.paint("Hello!").to_string(); // => "\x1b[34mTEST\x1b[0m" //! ``` @@ -51,8 +51,8 @@ //! directly on a `Color`: //! //! ``` -//! use rustty::crayon::Style; -//! use rustty::crayon::Color::{Red, Blue}; +//! use tutil::crayon::Style; +//! use tutil::crayon::Color::{Red, Blue}; //! //! // Red blinking text on a black background: //! println!("This will be {} and this will be {}.", @@ -65,7 +65,7 @@ //! `Style::new()`: //! //! ``` -//! use rustty::crayon::Color::{Red, Blue}; +//! use tutil::crayon::Color::{Red, Blue}; //! //! // Red blinking text on a black background: //! println!("This will be {} and this will be {}.", @@ -310,6 +310,12 @@ impl Style { Style::default() } + /// Applies the `Style` to a string, yielding a `StyledString`. + pub fn paint<'a, S>(self, string: S) -> StyledString<'a> + where S: Into> { + StyledString { string: string.into(), style: self } + } + /// Sets the foreground to the given colour. pub fn foreground(&self, color: Color) -> Style { Style { foreground: Some(color), .. *self } @@ -320,12 +326,6 @@ impl Style { Style { background: Some(color), .. *self } } - /// Applies the `Style` to a string, yielding a `StyledString`. - pub fn paint<'a, S>(self, string: S) -> StyledString<'a> - where S: Into> { - StyledString { string: string.into(), style: self } - } - /// Applies the 'bold' property. pub fn bold(&self) -> Style { Style { bold: true, .. *self } diff --git a/src/lib.rs b/src/lib.rs index 3f91dd4..4cb7171 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -//! RusTTY is a toolbox for developing command line applications in Rust, +//! Tutil is a toolbox for developing command line applications in Rust, //! influenced by the [TTY library][tty] for Ruby. It provides modules for //! common tasks such as colourisation, gathering information from the user, //! confirmation prompts, and querying the system and terminal. It is not @@ -16,8 +16,8 @@ //! [pull request][pr] correcting the spelling. //! //! [tty]: http://peter-murach.github.io/tty/ -//! [br]: https://github.com/SShrike/rustty/issues -//! [pr]: https://github.com/SShrike/rustty/pulls +//! [br]: https://github.com/SShrike/tutil/issues +//! [pr]: https://github.com/SShrike/tutil/pulls #![cfg_attr(feature = "lints", feature(plugin))] #![cfg_attr(feature = "lints", plugin(clippy))] -- 2.11.4.GIT