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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 872ee001c5e1440a6b53af23b8eb4ff79feae331
4
- data.tar.gz: 3ab5d04e0c2f0982d17d93a736b64ecdaf19be64
3
+ metadata.gz: 01eb5ac49b0dcf424f90a04387523868c49df105
4
+ data.tar.gz: 477f3996c064b3b657a90945de692a47ce058927
5
5
  SHA512:
6
- metadata.gz: 14e84e7b703df31c4d736d162c7aac65bcead77dccd613c68ba16abb9cc41adaa51659c580b19d9d69668037cba386bba54ecfe4c9afd7feaceb18df77b65aca
7
- data.tar.gz: 08dbeecedf08494a0d3c29306fdbc15cc3690a25cbff131041ad8dddbe0c0393b12b3c6b6dfaa5d6335b66901e3f4aef21ba8b5a40da15f2986d8b804ded5650
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: '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
-
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'].each_with_object([]) do |attributes, memo|
8
+ response.body['subscriptions'].map do |attributes|
9
9
  next unless attributes['active']
10
- memo << new(attributes['channel'])
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'].each_with_object([]) do |attributes, memo|
6
+ response.body['contacts'].map do |attributes|
7
7
  next unless attributes['active']
8
- memo << new(attributes)
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'].each_with_object([]) do |attributes, memo|
6
+ response.body['devices'].map do |attributes|
7
7
  next unless attributes['active']
8
- memo << new(attributes)
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 Push < Entity
5
5
  def self.from_response(response)
6
- response.body['pushes'].each_with_object([]) do |push, memo|
7
- next unless push['active']
8
- memo << new(push)
6
+ response.body['pushes'].map do |attributes|
7
+ next unless attributes['active']
8
+ new(attributes)
9
9
  end
10
10
  end
11
11
 
@@ -1,3 +1,3 @@
1
1
  module PushbulletRuby
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.2.1"
3
3
  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.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-18 00:00:00.000000000 Z
11
+ date: 2016-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler