pushbullet_ruby 1.0.3 → 1.0.4
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 +11 -0
- data/lib/pushbullet_ruby/api/chats.rb +17 -0
- data/lib/pushbullet_ruby/api/ephemerals.rb +4 -4
- data/lib/pushbullet_ruby/api/pushes.rb +6 -6
- data/lib/pushbullet_ruby/api.rb +2 -0
- data/lib/pushbullet_ruby/channel.rb +2 -2
- data/lib/pushbullet_ruby/chat.rb +16 -0
- data/lib/pushbullet_ruby/contact.rb +4 -4
- data/lib/pushbullet_ruby/device.rb +2 -2
- data/lib/pushbullet_ruby/push.rb +2 -2
- data/lib/pushbullet_ruby/version.rb +1 -1
- data/lib/pushbullet_ruby.rb +12 -11
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 624004802f80deba5d371098d3300b1c5678a3f2
|
4
|
+
data.tar.gz: 826834858bdcd27ed636b3f0a0fa26df4e9c26f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e2fbbffeed8809c3a120f86c028e867d18c64502f178f7d3215624ec36901ddd7fa7320c41da4703c2bdd0925edb9448ccd9416a6be51228a608f28b1cfcf3c
|
7
|
+
data.tar.gz: 8c01950e272d9a447f0d1855161b9b11fd3eb13a0f4f9ca56b16c98ea8a537e135c13f0abf0a15fe63e82f7fc0a83e48c5408efc728a5410f695da32c32a5544
|
data/README.md
CHANGED
@@ -64,6 +64,17 @@ client.push_note(
|
|
64
64
|
}
|
65
65
|
)
|
66
66
|
```
|
67
|
+
### Sms
|
68
|
+
```ruby
|
69
|
+
client.sens_sms(
|
70
|
+
user_identifier: 'user id',
|
71
|
+
device_identifier: 'device id',
|
72
|
+
params: {
|
73
|
+
conversation_iden: 'target phone number',
|
74
|
+
message: 'Content'
|
75
|
+
}
|
76
|
+
)
|
77
|
+
```
|
67
78
|
## Contributing
|
68
79
|
|
69
80
|
Bug reports and pull requests are welcome on GitHub at https://github.com/creends/pushbullet_ruby.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module PushbulletRuby
|
2
|
+
module API
|
3
|
+
module Chats
|
4
|
+
def chats
|
5
|
+
PushbulletRuby::Chat.from_response(get('/v2/chats'))
|
6
|
+
end
|
7
|
+
|
8
|
+
def create_chat(params: {})
|
9
|
+
PushbulletRuby::Chat.new(post('/v2/chats', params).body)
|
10
|
+
end
|
11
|
+
|
12
|
+
def delete_chat(chat_id: nil)
|
13
|
+
delete("/v2/chats/#{chat_id}").body
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -5,12 +5,12 @@ require 'pushbullet_ruby/ephemerable/notifitation'
|
|
5
5
|
module PushbulletRuby
|
6
6
|
module API
|
7
7
|
module Ephemerals
|
8
|
-
def send_sms(
|
9
|
-
PushbulletRuby::Ephemerable::Sms.push(self,
|
8
|
+
def send_sms(user_id: nil, device_id: nil, params: {})
|
9
|
+
PushbulletRuby::Ephemerable::Sms.push(self, user_id, device_id, params)
|
10
10
|
end
|
11
11
|
|
12
|
-
def push_notification(
|
13
|
-
PushbulletRuby::Ephemerable::Notification.push(self,
|
12
|
+
def push_notification(user_id: nil, device_id: nil, params: {})
|
13
|
+
PushbulletRuby::Ephemerable::Notification.push(self, user_id, device_id, params)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -6,16 +6,16 @@ require 'pushbullet_ruby/pushable/file'
|
|
6
6
|
module PushbulletRuby
|
7
7
|
module API
|
8
8
|
module Pushes
|
9
|
-
def push_note(receiver: nil,
|
10
|
-
PushbulletRuby::Pushable::Note.push(self, receiver,
|
9
|
+
def push_note(receiver: nil, device_id: nil, params: {})
|
10
|
+
PushbulletRuby::Pushable::Note.push(self, receiver, device_id, params)
|
11
11
|
end
|
12
12
|
|
13
|
-
def push_link(receiver: nil,
|
14
|
-
PushbulletRuby::Pushable::Link.push(self, receiver,
|
13
|
+
def push_link(receiver: nil, device_id: nil, params: {})
|
14
|
+
PushbulletRuby::Pushable::Link.push(self, receiver, device_id, params)
|
15
15
|
end
|
16
16
|
|
17
|
-
def push_file(receiver: nil,
|
18
|
-
PushbulletRuby::Pushable::File.push(self, receiver,
|
17
|
+
def push_file(receiver: nil, device_id: nil, params: {})
|
18
|
+
PushbulletRuby::Pushable::File.push(self, receiver, device_id, params)
|
19
19
|
end
|
20
20
|
|
21
21
|
def pushes
|
data/lib/pushbullet_ruby/api.rb
CHANGED
@@ -4,6 +4,7 @@ require 'pushbullet_ruby/api/pushes'
|
|
4
4
|
require 'pushbullet_ruby/api/ephemerals'
|
5
5
|
require 'pushbullet_ruby/api/contacts'
|
6
6
|
require 'pushbullet_ruby/api/subscriptions'
|
7
|
+
require 'pushbullet_ruby/api/chats'
|
7
8
|
|
8
9
|
module PushbulletRuby
|
9
10
|
module API
|
@@ -13,5 +14,6 @@ module PushbulletRuby
|
|
13
14
|
include Ephemerals
|
14
15
|
include Contacts
|
15
16
|
include Subscriptions
|
17
|
+
include Chats
|
16
18
|
end
|
17
19
|
end
|
@@ -5,9 +5,9 @@ module PushbulletRuby
|
|
5
5
|
attr_reader :body
|
6
6
|
|
7
7
|
def self.from_response(response)
|
8
|
-
response.body['subscriptions'].
|
8
|
+
response.body['subscriptions'].each_with_object([]) do |attributes, memo|
|
9
9
|
next unless attributes['active']
|
10
|
-
new(attributes['channel'])
|
10
|
+
memo << new(attributes['channel'])
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'pushbullet_ruby/entity'
|
2
|
+
|
3
|
+
module PushbulletRuby
|
4
|
+
class Chat < Entity
|
5
|
+
def self.from_response(response)
|
6
|
+
response.body['chats'].each_with_object([]) do |attributes, memo|
|
7
|
+
next unless attributes['active']
|
8
|
+
memo << new(attributes)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def id
|
13
|
+
body['iden']
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require 'pushbullet_ruby/
|
1
|
+
require 'pushbullet_ruby/user'
|
2
2
|
|
3
3
|
module PushbulletRuby
|
4
|
-
class Contact <
|
4
|
+
class Contact < User
|
5
5
|
def self.from_response(response)
|
6
|
-
response.body['contacts'].
|
6
|
+
response.body['contacts'].each_with_object([]) do |attributes, memo|
|
7
7
|
next unless attributes['active']
|
8
|
-
new(attributes)
|
8
|
+
memo << new(attributes)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -3,9 +3,9 @@ require 'pushbullet_ruby/entity'
|
|
3
3
|
module PushbulletRuby
|
4
4
|
class Device < Entity
|
5
5
|
def self.from_responce(response)
|
6
|
-
response.body['devices'].
|
6
|
+
response.body['devices'].each_with_object([]) do |attributes, memo|
|
7
7
|
next unless attributes['active']
|
8
|
-
new(attributes)
|
8
|
+
memo << new(attributes)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
data/lib/pushbullet_ruby/push.rb
CHANGED
@@ -3,9 +3,9 @@ require 'pushbullet_ruby/entity'
|
|
3
3
|
module PushbulletRuby
|
4
4
|
class Push < Entity
|
5
5
|
def self.from_response(response)
|
6
|
-
response.body['pushes'].
|
6
|
+
response.body['pushes'].each_with_object([]) do |attributes, memo|
|
7
7
|
next unless attributes['active']
|
8
|
-
new(attributes)
|
8
|
+
memo << new(attributes)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
data/lib/pushbullet_ruby.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
require 'pushbullet_ruby/client'
|
2
|
-
require 'pushbullet_ruby/user'
|
3
|
-
require 'pushbullet_ruby/device'
|
4
|
-
require 'pushbullet_ruby/pushable'
|
5
|
-
require 'pushbullet_ruby/ephemerable'
|
6
|
-
require 'pushbullet_ruby/contact'
|
7
|
-
require 'pushbullet_ruby/channel'
|
8
|
-
require 'pushbullet_ruby/token'
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
require 'pushbullet_ruby/client'
|
2
|
+
require 'pushbullet_ruby/user'
|
3
|
+
require 'pushbullet_ruby/device'
|
4
|
+
require 'pushbullet_ruby/pushable'
|
5
|
+
require 'pushbullet_ruby/ephemerable'
|
6
|
+
require 'pushbullet_ruby/contact'
|
7
|
+
require 'pushbullet_ruby/channel'
|
8
|
+
require 'pushbullet_ruby/token'
|
9
|
+
require 'pushbullet_ruby/chat'
|
10
|
+
|
11
|
+
module PushbulletRuby
|
12
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushbullet_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- creends
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- Rakefile
|
80
80
|
- lib/pushbullet_ruby.rb
|
81
81
|
- lib/pushbullet_ruby/api.rb
|
82
|
+
- lib/pushbullet_ruby/api/chats.rb
|
82
83
|
- lib/pushbullet_ruby/api/contacts.rb
|
83
84
|
- lib/pushbullet_ruby/api/devices.rb
|
84
85
|
- lib/pushbullet_ruby/api/ephemerals.rb
|
@@ -87,6 +88,7 @@ files:
|
|
87
88
|
- lib/pushbullet_ruby/api/subscriptions.rb
|
88
89
|
- lib/pushbullet_ruby/authorization.rb
|
89
90
|
- lib/pushbullet_ruby/channel.rb
|
91
|
+
- lib/pushbullet_ruby/chat.rb
|
90
92
|
- lib/pushbullet_ruby/client.rb
|
91
93
|
- lib/pushbullet_ruby/contact.rb
|
92
94
|
- lib/pushbullet_ruby/device.rb
|