rumour-ruby 0.0.6 → 0.0.7
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/README.md +1 -1
- data/lib/rumour-ruby/client.rb +2 -2
- data/lib/rumour-ruby/version.rb +1 -1
- data/spec/client_spec.rb +5 -5
- 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: 4aab59bc0bcf11c9eb93f31882d6787cc4791a57
|
4
|
+
data.tar.gz: 0054a378a2aae28ad375ce8be34d6317b237791d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 869887c9f8456295e683b10765e2f4802952ea4171c125748752b5b7e3259a3ddd7a15fda98c36e0894215e9266029dbeaae0fea64865fab7495b2afb70229d9
|
7
|
+
data.tar.gz: 82199db9ea437d925e436de5bb066615d809c7bb6e873dcaa1afbccfb9ffc19f1c4869171d9eb918d0e09ab2d7dd1c19ab49c8b33b711be1e331bba235d54c0f
|
data/README.md
CHANGED
@@ -62,7 +62,7 @@ Intercept text messages and/or push notifications when you don't want to send st
|
|
62
62
|
|
63
63
|
Rumour.configure do |config|
|
64
64
|
config.intercept_text_message_recipient = 'your_mobile_phone_number'
|
65
|
-
config.
|
65
|
+
config.intercept_push_notification_recipient = 'your_device_token'
|
66
66
|
end
|
67
67
|
```
|
68
68
|
|
data/lib/rumour-ruby/client.rb
CHANGED
@@ -20,9 +20,9 @@ module Rumour
|
|
20
20
|
post('/text_messages', text_message: { from: sender, recipient: recipient, body: body })
|
21
21
|
end
|
22
22
|
|
23
|
-
def send_push_notification(
|
23
|
+
def send_push_notification(recipient, options= {})
|
24
24
|
recipient = Rumour.configuration.intercept_push_notification_recipient || recipient
|
25
|
-
post('/push_notifications', push_notification: {
|
25
|
+
post('/push_notifications', push_notification: { recipient: recipient }.merge(options))
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
data/lib/rumour-ruby/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -55,7 +55,7 @@ RSpec.describe Rumour::Client do
|
|
55
55
|
describe 'send with valid data' do
|
56
56
|
it 'creates and retrieves a new push notification as a hash' do
|
57
57
|
rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
|
58
|
-
push_notification = rumour_client.send_push_notification('android', '
|
58
|
+
push_notification = rumour_client.send_push_notification('android::some_registration_id', title: 'PN Title', text: 'PN Text', android_data: { my_key: 'my_value'})
|
59
59
|
|
60
60
|
expect(push_notification['id']).to_not be_nil
|
61
61
|
end
|
@@ -66,7 +66,7 @@ RSpec.describe Rumour::Client do
|
|
66
66
|
describe 'send with valid data' do
|
67
67
|
it 'creates and retrieves a new push notification as a hash' do
|
68
68
|
rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
|
69
|
-
push_notification = rumour_client.send_push_notification('ios', '
|
69
|
+
push_notification = rumour_client.send_push_notification('ios::some_device_token', title: 'PN Title', text: 'PN Text', ios_alert: { title: 'iOS Title'})
|
70
70
|
|
71
71
|
expect(push_notification['id']).to_not be_nil
|
72
72
|
end
|
@@ -91,12 +91,12 @@ RSpec.describe Rumour::Client do
|
|
91
91
|
describe 'for push notifications' do
|
92
92
|
it 'sends the push notification to the interceptor' do
|
93
93
|
Rumour.configure do |config|
|
94
|
-
config.intercept_push_notification_recipient = 'push_recipient'
|
94
|
+
config.intercept_push_notification_recipient = 'ios::push_recipient'
|
95
95
|
end
|
96
96
|
|
97
97
|
rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
|
98
|
-
push_notification = rumour_client.send_push_notification('ios', '
|
99
|
-
|
98
|
+
push_notification = rumour_client.send_push_notification('ios::some_device_token', title: 'PN Title', text: 'PN Text', ios_alert: { title: 'iOS Title'})
|
99
|
+
|
100
100
|
expect(push_notification['id']).to_not be_nil
|
101
101
|
expect(push_notification['recipient']).to eq('push_recipient')
|
102
102
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rumour-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joao Diogo Costa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|