summary history branches tags files
commit:b3cf49ee1b27612d3e7a8c9c7ccd7617ed9870b5
author:Trevor Bentley
committer:GitHub
date:Sun Jul 30 15:20:05 2017 +0200
parents:3c0d157e6ac88f9b687e589bf8fb3289e36d9eae, 9513ec2208c19d9ffd78676007d7bd0c1e208deb
Merge pull request #6 from mrmekon/rubrail_0.5.0

Bump to rubrail 0.5.0, switching entirely to fruitbasket
diff --git a/Cargo.lock b/Cargo.lock
line changes: +18/-3
index 2a6c309..d530791
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6,7 +6,7 @@ dependencies = [
  "hn 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rubrail 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rubrail 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -196,6 +196,19 @@ dependencies = [
 ]
 
 [[package]]
+name = "fruitbasket"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log4rs 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "objc_id 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "futures"
 version = "0.1.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -600,10 +613,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "rubrail"
-version = "0.4.3"
+version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cocoa 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "fruitbasket 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "log4rs 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -979,6 +993,7 @@ dependencies = [
 "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344"
 "checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d"
 "checksum fruitbasket 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "45b4ec6423753303cbe363aa4d6004b3f50e93e529851569aee09fc0f705387f"
+"checksum fruitbasket 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3df8e9733c9cb1d6492158e8084532cb0fba9b76f1033bbd652e3cd796801181"
 "checksum futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4b63a4792d4f8f686defe3b39b92127fea6344de5d38202b2ee5a11bbbf29d6a"
 "checksum futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a283c84501e92cade5ea673a2a7ca44f71f209ccdd302a3e0896f50083d2c5ff"
 "checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a"
@@ -1026,7 +1041,7 @@ dependencies = [
 "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
 "checksum rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "eb250fd207a4729c976794d03db689c9be1d634ab5a1c9da9492a13d8fecbcdf"
 "checksum redox_syscall 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "ddab7acd8e7bf3e49dfdf78ac1209b992329eb2f66e0bf672ab49c70a76d1d68"
-"checksum rubrail 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "95cb253f41ab78e8bf03557b46745512fdf3c3016710030ccf05056466dc0243"
+"checksum rubrail 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "99a78ca61325492cc120442252c3fd5a504fa8069aa948c092a6ff0334e72363"
 "checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
 "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
 "checksum schannel 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "14a5f8491ae5fc8c51aded1f5806282a0218b4d69b1b76913a0559507e559b90"

diff --git a/Cargo.toml b/Cargo.toml
line changes: +1/-1
index a47d6e7..21edfbf
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ codegen-units = 1
 panic = 'unwind'
 
 [dependencies]
-rubrail = "0.4"
+rubrail = "0.5"
 hn = "0.3"
 open = "1.2"
 log = {version = "0.3", optional = true }

diff --git a/release_osx.sh b/release_osx.sh
line changes: +3/-2
index 996f992..8bd8c86
--- a/release_osx.sh
+++ b/release_osx.sh
@@ -3,11 +3,12 @@
 APP="toucHNews"
 DST="target/"
 APPDIR="toucHNews.app"
+RELEASE=`git describe --abbrev=0`
 
-echo "Building OS X app..."
+echo "Building OS X app $RELEASE..."
 
 cargo run --release && pkill "$APP"
 
-(cd "$DST" && zip -r9 "$APP.zip" "$APPDIR" && md5 "$APP.zip" > "$APP.md5")
+(cd "$DST" && zip -r9 "$RELEASE.zip" "$APPDIR" && md5 "$RELEASE.zip" > "$RELEASE.md5")
 
 echo "Done!"

diff --git a/src/main.rs b/src/main.rs
line changes: +6/-4
index ce72c29..e779b9d
--- a/src/main.rs
+++ b/src/main.rs
@@ -38,7 +38,7 @@ enum Cmd {
 }
 
 impl TouchbarUI {
-    fn init() -> TouchbarUI {
+    fn init(stopper: fruitbasket::FruitStopper) -> TouchbarUI {
         let (tx,rx) = channel::<Cmd>();
         let mut touchbar = Touchbar::alloc("hn");
         let hn = HackerNews::new();
@@ -87,7 +87,8 @@ impl TouchbarUI {
             *writer = 0;
         }));
 
-        let quit_button = touchbar.create_button(None, Some("X"), Box::new(move |_| {rubrail::app::quit()}));
+        let quit_stopper = stopper.clone();
+        let quit_button = touchbar.create_button(None, Some("X"), Box::new(move |_| {quit_stopper.stop()}));
         touchbar.update_button_width(&quit_button, 30);
 
         let flexible_space = touchbar.create_spacer(SpacerType::Flexible);
@@ -151,8 +152,6 @@ impl TouchbarUI {
 fn main() {
     #[cfg(feature = "log")]
     fruitbasket::create_logger(".touchnews.log", fruitbasket::LogDir::Home, 5, 2).unwrap();
-    rubrail::app::init_app();
-    let mut bar = TouchbarUI::init();
     let icon = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
         .join("icon").join("toucHNews.icns");
     let mut nsapp = fruitbasket::Trampoline::new(
@@ -166,6 +165,9 @@ fn main() {
     #[cfg(feature = "log")]
     info!("Launched toucHNews!");
 
+    let stopper = nsapp.stopper();
+    let mut bar = TouchbarUI::init(stopper);
+
     loop {
         if let Ok(cmd) = bar.rx.recv_timeout(Duration::from_millis(100)) {
             match cmd {