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

Sending a symbol as the icon to ruby_gntp causes a crash #27

Open
ericgross opened this issue Aug 10, 2015 · 3 comments
Open

Sending a symbol as the icon to ruby_gntp causes a crash #27

ericgross opened this issue Aug 10, 2015 · 3 comments

Comments

@ericgross
Copy link

I am using ruby_gntp to send notifications and it works for RSpec, but Cucumber is causing

no implicit conversion of Symbol into String (TypeError)
/home/eric/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby_gntp-0.3.4/lib/ruby_gntp.rb:271:in `exists?'
/home/eric/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby_gntp-0.3.4/lib/ruby_gntp.rb:271:in `handle_icon'
/home/eric/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby_gntp-0.3.4/lib/ruby_gntp.rb:214:in `notify_header'
/home/eric/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/ruby_gntp-0.3.4/lib/ruby_gntp.rb:111:in `notify'
/home/eric/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/notiffany-0.0.7/lib/notiffany/notifier/gntp.rb:63:in `_perform_notify'
...

In this case, icon is :passed and type is "Notification".

@e2
Copy link

e2 commented Aug 10, 2015

I think this should be reported in the notiffany project, where the symbol should be properly translated into a filename (containing a path to one of notiffany's icons).

Could you report it there? Thanks!

@ethagnawl
Copy link

@ericgross Were you able to come up with a workaround for this issue?

@e2
Copy link

e2 commented Aug 11, 2016

I'd like a test case for this, because I don't use ruby_gntp.

Here's the notifier code in Guard::RSpec

https://github.com/guard/guard-rspec/blob/d416da347678db6042a781af504804ad4b92d352/lib/guard/rspec/notifier.rb#L15

It passes :image which is one of: :failed, :pending, :success.

Here's the notifier from Guard::Cucumber

Guard::Compat::UI.notify msg, title: "Cucumber Results", image: icon

Which also passes one of those options:

So I have no idea how Guard::RSpec works but Guard::Cucumber doesn't.

Does the simple Notiffany example work properly?

https://github.com/guard/notiffany#usage

Notiffany should be translating the :image option as here:

https://github.com/guard/notiffany/blob/90966c71fd2b184a176094294f194c85f1d7f070/lib/notiffany/notifier/base.rb#L110

... and translate it to a file as here:

https://github.com/guard/notiffany/blob/90966c71fd2b184a176094294f194c85f1d7f070/lib/notiffany/notifier/base.rb#L75

So I'm not sure what exactly isn't working and I'm a Linux user so AFAIK. I don't have time to set up a http://www.macincloud.com reproducing the problem, so I can't do much until someone points out where the bug is.

(If I get a reasonably non-invasive PR I can merge and quickly release).

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

No branches or pull requests

3 participants