irkit 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/History.txt +5 -0
  3. data/bin/irkit +19 -1
  4. data/lib/irkit/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d06c4e827211d1168e919035c6640370344e2be
4
- data.tar.gz: c1247baf250cdc6ccced4a6871cb84c64c8e724b
3
+ metadata.gz: 02f5a177ebba1edee4ae2b91f7f131fc2fc99f0b
4
+ data.tar.gz: eb05dc3c838446258f9ce0295d71907088ac9090
5
5
  SHA512:
6
- metadata.gz: 6bf8706d4d16e29b84c879a70cc74ea8cbb7bc90b49feaaa89bfd316470d08b8bd666d855ec0801f8dfcc895e922c141c3c4651c471df7970eacf77086fddb44
7
- data.tar.gz: a2504b4369c3e428fc02dee0772822f1fa3ae79915af6a3d7cc7127def4bc7df8ab0c51a14856bcbc07d4c5f24a86f411f5f7a54dfcfceaddd045939409ed610
6
+ metadata.gz: 607400679a90a271f825d681c0a2e9f6d3dab69b9d87eebbf7134b296ce77252558a5883f4c1162b0e143ecff717d73b51878c0db49670cbe1381c6e99309460
7
+ data.tar.gz: 0d3903b208cfc4a1c7c4e88b533d512a16a1579be3210a63ff6690c3036816a761bd99a97f42a8869cec0b22ce86805940a07c7d3bc16cabdc9e25638b25d836
@@ -1,3 +1,8 @@
1
+ === 0.0.8 2014-04-13
2
+
3
+ * add -rename NAME -to NEWNAME option on irkit command #5
4
+ * thank you for contributing @CUEICHI
5
+
1
6
  === 0.0.7 2014-04-08
2
7
 
3
8
  * support Ruby1.9.3 #4
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
@@ -1,3 +1,3 @@
1
1
  module IRKit
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
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.7
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-08 00:00:00.000000000 Z
11
+ date: 2014-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler