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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0cd117776ed55857fe4b60e6abe35d2ff07f99a
4
- data.tar.gz: 28d661214a0d3c0f93f5015409b527b42e91a2b6
3
+ metadata.gz: fdd971a1719504ce228ab976632db9e3825650a8
4
+ data.tar.gz: df77c915b551cf99081aa6b588f494277b5d4e61
5
5
  SHA512:
6
- metadata.gz: 7a9ceddcd1c71b780e5b6c7a0333ee3162deeb7a51bd547bc9f72655de9ca4d090c68c1a1d2c38926932e0d6f60c5fb251984e9c0edd1bbcbf4187fc4e29d43d
7
- data.tar.gz: 7189ef298d5fae8d808ac2723a738fa67e1c9594aedf3bae8a5ef04dbb219acf6c7dc92ad7dd13012bb2d70baf80b694f11e83dec079654014afdf3f558c3fdb
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 )
@@ -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, data)
23
- post('/push_notifications', push_notification: { platform: platform, recipient: recipient, data: data })
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
@@ -1,3 +1,3 @@
1
1
  module Rumour
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
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
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-03-19 00:00:00.000000000 Z
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
@@ -1,4 +0,0 @@
1
- require: rubocop-rspec
2
-
3
- Documentation:
4
- Enabled: false