Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with guard, and unclear documentation. #26

Closed
mrjoshuak opened this issue Feb 27, 2015 · 9 comments
Closed

Not working with guard, and unclear documentation. #26

mrjoshuak opened this issue Feb 27, 2015 · 9 comments

Comments

@mrjoshuak
Copy link

First of all the Readme.md is confusing on how normal operation is expected to work. The usage section starts with "You could also use the notifier directly." Also? Also as apposed to what? You can't start by saying 'also', you have to first state what is the normal usage, then you can say "also" to add additional usage instructions.

On top of this the examples don't mean anything. What is the context in which TerminalNotifier::Guard.notify('Hello World') should appear? Not on the command line, not in irb, not in the guard file. Where? Did you forget to specify a requires line, is this a rake task?

So the question is:

Is it supposed to 'just work'(tm)? If that is the case then I have a bug in functionality to report.

or

Am I supposed to do something to my guard file to get it to work? In that case I have a documentation bug to report.

Here are the steps to reproduce the issue I'm having.

Mac OS X 10.10.2 in terminal.

  1. > brew install terminal-notifier

  2. > terminal-notifier

    terminal-notifier (1.6.2) is a command-line tool to send OS X User Notifications.
    ...
    
  3. Added gem 'terminal-notifier-guard', '~> 1.6.1' to Gemfile.

  4. > bundle install

    Fetching gem metadata from https://rubygems.org/...........
    Resolving dependencies...
    ...
    Installing terminal-notifier-guard 1.6.1
    ...
    
  5. bundle exec guard

    Guard file looks like:

    guard :shell, first_match: true do
      watch(/(.*)(?<!\.nn|\.y).go$/) {|m| `make` }
      watch(/(.*).nn$/) {|m| `make` }
      watch(/(.*).y$/) {|m| `make` }
    end

    I get expected / typical guard output, but no notification appears.

  6. However, if I run > terminal-notifier -message "test" I get a notification as expected.

Am I missing a step or is there a bug?
I've tried to read through various issues(*) but it quickly turns into a game of portal as each issue refers to other which refer to still other issues which then refer to pull requests which then refer back to the starting issue. It is un-clear which, if any, of these should be followed. I tried a couple of suggestions, and a PR, but none of those changed the behavior described above.

*Issues

#22
#13
#12
#15

guard/guard#626
julienXX#106
...

@mjtko
Copy link

mjtko commented Mar 17, 2015

Looks like adding this to Guardfile does the magic:

notification :terminal_notifier

Seems like a documentation bug.

@NARKOZ
Copy link

NARKOZ commented Mar 17, 2015

@mjtko didn't help me.

@mjtko
Copy link

mjtko commented Mar 17, 2015

@NARKOZ does terminal-notifier -message "test" work?

Adding that notification line to my Guardfile was the only other thing I needed to do (other than brew install terminal-notifier && brew linkapps terminal-notifier)

@NARKOZ
Copy link

NARKOZ commented Mar 17, 2015

@mjtko no. It freezes and I need to kill it via Ctrl+C

$ which terminal-notifier          
/usr/local/bin/terminal-notifier

UPD: seems that's because I'm running it from tmux.

@mjtko
Copy link

mjtko commented Mar 17, 2015

Ah - need to make that work first then! Perhaps this will help? julienXX#115

@maslenkov
Copy link

I use zsh and rvm. Guard does not touch terminal-notifier when I start it without bundle exec. But it works fine if I start it with bundle exec guard.

wearethefoos pushed a commit that referenced this issue Feb 20, 2016
fixes #26

Thanks to @tamano for pointing out that it was missing
@debajit
Copy link

debajit commented Mar 6, 2016

This is for anyone else who runs into this issue. I needed to add a require 'terminal-notifier-guard' (note the hyphens) — I was using underscores earlier. Looks like the require needs hyphens whereas the gem uses underscores.

With the require statement corrected, I am able to display OS X notifications in irb as well as in the Guardfile

@dcalhoun
Copy link

dcalhoun commented May 3, 2016

I ran into this issue as well. It turns out things were failing for me because of tmux. Here is a fix for using terminal-notifier-guard with tmux.

wearethefoos pushed a commit that referenced this issue May 4, 2016
@wearethefoos
Copy link
Member

Thanks all for reporting. I updated the README with some extra clarification on these and other matters.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants