irkit 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/README.md +3 -0
- data/bin/irkit +13 -6
- data/lib/irkit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf54f2430810b7a84f2cb3f326c1efe02dfb45fb
|
4
|
+
data.tar.gz: 98efeca9c30f0862cb8a283a85bfa7aee23203ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc1dad325512d1250c8276d3f98046547f4288c5831ea5baa4698eadd82034796224d5e8808813bd00e95c2f385af32d28c564c9c9c4990ada875fea7fc7d4d
|
7
|
+
data.tar.gz: 19978170b3da80b56b487ad628e5b7b71ee1d53477cd3e878e0b553886faef3ba3923b6ecd402012e00be100e536e9debc6801fdcb953cb0192971c9fe14b928
|
data/History.txt
CHANGED
data/README.md
CHANGED
data/bin/irkit
CHANGED
@@ -15,6 +15,7 @@ args = ArgsParser.parse ARGV do
|
|
15
15
|
arg :device, "use Internet API"
|
16
16
|
arg "device:add", "save clientkey and deviceid for Internet API"
|
17
17
|
arg "device:delete", "delete clientkey and deviceid"
|
18
|
+
arg "device:show", "print clientkey and deviceid"
|
18
19
|
arg :version, "show version", :alias => :v
|
19
20
|
arg :help, "show help", :alias => :h
|
20
21
|
end
|
@@ -28,8 +29,9 @@ binname = File.basename __FILE__
|
|
28
29
|
if args.has_option? :help or
|
29
30
|
(!args.has_param?(:get) and !args.has_param?(:post) and
|
30
31
|
!args.has_option?(:list) and !args.has_param?(:delete) and
|
32
|
+
!args.has_param?(:show) and
|
31
33
|
!args.has_param?(:device) and !args.has_param?("device:add") and
|
32
|
-
!args.has_param?("device:
|
34
|
+
!args.has_param?("device:show") and !args.has_param?("device:delete"))
|
33
35
|
STDERR.puts "IRKit v#{IRKit::VERSION}"
|
34
36
|
STDERR.puts " https://github.com/shokai/ruby-irkit"
|
35
37
|
STDERR.puts
|
@@ -79,6 +81,12 @@ if args.has_param? :delete
|
|
79
81
|
exit
|
80
82
|
end
|
81
83
|
|
84
|
+
if args.has_param? "device:show"
|
85
|
+
name = args["device:show"]
|
86
|
+
puts IRKit::App::Data["Device"][name].to_json
|
87
|
+
exit
|
88
|
+
end
|
89
|
+
|
82
90
|
if args.has_param? "device:delete"
|
83
91
|
name = args["device:delete"]
|
84
92
|
print %Q{delete Device "#{name}"? [Y/n] > }
|
@@ -154,12 +162,11 @@ if args.has_param? "device:add"
|
|
154
162
|
exit 1 if STDIN.gets.strip.downcase =~ /n/
|
155
163
|
end
|
156
164
|
token = irkit.get_token
|
157
|
-
|
158
|
-
res = irkit.get_key_and_deviceid(token)
|
165
|
+
info = irkit.get_key_and_deviceid(token)
|
159
166
|
|
160
|
-
puts "clientkey:\t#{
|
161
|
-
puts "deviceid:\t#{
|
162
|
-
IRKit::App::Data["Device"][name] =
|
167
|
+
puts "clientkey:\t#{info.clientkey[0..6]}XXXXXX"
|
168
|
+
puts "deviceid:\t#{info.deviceid[0..6]}XXXXXX"
|
169
|
+
IRKit::App::Data["Device"][name] = info
|
163
170
|
IRKit::App::Data.save
|
164
171
|
puts %Q{"#{name}" saved!}
|
165
172
|
exit
|
data/lib/irkit/version.rb
CHANGED