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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ce7272c56532c32aaedd21f2a3610563191485f
4
- data.tar.gz: acebb9b4fd74740a49ff54221a5e7f092611bedb
3
+ metadata.gz: cf54f2430810b7a84f2cb3f326c1efe02dfb45fb
4
+ data.tar.gz: 98efeca9c30f0862cb8a283a85bfa7aee23203ee
5
5
  SHA512:
6
- metadata.gz: 81f9a6d9bd0061a0205582f88e32d1dfb0dd05b3f07488fac8b869746148f5657b9c78c2b4ca9eacdea2dc0a30276ca5dbde7567d2c57b0143643ebcf9d31bbb
7
- data.tar.gz: 7f4e86403ea1f8752885ebd3c2a8237ecee1c399ad5ebd353823e86bc2ef64e69f2ef72cf8ab6fb2a8766fab50e34d746ad420e699f2637ed476f0d27d9790ea
6
+ metadata.gz: 0bc1dad325512d1250c8276d3f98046547f4288c5831ea5baa4698eadd82034796224d5e8808813bd00e95c2f385af32d28c564c9c9c4990ada875fea7fc7d4d
7
+ data.tar.gz: 19978170b3da80b56b487ad628e5b7b71ee1d53477cd3e878e0b553886faef3ba3923b6ecd402012e00be100e536e9debc6801fdcb953cb0192971c9fe14b928
@@ -1,3 +1,8 @@
1
+ === 0.0.5 2014-03-17
2
+
3
+ * add --device:show option on irkit command
4
+ * hide token on irkit command
5
+
1
6
  === 0.0.4 2014-03-17
2
7
 
3
8
  * add --show option on irkit command
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  [IRKit](http://getirkit.com) Client for Ruby
4
4
 
5
+ - https://github.com/shokai/ruby-irkit
6
+ - https://rubygems.org/gems/irkit
7
+
5
8
 
6
9
  ## Requirements
7
10
 
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:delete") and !args.has_param?(:show))
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
- puts "token:\t#{token}"
158
- res = irkit.get_key_and_deviceid(token)
165
+ info = irkit.get_key_and_deviceid(token)
159
166
 
160
- puts "clientkey:\t#{res.clientkey[0..6]}XXXXXX"
161
- puts "deviceid:\t#{res.deviceid[0..6]}XXXXXX"
162
- IRKit::App::Data["Device"][name] = res
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
@@ -1,3 +1,3 @@
1
1
  module IRKit
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto