pushbullet_client 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 562aa25969940582d115c9518b2da602d44b24854ead9a50c34eb5ec66a41cc8
4
- data.tar.gz: 539dafb070d592bd34333eabdf26b28a46182f8c67d32bb2a408592054b6fbc4
3
+ metadata.gz: 13463788a15fad6e416d2cf3fcbcf9a582f11f15d5066bae24b563794708b851
4
+ data.tar.gz: 83d8b80b52c871c097ca56abd3b14bffc9aca7195bed138980ac1f26e7dfdefe
5
5
  SHA512:
6
- metadata.gz: 9818f7d0cb27f67319e8185a676b427f0c9a75aeacc28651a0863140a87c30684347fcbe5f0b4b3fabde6c163c87d8171f8a5e9514806eda89e30f4fafadd9fe
7
- data.tar.gz: e14eba20f5cd19bb93895a486f6a6c216e7701bf08ae12ea4a74a2cbd4a70b9f5ccf6f2b179c3ac759fa23da3ebfa7b3cbd42df60580026fc784c6604ebe1a42
6
+ metadata.gz: f01d2a23d2b3bef7f01219cd67555ad2595fb5a28f6d1bb333f56177aa3c08e4dad127b9cb6cc505545688bac278602a65db69777979e1b7730de499f6c4968e
7
+ data.tar.gz: 3a842fb075c008bf3b9c529387c8a3d74b2193e038d91a8c0e2ca93079fad10b3fdc9e5c5e614b4ce576e1631b97f6ad5777769498f758bfc782bd1aa9328a25
data/README.md CHANGED
@@ -23,11 +23,17 @@ Or install it yourself as:
23
23
 
24
24
  ```ruby
25
25
  require 'pushbullet_client'
26
- client = PushBullet::Client.new(key: 'your key', secret: 'your secret')
26
+ client = PushBullet::Client.new(access_token: 'your access_token')
27
27
  ```
28
28
 
29
29
  ### Endpoints
30
- -
30
+ - Chats
31
+ - Devices
32
+ - Permanents
33
+ - Pushes
34
+ - Subscriptions
35
+ - Texts
36
+ - Users
31
37
 
32
38
  ### Constants
33
39
  Constants
@@ -0,0 +1,8 @@
1
+ module Pushbullet
2
+ module Chats
3
+ def chats
4
+ path = 'chats'
5
+ authorise_and_send(http_method: :get, path: path)
6
+ end
7
+ end
8
+ end
@@ -3,54 +3,24 @@ module Pushbullet
3
3
  include ::Pushbullet::Constants
4
4
 
5
5
  # Endpoints
6
-
7
- # TODO: Cleanup modules
6
+ include ::Pushbullet::Chats
7
+ include ::Pushbullet::Devices
8
+ include ::Pushbullet::Permanents
9
+ include ::Pushbullet::Pushes
10
+ include ::Pushbullet::Subscriptions
11
+ include ::Pushbullet::Texts
12
+ include ::Pushbullet::Users
13
+
14
+ # TODO: Add uploads
15
+ # TODO: Add ephemerals
16
+ # TODO: Websockets
17
+ # TODO: Universal copy/paste
18
+ # TODO: Encryption
8
19
  # TODO: Pagination
9
20
  # TODO: Limits
10
21
  # TODO: Date parsing
11
22
  # TODO: Create api client creation library
12
23
 
13
- def me
14
- path = 'users/me'
15
- authorise_and_send(http_method: :get, path: path)
16
- end
17
-
18
- def devices
19
- path = 'devices'
20
- authorise_and_send(http_method: :get, path: path)
21
- end
22
-
23
- def pushes
24
- path = 'pushes'
25
- authorise_and_send(http_method: :get, path: path)
26
- end
27
-
28
- def chats
29
- path = 'chats'
30
- authorise_and_send(http_method: :get, path: path)
31
- end
32
-
33
- def subscriptions
34
- path = 'subscriptions'
35
- authorise_and_send(http_method: :get, path: path)
36
- end
37
-
38
- def texts
39
- path = 'texts'
40
- authorise_and_send(http_method: :get, path: path)
41
- end
42
-
43
- # See: https://stackoverflow.com/questions/38027963/pushbullet-api-thread-id-to-conversation-iden-for-sms
44
- def permanents(device_identity:)
45
- path = "permanents/#{device_identity}_threads"
46
- authorise_and_send(http_method: :get, path: path)
47
- end
48
-
49
- def permanent_conversation(device_identity:, thread_id:)
50
- path = "permanents/#{device_identity}_thread_#{thread_id}"
51
- authorise_and_send(http_method: :get, path: path)
52
- end
53
-
54
24
  attr_reader :key, :secret, :base_path, :port
55
25
 
56
26
  def initialize(access_token:, base_path: 'https://api.pushbullet.com/v2', port: 80)
@@ -0,0 +1,8 @@
1
+ module Pushbullet
2
+ module Devices
3
+ def devices
4
+ path = 'devices'
5
+ authorise_and_send(http_method: :get, path: path)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ module Pushbullet
2
+ module Permanents
3
+ # See: https://stackoverflow.com/questions/38027963/pushbullet-api-thread-id-to-conversation-iden-for-sms
4
+ def permanents(device_identity:)
5
+ path = "permanents/#{device_identity}_threads"
6
+ authorise_and_send(http_method: :get, path: path)
7
+ end
8
+
9
+ def permanent_conversation(device_identity:, thread_id:)
10
+ path = "permanents/#{device_identity}_thread_#{thread_id}"
11
+ authorise_and_send(http_method: :get, path: path)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,8 @@
1
+ module Pushbullet
2
+ module Pushes
3
+ def pushes
4
+ path = 'pushes'
5
+ authorise_and_send(http_method: :get, path: path)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Pushbullet
2
+ module Subscriptions
3
+ def subscriptions
4
+ path = 'subscriptions'
5
+ authorise_and_send(http_method: :get, path: path)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Pushbullet
2
+ module Texts
3
+ def texts
4
+ path = 'texts'
5
+ authorise_and_send(http_method: :get, path: path)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Pushbullet
2
+ module Users
3
+ def me
4
+ path = 'users/me'
5
+ authorise_and_send(http_method: :get, path: path)
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module Pushbullet
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushbullet_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-17 00:00:00.000000000 Z
11
+ date: 2020-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_attr
@@ -196,8 +196,15 @@ files:
196
196
  - bin/console
197
197
  - bin/setup
198
198
  - lib/pushbullet.rb
199
+ - lib/pushbullet/chats.rb
199
200
  - lib/pushbullet/client.rb
200
201
  - lib/pushbullet/constants.rb
202
+ - lib/pushbullet/devices.rb
203
+ - lib/pushbullet/permanents.rb
204
+ - lib/pushbullet/pushes.rb
205
+ - lib/pushbullet/subscriptions.rb
206
+ - lib/pushbullet/texts.rb
207
+ - lib/pushbullet/users.rb
201
208
  - lib/pushbullet/version.rb
202
209
  - pushbullet_client.gemspec
203
210
  homepage: https://github.com/TRex22/pushbullet_client