Coder Social home page Coder Social logo

terminal-notifier-guard's Introduction

TerminalNotifier - Guard Style

A simple Ruby wrapper around the terminal-notifier command-line tool, which allows you to send User Notifications to the Notification Center on Mac OS X 10.8, or higher.

This version has 4 different icons included for each status that Guard supports:

  1. Failed
  2. Notify
  3. Pending
  4. Success

Installation

This version depends on the official terminal-notifier. Install it with Homebrew or see the official Installation instructions.

$ brew install terminal-notifier

Then, install the gem

$ gem install terminal-notifier-guard

Or add it to your Gemfile:

gem 'terminal-notifier-guard', '~> 1.6.1'

Usage

Add the notifier to your Guardfile:

# Guardfile
notification :terminal_notifier if `uname` =~ /Darwin/

Note: The uname check is necessary if you have contributors to your project who are not on OSX.

You can pass in options if you like, e.g. for the app name (used in the title) and what app to activate when you click the notification (defaults to Terminal.app):

# Guardfile
notification :terminal_notifier, app_name: "MyApp ::", activate: 'com.googlecode.iTerm2' if `uname` =~ /Darwin/

Configure Binary Path

You can override the binary path detection with an environment variable. This solves a problem where the default binary found by which is the Ruby gem version of terminal-notifier. This version is slow, especially in a Bundler environment.

In this scenario we would much rather use the version installed by Homebrew at /usr/local/bin/terminal-notifier which is noticeably faster.

This gem allows you to set an environment variable to explicitly specify the binary to use, like this:

export TERMINAL_NOTIFIER_BIN=/usr/local/bin/terminal-notifier

When using guard to monitor test results in TDD, speed is of the essence. Using the right binary can save a half second or more during each test run, which doesn't seem like much but makes a big difference in productivity.

OSX 10.8 users

As of version 1.6.1, we no longer bundle notifier binaries in this gem. Please revert to version 1.5.3 for OSX 10.8 support.

Stand-alone Usage

You could also use the notifier directly.

Examples are:

TerminalNotifier::Guard.notify('Hello World')
TerminalNotifier::Guard.notify('Hello World', :title => 'Ruby', :subtitle => 'Programming Language')
TerminalNotifier::Guard.notify('Hello World', :activate => 'com.apple.Safari')
TerminalNotifier::Guard.notify('Hello World', :open => 'http://twitter.com/alloy')
TerminalNotifier::Guard.notify('Hello World', :execute => 'say "OMG"')
TerminalNotifier::Guard.notify('Hello World', :group => Process.pid)

TerminalNotifier::Guard.remove(Process.pid)

TerminalNotifier::Guard.list(Process.pid)
TerminalNotifier::Guard.list

TerminalNotifier::Guard.failed('This did not go well.')
TerminalNotifier::Guard.success('This did not go bad.')
TerminalNotifier::Guard.pending('This needs some work still')

Caveats

It has been reported that Terminal Notifier fails when run from Tmux without reattach-to-user-namespace installed. See this comment for details.

License

All the works are available under the MIT license.

See LICENSE for details.

Contributors & Thanks to

  • @alloy (For the terminal-notifier)
  • @railsme (For a clean way to test for OSX version #15)
  • @jamilbx (For support for local terminal-notifier command #8)
  • @mattbrictson (For adding support for the TERMINAL_NOTIFIER_BIN env var)
  • @goronfreeman (For the lovely icon set!)
  • @bbonamin (For fixing the license issue)
  • @croeck (For fixing the binary detection)

terminal-notifier-guard's People

Contributors

alloy avatar bbonamin avatar croeck avatar frostrubin avatar glittershark avatar goronfreeman avatar henrikbrixandersen avatar mattbrictson avatar ranmocy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terminal-notifier-guard's Issues

Specify terminal-notifier as gem dependency

It sounds like the terminal-notifier gem is a dependency for this gem to work. Is there a reason that this isn't specified as a dependency in the gemspec? Maybe this part was just overlooked since the binary is no longer bundled with this gem. I recently ran into the issue where I needed to manually install the terminal-notifier gem which was very strange because that part didn't seem to be documented anywhere.

guard-shell not notifying the results

I tried to setup everything as mentioned in the README. Its working perfectly for guard-rspec. But guard-shell is not notifying the results, even though guard captured the changes and it is running the tests.

Kindly advice.

Status appIcon no longer shown

Not sure when, but several macOS versions ago, the app icon is forced to be the actual app icon. Only contentImage has any effect now.

But as of df82582 the appIcon and contentImage options were switched, making all guard notifications look the same:

["/opt/rbenv/versions/2.7.2/bin/terminal-notifier",
 "-title",
 "RSpec results",
 "-priority",
 "-2",
 "-message",
 "2 examples, 0 failures in 0.0185 seconds",
 "-contentImage",
 "/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/terminal-notifier-guard-1.7.0/icons/Guard.icns",
 "-appIcon",
 "/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/terminal-notifier-guard-1.7.0/icons/Success.icns"]

Screen Shot 2021-03-09 at 10 05 44

["/opt/rbenv/versions/2.7.2/bin/terminal-notifier",
 "-title",
 "RSpec results",
 "-priority",
 "-2",
 "-message",
 "2 examples, 2 failures in 1.1234 seconds",
 "-contentImage",
 "/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/terminal-notifier-guard-1.7.0/icons/Guard.icns",
 "-appIcon",
 "/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/terminal-notifier-guard-1.7.0/icons/Failed.icns"]

Screen Shot 2021-03-09 at 10 07 35

This is obviously unfortunate. I think it's been broken for at least a year.

I think the solution is to just swap appIcon and contentImage back to the way they were, along with a major version bump, so people sticking with older macOS versions can just lock to the old version.

An alternative is to include unicode characters in the message content/subtitle to indicate success/failure.

Not working on OS X 10

In Mac OS X Yosemite prints:

> TerminalNotifier::Guard.notify('Hello World')
RuntimeError: terminal-notifier is only supported on Mac OS X 10.8, or higher.

but terminal-notifier in terminal is working fine!
What? How I can solve it?

Avoid gem in gemfile for Heroku or Travis CI

Hi, I'm using the gem in my development group

group :development do
  gem 'quiet_assets'
  gem 'better_errors'
  gem 'binding_of_caller', :platforms => [:mri_19, :rbx]
 
  gem 'guard-rspec'
  gem 'guard-rubocop'
  gem 'pry-rails'
  gem 'spring'
  gem 'web-console', '~> 2.0'
  gem 'libnotify' if /linux/ =~ RUBY_PLATFORM
  gem 'terminal-notifier-guard', '~> 1.6.1' if /darwin/ =~ RUBY_PLATFORM
end

It works good but when I push to heroku this happen

remote:        Bundler Output: Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.15.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        You are trying to install in deployment mode after changing
remote:        your Gemfile. Run `bundle install` elsewhere and add the
remote:        updated Gemfile.lock to version control.
remote:
remote:        You have added to the Gemfile:
remote:        * libnotify
remote:
remote:        You have deleted from the Gemfile:
remote:        * terminal-notifier-guard (~> 1.6.1)
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed

I also did bundle install to update the gemfile.lock
Travis CI also throw a similar error.

Is there a way to ignore the gem in the gemfile.lock or use it without being in the gemfile?

Nil error with ruby wrapper

I'm getting a TypeError when calling list method without an argument. Apparently the default parameter isn't being handled correctly:

Works with arg:

irb(main):002:0> TerminalNotifier::Guard.notify('Hello World',group:Process.pid)
=> true
irb(main):003:0> TerminalNotifier::Guard.list(Process.pid)
=> {:group=>"33717", :title=>"Terminal", :subtitle=>nil, :message=>"Hello World", :delivered_at=>2013-04-21 15:09:43 -0700}

But fails with:

irb(main):006:0> TerminalNotifier::Guard.list
TypeError: can't convert nil into String
from /Users/theoretick/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/time.rb:265:in `_parse'
from /Users/theoretick/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/time.rb:265:in `parse'
from /Users/theoretick/.rvm/gems/ruby-1.9.3-p327/gems/terminal-notifier-guard-1.5.3/lib/terminal-notifier-guard.rb:118:in `block (2 levels) in list'
from /Users/theoretick/.rvm/gems/ruby-1.9.3-p327/gems/terminal-notifier-guard-1.5.3/lib/terminal-notifier-guard.rb:117:in `each'
from /Users/theoretick/.rvm/gems/ruby-1.9.3-p327/gems/terminal-notifier-guard-1.5.3/lib/terminal-notifier-guard.rb:117:in `inject'
from /Users/theoretick/.rvm/gems/ruby-1.9.3-p327/gems/terminal-notifier-guard-1.5.3/lib/terminal-notifier-guard.rb:117:in `block in list'
from /Users/theoretick/.rvm/gems/ruby-1.9.3-p327/gems/terminal-notifier-guard-1.5.3/lib/terminal-notifier-guard.rb:116:in `map'
from /Users/theoretick/.rvm/gems/ruby-1.9.3-p327/gems/terminal-notifier-guard-1.5.3/lib/terminal-notifier-guard.rb:116:in `list'
from (irb):6
from /Users/theoretick/.rvm/rubies/ruby-1.9.3-p327/bin/irb:18:in `<main>'

Not working on OS X 10.9 Mavericks

It looks like terminal-notifier-guard doesn't work on OS X 10.9 Mavericks.

This could be because terminal-notifier requires the -sender parameter in 10.9 or the notification is never shown.

See this comment on a terminal-notifier issue: julienXX#57 (comment)

always shows specs failed

Although all my specs show as passing in my terminal, the notification ALWAYS shows they failed. Do i have something misconfigured?

Gemfile
group :development do
  gem 'guard'
  gem 'guard-rspec'
  gem 'rspec'
  gem 'terminal-notifier-guard'
end
Guardfile
notification :terminal_notifier
guard :rspec, all_after_pass: true, all_on_start: true do
  # ...
end

why hardcode the path to the binary?

Hi, thanks for a great project.

I use macports, so terminal-notifier-guard doesn't find my terminal-notifier executable.

Why are you hardcoding the path to the binary? When I install terminal-notifier with macports, it is available in my executable path.

➔ type terminal-notifier
terminal-notifier is /opt/local/bin/terminal-notifier
➔ cat /opt/local/bin/terminal-notifier
#!/bin/sh
exec /opt/local/libexec/terminal-notifier.app/Contents/MacOS/terminal-notifier "$@"

I imagine this is also the case with Homebrew, no?

Guard not starting after update

I got this error after i updated terminal-notifier-guard and tried to start Guard

16:56:11 - ERROR - Invalid Guardfile, original error is:
> [#] undefined method `<' for nil:NilClass

Not working -probably just me

gem install guard
gem instal guard-phpunit
gem install guard-terminal-notifier-guard

guard 'phpunit', :tests_path => 'app/tests', :cli => '--colors' do
watch(%r{^.+Test.php$})
end

Now when I run phpunit on my file it asserts true. When I run Guard, guard asserts true. The notifier however, always, always alerts with a failed message no matter my test.

Won't start if not in gemfile instead of gem install

I don't want to modify the gemfile to install this gem. I want to use:

$ gem install terminal-notifier-guard

But currently, each time I try to launch Guard he throw me this error:

guard
/Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier/base.rb:123:in rescue in _require_gem': Please add "gem 'terminal-notifier-guard'" to your Gemfile and run your app with "bundle exec". (Notiffany::Notifier::Base::RequireFailed) from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier/base.rb:121:in_require_gem'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier/base.rb:58:in initialize' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier/detected.rb:92:innew'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier/detected.rb:92:in add' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier.rb:102:inblock in initialize'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier.rb:101:in each' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier.rb:101:ininitialize'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier.rb:42:in new' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/notiffany-0.0.8/lib/notiffany/notifier.rb:42:inconnect'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/lib/guard/notifier.rb:11:in connect' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/lib/guard.rb:61:insetup'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/lib/guard/commander.rb:32:in start' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/lib/guard/cli/environments/valid.rb:16:instart_guard'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/lib/guard/cli.rb:122:in start' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/thor-0.19.1/lib/thor/command.rb:27:inrun'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/thor-0.19.1/lib/thor.rb:359:indispatch'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:32:inexecute'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:19:in execute!' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/bin/_guard-core:11:in

'
/Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/listen-3.0.6/lib/listen/fsm.rb:76:in validate_and_sanitize_new_state': Listen::Listener can't change state from 'initializing' to 'stopped', only to: backend_started (ArgumentError) from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/listen-3.0.6/lib/listen/fsm.rb:55:intransition'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/listen-3.0.6/lib/listen/listener.rb:98:in stop' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:48:inexecute'
from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:19:in execute!' from /Users/guillaumelegendre/.rvm/gems/ruby-2.3.0@investissement_pierre/gems/guard-2.13.0/bin/_guard-core:11:in'

If I add the line to the Gemfile everything work fine.

Do you have an idea why?

Suppress Success Notifications

Hey, was just wondering if there is any way to suppress the success notifications using guard or terminal-notifier-guard? I personally want to know when I break something, not when things are going well.

Any ideas?

Thanks

terminal-notifier-guard doesn't work with Zeus

Basically, Zeus and terminal-notifier aren't compatible. Growl works fine.

Example repo here:
https://github.com/petems/guard-zeus-terminal-notifier

Not sure if it's an issue with guard-rspec or terminal-notifier-guard.

Debug of guard-rspec with :zeus => true:

22:43:05 - DEBUG - Command execution: uname
22:43:05 - DEBUG - Command execution: sw_vers -productVersion
22:43:05 - INFO - Guard uses TerminalNotifier to send notifications.
22:43:05 - DEBUG - Command execution: hash stty
22:43:05 - DEBUG - Guard starts all plugins
22:43:05 - DEBUG - Hook :start_begin executed for Guard::RSpec
22:43:05 - INFO - Guard::RSpec is running
22:43:05 - INFO - Running all specs
22:43:05 - DEBUG - Command execution: bundle exec rspec --help
22:43:05 - DEBUG - Command execution: bundle exec zeus rspec -f progress -r /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/guard-rspec-2.5.1/lib/guard/rspec/formatter.rb -f Guard::RSpec::Formatter --failure-exit-code 2 spec
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
.

Finished in 0.02371 seconds
1 example, 0 failures

Randomized with seed 0

22:43:07 - DEBUG - Hook :start_end executed for Guard::RSpec
22:43:07 - DEBUG - Hook :start_begin executed for Guard::Shell
22:43:07 - DEBUG - Hook :start_end executed for Guard::Shell
22:43:07 - INFO - Guard is now watching at '/Users/pmorley/Projects/guard-zeus-terminal-notifier'
22:43:08 - DEBUG - Command execution: stty -g 2>/dev/null
22:43:08 - DEBUG - Start interactor
22:43:08 - DEBUG - Command execution: infocmp -C
22:43:08 - DEBUG - Command execution: infocmp -C -r
22:43:08 - DEBUG - Command execution: infocmp -C -r
22:43:08 - DEBUG - Command execution: stty size
22:43:08 - DEBUG - Command execution: infocmp -C -r
22:43:08 - DEBUG - Command execution: stty -a
22:43:08 - DEBUG - Command execution: stty -a
22:43:08 - DEBUG - Command execution: stty -g
22:43:08 - DEBUG - Command execution: stty -a
22:43:08 - DEBUG - Command execution: stty -a
22:43:08 - DEBUG - Command execution: stty  -echo -icrnl cbreak pass8 -ixoff
[1] guard(main)> 22:43:13 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:13 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:13 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:14 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:14 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:14 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:14 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:14 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:14 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:14 - DEBUG - Command execution: stty size
[1] guard(main)> 22:43:14 - DEBUG - Command execution: stty size

Debug of guard-rspec without :zeus => true:

22:40:12 - DEBUG - Command execution: uname
22:40:12 - DEBUG - Command execution: sw_vers -productVersion
22:40:12 - INFO - Guard uses TerminalNotifier to send notifications.
22:40:12 - DEBUG - Command execution: hash stty
22:40:12 - DEBUG - Guard starts all plugins
22:40:12 - DEBUG - Hook :start_begin executed for Guard::RSpec
22:40:12 - INFO - Guard::RSpec is running
22:40:12 - INFO - Running all specs
22:40:12 - DEBUG - Command execution: bundle exec rspec --help
22:40:13 - DEBUG - Command execution: bundle exec rspec -f progress -r /opt/boxen/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/guard-rspec-2.5.1/lib/guard/rspec/formatter.rb -f Guard::RSpec::Formatter --failure-exit-code 2 spec
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
.

Finished in 0.01236 seconds
1 example, 0 failures

Randomized with seed 40746

22:40:14 - DEBUG - Hook :start_end executed for Guard::RSpec
22:40:14 - DEBUG - Hook :start_begin executed for Guard::Shell
22:40:14 - DEBUG - Hook :start_end executed for Guard::Shell
22:40:14 - INFO - Guard is now watching at '/Users/pmorley/Projects/guard-zeus-terminal-notifier'
22:40:15 - DEBUG - Command execution: stty -g 2>/dev/null
22:40:15 - DEBUG - Start interactor
22:40:15 - DEBUG - Command execution: infocmp -C
22:40:15 - DEBUG - Command execution: infocmp -C -r
22:40:15 - DEBUG - Command execution: infocmp -C -r
22:40:15 - DEBUG - Command execution: stty size
22:40:15 - DEBUG - Command execution: infocmp -C -r
22:40:15 - DEBUG - Command execution: stty -a
22:40:15 - DEBUG - Command execution: stty -a
22:40:15 - DEBUG - Command execution: stty -g
22:40:15 - DEBUG - Command execution: stty -a
22:40:15 - DEBUG - Command execution: stty -a
22:40:15 - DEBUG - Command execution: stty  -echo -icrnl cbreak pass8 -ixoff

PHP Unit tests always failing

When I run my unit tests the notifier will always show me that it's failing. The results I see in my console are:

Passed test:
16:37:50 - INFO - Running: app/tests/ExampleTest.php
16:37:50 - INFO - .

[#]
[#] Finished in 0 seconds

Failing test:
16:37:59 - INFO - Running: app/tests/ExampleTest.php
16:37:59 - INFO - F

[#]
[#] Failures:
[#]
[#] 1) ExampleTest::testBasicExample
[#] Failed asserting that false is true.
[#] # /Users/md096/Sites/liquidcms/app/tests/ExampleTest.php:13
[#]
[#] Finished in 0 seconds

Somebody knows a fix for this?

Notification message goes away in less than 2 seconds

Hey there. Everything works great!! Awesome gem, but there is one thing that it's a little bit annoying to me. When I change some test, save the file, the terminal-notifier-guard works and I can see the notification, the problem is that the message where it says: 1 test, 1 asse... etc is really short, It last less than 2 seconds, after that the message is switched to Running: sometest/test.rb. Is there a way to put both messages together so that I have time to see how many things I broke?? Or having the first part of the message last a bit longer.
This only happens when I use Minitest with Banners, it only creates one banner and switches the message inside that banner, if I use Alerts instead then it'll create two alerts, one with each message. The thing is that Alerts don't go away automatically.
But if I use RSpec, it puts everything inside one banner and I can read it.
Thanks!

Guard is not using terminal-notifier in OS X 10.10 Yosemite

cc: guard/guard#626

I am using Yosemite, and Notification center is silent now.

Terminal Notifier is working:

$ terminal-notifier-notify -message hello

And it's added to Gemfile:

group :development do
    gem 'terminal-notifier-guard'
end

But Guard doesn't care:

$ guard
10:08:47 - INFO - Guard is using TerminalTitle to send notifications.

Is there anything I can do to fix it?

Running full screen apps introduces space swapping on notification

Use something like Vim full screen with terminal notifier / guard running.
Guard finishes and publishes notification.
Context switches away from full screen app to semi-empty desktop to display notification.

Usual notifications from other applications function as normal.

Not working with guard, and unclear documentation.

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
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.