rumour-ruby 0.0.4 → 0.0.5
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 +15 -1
- data/lib/rumour-ruby/client.rb +2 -2
- data/lib/rumour-ruby/version.rb +1 -1
- data/spec/client_spec.rb +12 -1
- metadata +2 -3
- data/.rubocop.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdd971a1719504ce228ab976632db9e3825650a8
|
4
|
+
data.tar.gz: df77c915b551cf99081aa6b588f494277b5d4e61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8edec41fecb00d3a5e6f400d3c6c1e6357dad6ecdd8bacc9c64cc90c05b45be1f1b7ecddd9e3fc3a08662653ca6807307a22da1823cd051a2e48a8e4400bdecd
|
7
|
+
data.tar.gz: 6c3a8f5be882122b67e31c1a35543743b3dc66229880079f359a541ba2e70072d86f0bf7e3ab1abb5e3a23f8fb277f4aa242b0fe8bbf1cca6ff88b1f6929b44e
|
data/README.md
CHANGED
@@ -36,10 +36,24 @@ Then, send a text message:
|
|
36
36
|
from = '+15005550006'
|
37
37
|
recipient = '+15005550005'
|
38
38
|
|
39
|
-
rumour.send_text_message()
|
39
|
+
rumour.send_text_message(from, recipient, 'Hello from Rumour!')
|
40
40
|
#=> {'id' => '1', 'from' => '+15005550006', 'recipient' => '+15005550005', ... }
|
41
41
|
```
|
42
42
|
|
43
|
+
Or an Android Push Notification:
|
44
|
+
```ruby
|
45
|
+
recipient = 'Device-Token-Here'
|
46
|
+
|
47
|
+
rumour.send_push_notification('android', recipient, data: { ... })
|
48
|
+
```
|
49
|
+
|
50
|
+
Or even an iOS Push Notification:
|
51
|
+
```ruby
|
52
|
+
recipient = 'Device-Token-Here'
|
53
|
+
|
54
|
+
rumour.send_push_notification('ios', recipient, alert: { ... })
|
55
|
+
```
|
56
|
+
|
43
57
|
## Contributing
|
44
58
|
|
45
59
|
1. Fork it ( https://github.com/joaodiogocosta/rumour-ruby/fork )
|
data/lib/rumour-ruby/client.rb
CHANGED
@@ -19,8 +19,8 @@ module Rumour
|
|
19
19
|
post('/text_messages', text_message: { from: sender, recipient: recipient, body: body })
|
20
20
|
end
|
21
21
|
|
22
|
-
def send_push_notification(platform, recipient,
|
23
|
-
post('/push_notifications', push_notification: { platform: platform, recipient: recipient
|
22
|
+
def send_push_notification(platform, recipient, options= {})
|
23
|
+
post('/push_notifications', push_notification: { platform: platform, recipient: recipient }.merge(options))
|
24
24
|
end
|
25
25
|
|
26
26
|
private
|
data/lib/rumour-ruby/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -55,10 +55,21 @@ 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', 'some_registration_id', { hello: 'world'})
|
58
|
+
push_notification = rumour_client.send_push_notification('android', 'some_registration_id', data: { hello: 'world'})
|
59
59
|
|
60
60
|
expect(push_notification['id']).to_not be_nil
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
64
|
+
|
65
|
+
describe 'ios push_notifications' do
|
66
|
+
describe 'send with valid data' do
|
67
|
+
it 'creates and retrieves a new push notification as a hash' do
|
68
|
+
rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
|
69
|
+
push_notification = rumour_client.send_push_notification('ios', 'some_registration_id', { alert: 'world'})
|
70
|
+
|
71
|
+
expect(push_notification['id']).to_not be_nil
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
64
75
|
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.5
|
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-
|
11
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -61,7 +61,6 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- ".rspec"
|
64
|
-
- ".rubocop.yml"
|
65
64
|
- Gemfile
|
66
65
|
- LICENSE.txt
|
67
66
|
- README.md
|
data/.rubocop.yml
DELETED