pb-cli 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/pb/cli/device.rb +12 -2
- data/lib/pb/cli/push.rb +19 -8
- data/lib/pb/cli/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: 044d160164117b94b063574a5ba1102bd6ca92a3
|
4
|
+
data.tar.gz: 8b0d65913a7bf0fe97cb2513706e5723e7f6b18d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06937c88f4c3223d67d9f2c76d31d0739368cdddd1609ccd314fd5aba85a91248fe5b6bd771c3f3699a63c4b8616d9528a2a6a1ed35ec7d3b749afd3ef1dcfcd
|
7
|
+
data.tar.gz: 4bf415b8f8c53306b462012cadcfc46d4880ca1ac5b8dd3dbb905a84efd7fbf957d9ccf5e87fc74423c458ecc90742ecf10293eeb333ceb7ee14a914ea4b5128
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pb-cli (0.3.
|
4
|
+
pb-cli (0.3.2)
|
5
5
|
rest-client (~> 1.8)
|
6
6
|
terminal-table (~> 1.5)
|
7
7
|
thor (~> 0.19)
|
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
diff-lcs (1.2.5)
|
13
|
-
domain_name (0.5.
|
13
|
+
domain_name (0.5.25)
|
14
14
|
unf (>= 0.0.5, < 1.0.0)
|
15
15
|
http-cookie (1.0.2)
|
16
16
|
domain_name (~> 0.5)
|
data/lib/pb/cli/device.rb
CHANGED
@@ -7,10 +7,20 @@ module Pushbullet_CLI
|
|
7
7
|
class Device < Thor
|
8
8
|
class_option :token, :desc => "Access token"
|
9
9
|
|
10
|
-
desc "list", "Get a list of devices belonging to the current user."
|
10
|
+
desc "device list", "Get a list of devices belonging to the current user."
|
11
11
|
method_option :format, :desc => "Accepted values: table, json. Default: table"
|
12
12
|
method_option :fields, :desc => "Limit the output to specific object fields."
|
13
|
-
def list
|
13
|
+
def list( help = "" )
|
14
|
+
unless help.empty?
|
15
|
+
if "help" == help
|
16
|
+
invoke( :help, [ "list" ] );
|
17
|
+
exit 0
|
18
|
+
else
|
19
|
+
self.class.handle_argument_error
|
20
|
+
exit 1
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
14
24
|
url = "https://api.pushbullet.com/v2/devices?active=true"
|
15
25
|
token = Utils::get_token( options )
|
16
26
|
cols = [ 'iden', 'nickname', 'created' ]
|
data/lib/pb/cli/push.rb
CHANGED
@@ -4,15 +4,21 @@
|
|
4
4
|
require "thor"
|
5
5
|
|
6
6
|
module Pushbullet_CLI
|
7
|
+
|
7
8
|
class Push < Thor
|
8
9
|
class_option :token, :desc => "Access token"
|
9
10
|
|
10
|
-
desc "create <MESSAGE>", "Send a push to devices or another persons."
|
11
|
+
desc "push create <MESSAGE>", "Send a push to devices or another persons."
|
11
12
|
method_option :title, :desc => "Title of the notification."
|
12
13
|
method_option :device, :desc => "Iden of the target device to push."
|
13
14
|
method_option :url, :desc => "The url to open."
|
14
15
|
# method_option :person, :aliases => "-p", :desc => "Delete the file after parsing it"
|
15
16
|
def create( message = "" )
|
17
|
+
if "help" == message
|
18
|
+
invoke( :help, [ "create" ] );
|
19
|
+
exit 0
|
20
|
+
end
|
21
|
+
|
16
22
|
if File.pipe?( STDIN ) || File.select( [STDIN], [], [], 0 ) != nil then
|
17
23
|
message = STDIN.readlines().join( "" )
|
18
24
|
end
|
@@ -29,10 +35,20 @@ module Pushbullet_CLI
|
|
29
35
|
end
|
30
36
|
end # end create
|
31
37
|
|
32
|
-
desc "list", "Request push history."
|
38
|
+
desc "push list", "Request push history."
|
33
39
|
method_option :format, :desc => "Accepted values: table, json. Default: table"
|
34
40
|
method_option :fields, :desc => "Limit the output to specific object fields."
|
35
|
-
def list
|
41
|
+
def list( help = "" )
|
42
|
+
unless help.empty?
|
43
|
+
if "help" == help
|
44
|
+
invoke( :help, [ "list" ] );
|
45
|
+
exit 0
|
46
|
+
else
|
47
|
+
self.class.handle_argument_error
|
48
|
+
exit 1
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
36
52
|
url = "https://api.pushbullet.com/v2/pushes?active=true"
|
37
53
|
token = Utils::get_token( options )
|
38
54
|
cols = [ 'iden', 'type', 'title', 'created' ]
|
@@ -53,8 +69,3 @@ module Pushbullet_CLI
|
|
53
69
|
|
54
70
|
end
|
55
71
|
end
|
56
|
-
|
57
|
-
# curl --header 'Access-Token: VeoW8P4oMACU46KXMYAA4f1ahIpRvB4E' \
|
58
|
-
# --data active=true \
|
59
|
-
# --get \
|
60
|
-
# https://api.pushbullet.com/v2/pushes
|
data/lib/pb/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pb-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- miya0001
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|