From 0395780f253ffedfe73f6b9cfb9856e63e278907 Mon Sep 17 00:00:00 2001
From: Alexandre Bury <alexandre.bury@gmail.com>
Date: Mon, 19 Dec 2016 16:45:11 +0100
Subject: [PATCH] Add travis integration (#81)

* Add travis integration

* Update examples/rainbow to work on stable
---
 .travis.yml         | 10 ++++++++++
 examples/rainbow.rs | 10 +++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)
 create mode 100644 .travis.yml

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..076b5dd5
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,10 @@
+language: rust
+cache: cargo
+rust:
+    - stable
+    - beta
+    - nightly
+script:
+    - cargo build --verbose
+    - cargo test --verbose
+    - cargo test --release --verbose
diff --git a/examples/rainbow.rs b/examples/rainbow.rs
index 03c22821..e6ee27ba 100644
--- a/examples/rainbow.rs
+++ b/examples/rainbow.rs
@@ -1,5 +1,3 @@
-#![feature(step_by)]
-
 extern crate termion;
 
 use termion::event::Key;
@@ -10,8 +8,10 @@ use std::io::{Write, stdout, stdin};
 fn rainbow<W: Write>(stdout: &mut W, blue: u8) {
     write!(stdout, "{}{}", termion::cursor::Goto(1, 1), termion::clear::All).unwrap();
 
-    for red in (0..255).step_by(8 as u8) {
-        for green in (0..255).step_by(4) {
+    for red in 0..32 {
+        let red = red * 8;
+        for green in 0..64 {
+            let green = green * 4;
             write!(stdout, "{} ", termion::color::Bg(termion::color::Rgb(red, green, blue))).unwrap();
         }
         write!(stdout, "\n\r").unwrap();
@@ -24,7 +24,7 @@ fn main() {
     let stdin = stdin();
     let mut stdout = stdout().into_raw_mode().unwrap();
 
-    writeln!(stdout, "{}{}{}Use the arrow keys to change the blue in the rainbow.",
+    writeln!(stdout, "{}{}{}Use the up/down arrow keys to change the blue in the rainbow.",
            termion::clear::All,
            termion::cursor::Goto(1, 1),
            termion::cursor::Hide).unwrap();
-- 
GitLab