pushover 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fba81cc748d32d1fcb33b9033b31884f69b75446
4
- data.tar.gz: cb9b81b74147841ed98a4e99ab6c56f1ae2a994c
3
+ metadata.gz: c82845fa7fc83d75b2de7531edd42cee14e97a36
4
+ data.tar.gz: c9a78c165ff694607281d4e7186ebd5983d3d222
5
5
  SHA512:
6
- metadata.gz: 006c0109d54e20428d8042694a00cd9a24eb79103b922eea16e571c85e72d614d6a8ba08f7defbef26ddf700f282ea20a6c19d95256797ad65e5070ffe0df2e0
7
- data.tar.gz: 93c9d2647e1136b4ebd8ca3d88afc2433e949199e21e265de32da249e91a78cec3a39cb7dae75718d9ca27d0fa310f16a3234642febc901acba8f26a6888cb9e
6
+ metadata.gz: d101253f3fc643bf54208d7b20e2009523ab5047a273e019b31d3c8eb5a963e81ffd45cef49e3c23fd9736a3e3d6f7913388fdd7befb43598cf7829c2badc066
7
+ data.tar.gz: c53ffd5bdcbb514e2a9863b668dd36605d8220447f7b0e9a4fd25b9981e464b88bd12b2c4c3634daa105d670205257feccaa139703dfd1fa958c57b73300a9de
data/lib/pushover.rb CHANGED
@@ -63,9 +63,10 @@ module Pushover
63
63
  def notification(tokens={})
64
64
  tokens[:timestamp] = timestamp_magic tokens[:timestamp] if tokens[:timestamp]
65
65
  tokens[:priority] = Pushover::Priority.parse tokens[:priority] if tokens[:priority]
66
+ tokens[:user] ||= @user
67
+ tokens[:token] ||= @token
66
68
 
67
- response = HTTParty.post('https://api.pushover.net/1/messages.json', body:tokens)
68
- response
69
+ HTTParty.post('https://api.pushover.net/1/messages.json', body:tokens)
69
70
  end
70
71
 
71
72
  # Return a [Hash] of sounds.
@@ -1,4 +1,4 @@
1
1
  module Pushover
2
2
  # The current version of Pushover.
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
@@ -57,6 +57,18 @@ describe "Pushover" do
57
57
  puts req.body hash_including(priority:'ajkasdfj')
58
58
  end
59
59
  end
60
+
61
+ it "can send a notification with preconfigured user and token" do
62
+ setup_webmocks
63
+ Pushover.configure do |c|
64
+ c.user = 'good_user'
65
+ c.token = 'good_token'
66
+ end
67
+ Pushover.notification message:'a message'
68
+ WebMock.should have_requested(:post, /.*api.pushover.net.*/).with do |req|
69
+ puts req.body hash_including(priority:'ajkasdfj')
70
+ end
71
+ end
60
72
  end
61
73
 
62
74
  describe "extra behavior" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushover
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernie Brodeur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-29 00:00:00.000000000 Z
11
+ date: 2013-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yajl-ruby