pushbullet_ruby 1.0.2 → 1.0.2.1
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 +75 -75
- data/lib/pushbullet_ruby/channel.rb +2 -2
- data/lib/pushbullet_ruby/contact.rb +2 -2
- data/lib/pushbullet_ruby/device.rb +2 -2
- data/lib/pushbullet_ruby/push.rb +3 -3
- data/lib/pushbullet_ruby/version.rb +1 -1
- 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: 01eb5ac49b0dcf424f90a04387523868c49df105
|
4
|
+
data.tar.gz: 477f3996c064b3b657a90945de692a47ce058927
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8260e61e889d765495cdae01427d0c32a95d71abbedbfe88483a5119918e0dd6db48252b4fd9217e485ff2fef0f669cd29380e646dced9f97c8ca69b67abc1b7
|
7
|
+
data.tar.gz: be1a883fa1884d071c006687b58ea6bdbe798719462a5c15fa986e340bd71eb265d91764c1a3ecc55e29a7b76b3d28ecf508a39d3fc779d188733c23bdee4813
|
data/README.md
CHANGED
@@ -1,75 +1,75 @@
|
|
1
|
-
# PushbulletRuby
|
2
|
-
|
3
|
-
## Installation
|
4
|
-
|
5
|
-
Add this line to your application's Gemfile:
|
6
|
-
|
7
|
-
```ruby
|
8
|
-
gem 'pushbullet_ruby'
|
9
|
-
```
|
10
|
-
## Usage
|
11
|
-
|
12
|
-
### Setup
|
13
|
-
Puts your api-key into a token.json file formatted like this:
|
14
|
-
```ruby
|
15
|
-
{token:
|
16
|
-
```
|
17
|
-
And setup your client:
|
18
|
-
```ruby
|
19
|
-
client = PushbulletRuby::Client.new(PushbulletRuby::Token.load)
|
20
|
-
```
|
21
|
-
|
22
|
-
### List devices
|
23
|
-
```ruby
|
24
|
-
client.devices
|
25
|
-
```
|
26
|
-
### Update device informations
|
27
|
-
```ruby
|
28
|
-
client.update_device(
|
29
|
-
id: 'device id',
|
30
|
-
params: {
|
31
|
-
nickname: 'device name'
|
32
|
-
}
|
33
|
-
)
|
34
|
-
```
|
35
|
-
### List contacts
|
36
|
-
```ruby
|
37
|
-
client.contacts
|
38
|
-
```
|
39
|
-
### List subscriptions(channels)
|
40
|
-
```ruby
|
41
|
-
client.subscriptions
|
42
|
-
```
|
43
|
-
### Get recent channel pushes
|
44
|
-
```ruby
|
45
|
-
client.recent_pushes('channel tag')
|
46
|
-
```
|
47
|
-
### List pushes
|
48
|
-
```ruby
|
49
|
-
client.pushes
|
50
|
-
```
|
51
|
-
### Push
|
52
|
-
You can send following list:
|
53
|
-
|
54
|
-
- note
|
55
|
-
- link
|
56
|
-
- file
|
57
|
-
```ruby
|
58
|
-
client.push_note(
|
59
|
-
receiver: :device,
|
60
|
-
identifier: 'devide id',
|
61
|
-
params: {
|
62
|
-
title: 'Title',
|
63
|
-
body: 'Content'
|
64
|
-
}
|
65
|
-
)
|
66
|
-
```
|
67
|
-
## Contributing
|
68
|
-
|
69
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/creends/pushbullet_ruby.
|
70
|
-
|
71
|
-
|
72
|
-
##### This gem is inspired by [washbullet](https://github.com/hrysd/washbullet)
|
73
|
-
|
74
|
-
|
75
|
-
|
1
|
+
# PushbulletRuby
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'pushbullet_ruby'
|
9
|
+
```
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
### Setup
|
13
|
+
Puts your api-key into a token.json file formatted like this:
|
14
|
+
```ruby
|
15
|
+
{"token": "your api-key here"}
|
16
|
+
```
|
17
|
+
And setup your client:
|
18
|
+
```ruby
|
19
|
+
client = PushbulletRuby::Client.new(PushbulletRuby::Token.load)
|
20
|
+
```
|
21
|
+
|
22
|
+
### List devices
|
23
|
+
```ruby
|
24
|
+
client.devices
|
25
|
+
```
|
26
|
+
### Update device informations
|
27
|
+
```ruby
|
28
|
+
client.update_device(
|
29
|
+
id: 'device id',
|
30
|
+
params: {
|
31
|
+
nickname: 'device name'
|
32
|
+
}
|
33
|
+
)
|
34
|
+
```
|
35
|
+
### List contacts
|
36
|
+
```ruby
|
37
|
+
client.contacts
|
38
|
+
```
|
39
|
+
### List subscriptions(channels)
|
40
|
+
```ruby
|
41
|
+
client.subscriptions
|
42
|
+
```
|
43
|
+
### Get recent channel pushes
|
44
|
+
```ruby
|
45
|
+
client.recent_pushes('channel tag')
|
46
|
+
```
|
47
|
+
### List pushes
|
48
|
+
```ruby
|
49
|
+
client.pushes
|
50
|
+
```
|
51
|
+
### Push
|
52
|
+
You can send following list:
|
53
|
+
|
54
|
+
- note
|
55
|
+
- link
|
56
|
+
- file
|
57
|
+
```ruby
|
58
|
+
client.push_note(
|
59
|
+
receiver: :device,
|
60
|
+
identifier: 'devide id',
|
61
|
+
params: {
|
62
|
+
title: 'Title',
|
63
|
+
body: 'Content'
|
64
|
+
}
|
65
|
+
)
|
66
|
+
```
|
67
|
+
## Contributing
|
68
|
+
|
69
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/creends/pushbullet_ruby.
|
70
|
+
|
71
|
+
|
72
|
+
##### This gem is inspired by [washbullet](https://github.com/hrysd/washbullet)
|
73
|
+
|
74
|
+
|
75
|
+
|
@@ -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'].map do |attributes|
|
9
9
|
next unless attributes['active']
|
10
|
-
|
10
|
+
new(attributes['channel'])
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -3,9 +3,9 @@ require 'pushbullet_ruby/entity'
|
|
3
3
|
module PushbulletRuby
|
4
4
|
class Contact < Entity
|
5
5
|
def self.from_response(response)
|
6
|
-
response.body['contacts'].
|
6
|
+
response.body['contacts'].map do |attributes|
|
7
7
|
next unless attributes['active']
|
8
|
-
|
8
|
+
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'].map do |attributes|
|
7
7
|
next unless attributes['active']
|
8
|
-
|
8
|
+
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'].
|
7
|
-
next unless
|
8
|
-
|
6
|
+
response.body['pushes'].map do |attributes|
|
7
|
+
next unless attributes['active']
|
8
|
+
new(attributes)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
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.2
|
4
|
+
version: 1.0.2.1
|
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-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|