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

Added GrowlAgent for sending Growl notifications over GNTP #172

Merged
merged 4 commits into from Mar 6, 2014

Conversation

snicker
Copy link
Contributor

@snicker snicker commented Mar 3, 2014

supports sending Growl messages over GNTP to network clients.

register_growl
message = (event.payload['message'] || event.payload['text']).to_s
subject = event.payload['subject'].to_s
if message != "" && subject != ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be written as

if message.present? && subject.present?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah thanks! My ruby-fu is weak, I forget about all the niceties afforded by the language.

@cantino
Copy link
Member

cantino commented Mar 3, 2014

Thanks @snicker, this looks great! Would you mind adding a couple basic specs for it?

@snicker
Copy link
Contributor Author

snicker commented Mar 3, 2014

Sure thing.

@snicker
Copy link
Contributor Author

snicker commented Mar 3, 2014

Added a few, probably could use a few more. New to rspec, is rspec mocks not included in this project? I couldn't stub the Growl object and needed to prevent it from sending real growl messages to a nonexistent destination or the tests would fail

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) when pulling bd206d0 on snicker:master into d97d8c8 on cantino:master.

@cantino
Copy link
Member

cantino commented Mar 3, 2014

Thanks! We're using a library called rr for mocking instead of rspec
mocks. See some of the other specs for examples.

On Monday, March 3, 2014, snicker notifications@github.com wrote:

Added a few, probably could use a few more. New to rspec, is rspec mocks
not included in this project? I couldn't stub the Growl object and needed
to prevent it from sending real growl messages to a nonexistent destination
or the tests would fail

Reply to this email directly or view it on GitHubhttps://github.com//pull/172#issuecomment-36519785
.

@snicker
Copy link
Contributor Author

snicker commented Mar 3, 2014

Ahh! perfect, that looks pretty easy. I'll add a few more specs.

@snicker
Copy link
Contributor Author

snicker commented Mar 5, 2014

finally had a moment to learn some more about rr, committed a bunch more specs... this should be ready to go

message = "message"
subject = "subject"
any_instance_of(Growl) do |obj|
mock(obj).notify(@checker.options[:growlnotificationname],subject,message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend also ensuring that this block gets called

called = false
any_instance_of(Growl) do |obj|
  called = true
  mock(obj).notify(@checker.options[:growlnotificationname], subject, message)
end
@checker.notify_growl(subject, message)
called.should be_true

@cantino
Copy link
Member

cantino commented Mar 5, 2014

Nice work!

@snicker
Copy link
Contributor Author

snicker commented Mar 6, 2014

Made those changes, I'm all about style

cantino added a commit that referenced this pull request Mar 6, 2014
Added GrowlAgent for sending Growl notifications over GNTP
@cantino cantino merged commit 9fa907b into huginn:master Mar 6, 2014
@cantino
Copy link
Member

cantino commented Mar 6, 2014

Great work @snicker, thanks for getting involved!

@snicker
Copy link
Contributor Author

snicker commented Mar 6, 2014

sure thing! glad to contribute, this is an awesome project. Still trying to find more reasons for using it other than letting me know if it's raining! Is there a collection of use cases that others are using it for? I hopped in IRC but it's pretty dead.

@cantino
Copy link
Member

cantino commented Mar 7, 2014

Yea, it's been quiet recently but I try to idle there. Feel free to post
here or we can always google chat!

On Thursday, March 6, 2014, snicker notifications@github.com wrote:

sure thing! glad to contribute, this is an awesome project. Still trying
to find more reasons for using it other than letting me know if it's
raining! Is there a collection of use cases that others are using it for? I
hopped in IRC but it's pretty dead.

Reply to this email directly or view it on GitHubhttps://github.com//pull/172#issuecomment-36909272
.

DataMinerUK pushed a commit to DataMinerUK/huginn that referenced this pull request Oct 6, 2014
Added GrowlAgent for sending Growl notifications over GNTP
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 this pull request may close these issues.

None yet

3 participants