pushover 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pushover.rb +3 -2
- data/lib/pushover/version.rb +1 -1
- data/spec/lib/pushover_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c82845fa7fc83d75b2de7531edd42cee14e97a36
|
4
|
+
data.tar.gz: c9a78c165ff694607281d4e7186ebd5983d3d222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.
|
data/lib/pushover/version.rb
CHANGED
data/spec/lib/pushover_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2013-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yajl-ruby
|