pushbullet-ruby 0.0.1 → 0.0.2
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/lib/v2/push.rb +1 -51
- data/lib/v2/test/test_push.rb +1 -3
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 98c647636a542eeb6d02675a382991a3cab007e4
|
|
4
|
+
data.tar.gz: 151d664844801b9a8469577183835dffe68ee2c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f7563ecd5db58dda8eaa633a14a983645a9841a8412f9555c24b00413f2901d2e94507803a6c1d18f14b3f41831e10bf1877dea2240040e658de4602fa08942
|
|
7
|
+
data.tar.gz: e31d4f537238a7ab515cc1397ecdee4134abc83ad4a3e42869dccf53647e8c60c2a9936a0945bc7437bc5bca9dad50520855cd2bd911ba5b21b314be801dde09
|
data/lib/v2/push.rb
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# functions for Pushbullet push api
|
|
6
6
|
#
|
|
7
7
|
# created on : 2014.12.18
|
|
8
|
-
# last update:
|
|
8
|
+
# last update: 2015.07.01
|
|
9
9
|
#
|
|
10
10
|
# by meinside@gmail.com
|
|
11
11
|
|
|
@@ -70,56 +70,6 @@ module Pushbullet
|
|
|
70
70
|
return nil
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
|
-
|
|
74
|
-
# push address
|
|
75
|
-
#
|
|
76
|
-
# @param name [String] name of address
|
|
77
|
-
# @param address [String] address itself, or query for the address
|
|
78
|
-
# @param recipient [Hash] key-value of either one of: 'email', 'device_iden', 'channel_tag', or 'client_iden' (can be nil)
|
|
79
|
-
# @return [JSON] result as json (nil if error)
|
|
80
|
-
def self.address(name, address, recipient = nil)
|
|
81
|
-
params = {
|
|
82
|
-
type: :address,
|
|
83
|
-
name: name,
|
|
84
|
-
address: address,
|
|
85
|
-
}
|
|
86
|
-
params.merge!(recipient) if recipient
|
|
87
|
-
|
|
88
|
-
result = Pushbullet::V2::request(API_URL, params)
|
|
89
|
-
|
|
90
|
-
case result
|
|
91
|
-
when Net::HTTPOK
|
|
92
|
-
return JSON.parse(result.body)
|
|
93
|
-
else
|
|
94
|
-
puts result.body if Pushbullet.is_verbose
|
|
95
|
-
return nil
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# push checklist
|
|
100
|
-
#
|
|
101
|
-
# @param title [String] title of note
|
|
102
|
-
# @param items [Array<String>] array of checklist items
|
|
103
|
-
# @param recipient [Hash] key-value of either one of: 'email', 'device_iden', 'channel_tag', or 'client_iden' (can be nil)
|
|
104
|
-
# @return [JSON] result as json (nil if error)
|
|
105
|
-
def self.checklist(title, items, recipient = nil)
|
|
106
|
-
params = {
|
|
107
|
-
type: :list,
|
|
108
|
-
title: title,
|
|
109
|
-
items: items,
|
|
110
|
-
}
|
|
111
|
-
params.merge!(recipient) if recipient
|
|
112
|
-
|
|
113
|
-
result = Pushbullet::V2::request(API_URL, params)
|
|
114
|
-
|
|
115
|
-
case result
|
|
116
|
-
when Net::HTTPOK
|
|
117
|
-
return JSON.parse(result.body)
|
|
118
|
-
else
|
|
119
|
-
puts result.body if Pushbullet.is_verbose
|
|
120
|
-
return nil
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
73
|
|
|
124
74
|
# push file
|
|
125
75
|
#
|
data/lib/v2/test/test_push.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# test script for lib/v2/push.rb
|
|
7
7
|
#
|
|
8
8
|
# created on : 2014.12.18
|
|
9
|
-
# last update:
|
|
9
|
+
# last update: 2015.07.01
|
|
10
10
|
#
|
|
11
11
|
# by meinside@gmail.com
|
|
12
12
|
|
|
@@ -33,8 +33,6 @@ class TestPush < Test::Unit::TestCase
|
|
|
33
33
|
|
|
34
34
|
assert_not_nil(Pushbullet::V2::Push.note('Testing pushbullet-ruby push.note', 'This note is for testing.'))
|
|
35
35
|
assert_not_nil(Pushbullet::V2::Push.link('Testing pushbullet-ruby push.link', 'This link is for testing.', 'https://docs.pushbullet.com/v2/pushes/'))
|
|
36
|
-
assert_not_nil(Pushbullet::V2::Push.address('Testing pushbullet-ruby push.address', 'Google Korea LLC. 22nd Floor, Gangnam Finance Center 152 Teheran-ro, Gangnam-gu'))
|
|
37
|
-
assert_not_nil(Pushbullet::V2::Push.checklist('Testing pushbullet-ruby push.list', ['Test 1', 'Test 2', 'Test 3']))
|
|
38
36
|
assert_not_nil(Pushbullet::V2::Push.file(__FILE__, 'Testing pushbullet-ruby push.file'))
|
|
39
37
|
end
|
|
40
38
|
|
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: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sungjin Han
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mimemagic
|
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
61
61
|
version: '0'
|
|
62
62
|
requirements: []
|
|
63
63
|
rubyforge_project:
|
|
64
|
-
rubygems_version: 2.4.
|
|
64
|
+
rubygems_version: 2.4.6
|
|
65
65
|
signing_key:
|
|
66
66
|
specification_version: 4
|
|
67
67
|
summary: Ruby library for Pushbullet
|