irkit 0.0.7 → 0.0.8
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/bin/irkit +19 -1
- data/lib/irkit/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: 02f5a177ebba1edee4ae2b91f7f131fc2fc99f0b
|
4
|
+
data.tar.gz: eb05dc3c838446258f9ce0295d71907088ac9090
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 607400679a90a271f825d681c0a2e9f6d3dab69b9d87eebbf7134b296ce77252558a5883f4c1162b0e143ecff717d73b51878c0db49670cbe1381c6e99309460
|
7
|
+
data.tar.gz: 0d3903b208cfc4a1c7c4e88b533d512a16a1579be3210a63ff6690c3036816a761bd99a97f42a8869cec0b22ce86805940a07c7d3bc16cabdc9e25638b25d836
|
data/History.txt
CHANGED
data/bin/irkit
CHANGED
@@ -9,6 +9,7 @@ args = ArgsParser.parse ARGV do
|
|
9
9
|
arg :get, "get IR Data", :alias => :read
|
10
10
|
arg :post, "post IR Data", :alias => :write
|
11
11
|
arg :delete, "delete IR Data"
|
12
|
+
arg :rename, "rename IR Data -to NEWNAME"
|
12
13
|
arg :show, "print IR Data"
|
13
14
|
arg :list, "show list of IR Data and Devices"
|
14
15
|
arg :address, "IRKit IP Address"
|
@@ -29,7 +30,7 @@ binname = File.basename __FILE__
|
|
29
30
|
if args.has_option? :help or
|
30
31
|
(!args.has_param?(:get) and !args.has_param?(:post) and
|
31
32
|
!args.has_option?(:list) and !args.has_param?(:delete) and
|
32
|
-
!args.has_param?(:show) and
|
33
|
+
!args.has_param?(:rename) and !args.has_param?(:show) and
|
33
34
|
!args.has_param?(:device) and !args.has_param?("device:add") and
|
34
35
|
!args.has_param?("device:show") and !args.has_param?("device:delete"))
|
35
36
|
STDERR.puts "IRKit v#{IRKit::VERSION}"
|
@@ -43,6 +44,7 @@ if args.has_option? :help or
|
|
43
44
|
STDERR.puts " % #{binname} --post tv_on --address 192.168.0.123"
|
44
45
|
STDERR.puts " % #{binname} --show tv_on"
|
45
46
|
STDERR.puts " % #{binname} --delete tv_on"
|
47
|
+
STDERR.puts " % #{binname} --rename tv_on -to newname"
|
46
48
|
STDERR.puts " % #{binname} --device:add myhouse"
|
47
49
|
STDERR.puts " % #{binname} --post tv_on --device myhouse"
|
48
50
|
STDERR.puts " % #{binname} --device:delete myhouse"
|
@@ -81,6 +83,22 @@ if args.has_param? :delete
|
|
81
83
|
exit
|
82
84
|
end
|
83
85
|
|
86
|
+
if args.has_param?(:rename) && args.has_param?(:to)
|
87
|
+
name = args[:rename]
|
88
|
+
newname = args[:to]
|
89
|
+
unless IRKit::App::Data["IR"].has_key? name
|
90
|
+
STDERR.puts %Q{IR Data "#{name}" not found}
|
91
|
+
exit 1
|
92
|
+
end
|
93
|
+
print %Q{rename IR-Data "#{name}" to "#{newname}?" [Y/n] > }
|
94
|
+
exit 1 if STDIN.gets.strip.downcase =~ /n/
|
95
|
+
IRKit::App::Data["IR"][newname] = IRKit::App::Data["IR"][name]
|
96
|
+
IRKit::App::Data["IR"].delete name if name != newname
|
97
|
+
IRKit::App::Data.save
|
98
|
+
puts %Q{"#{name}" to "#{newname}" rename!}
|
99
|
+
exit
|
100
|
+
end
|
101
|
+
|
84
102
|
if args.has_param? "device:show"
|
85
103
|
name = args["device:show"]
|
86
104
|
puts IRKit::App::Data["Device"][name].to_json
|
data/lib/irkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|