import_remotecontrol 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/import_remotecontrol.rb +14 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzFmOTBlMThmZTM3NDkxYTljMjc0ZWU2MmIxYjI1ZjcxNWRmNmIzMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODFjZDM5Y2QyMzFmMGZjNTZhNzkxZjE4Yjc2MGVmMzAwMzI3OGJhNw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTY4NDFlZWQ4MDAyYzE1Y2YzODcyMzZkYzBjMGM3OTU5YmNmMGYwNTY4Zjg5
|
10
|
+
ODY2MjMyN2E0YjcyYTU5YTEwYmU3MzQ1OTg5ZGQwZjRlMjdmNTU1NzI3YTQz
|
11
|
+
NDZmNzJkNmQyZDQ4NTQwMmZlMDFiZjQ4ZTQ4N2Q4OWJiN2UzNTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjhkMTk3MDU2YTA1M2I0NzMzMDAzNDVjMTgwYWFhMGEzOGRlZGE2OTAzZjFj
|
14
|
+
MGQyOTliNzc5OGVlMTZiNGIzNTgwODMyZjY4ZTdiNzBmN2I3NDBjYWRhNWVm
|
15
|
+
ZjZlZjQzZWE3YTY4MTc3MmY3NDEzODg5ZTdhMmIwYTZmNzJjNjk=
|
data/lib/import_remotecontrol.rb
CHANGED
@@ -7,9 +7,19 @@ module ImportRemotecontrol
|
|
7
7
|
attr_accessor :protocol_hash
|
8
8
|
|
9
9
|
DEFAULT_UNCLUDE = ["FileFormat","Remotecontroldescripe","Device","Brand","Model","Button'scounts"]
|
10
|
+
DEFAULT_NOIMPORT = ["FileFormat","Remotecontroldescripe","Button'scounts"]
|
10
11
|
|
11
12
|
METHOD_NAME = "method_name"
|
12
13
|
|
14
|
+
DEFAULT_CODENAME = {"机顶盒电源"=>"power","静音"=>"voice_quiet","菜单"=>"menu",
|
15
|
+
"上"=>"up","下"=>"down","左"=>"left","右"=>"right",
|
16
|
+
"音量+"=>'voice_up',"音量-"=>"voice_down",
|
17
|
+
"频道+"=>"channel_up","频道-"=>"channel_down"}
|
18
|
+
|
19
|
+
BRAND ="Brand"
|
20
|
+
MODEL = "model"
|
21
|
+
|
22
|
+
|
13
23
|
def self.get_error_msg(error,options={})
|
14
24
|
ret = ""
|
15
25
|
ret = ret + "ClassName: import_remotecontrol gem "
|
@@ -69,6 +79,7 @@ module ImportRemotecontrol
|
|
69
79
|
if i.count>=2
|
70
80
|
i[0] = "" unless i[0]
|
71
81
|
key = i[0].gsub(" ","")
|
82
|
+
key = DEFAULT_CODENAME[key] if DEFAULT_CODENAME.has_key?(key)
|
72
83
|
if isBrand?(key)
|
73
84
|
brand = i[1]
|
74
85
|
end
|
@@ -76,17 +87,14 @@ module ImportRemotecontrol
|
|
76
87
|
if i[0]
|
77
88
|
if(i[0].split(",").count > 1)
|
78
89
|
key = i[0].split(",")[1]
|
79
|
-
p "************************************"
|
80
|
-
p ({key=> i[1]})
|
81
90
|
unless isProcolCode?(key)
|
82
|
-
|
83
|
-
ret.merge!({key => i[1]})
|
91
|
+
ret.merge!({key => i[1]}) unless DEFAULT_NOIMPORT.include?(key)
|
84
92
|
else
|
85
93
|
codehash = disposeProtocolCode(i[1],brand)
|
86
|
-
ret.merge!({key=>codehash})
|
94
|
+
ret.merge!({key=>codehash}) unless DEFAULT_NOIMPORT.include?(key)
|
87
95
|
end
|
88
96
|
else
|
89
|
-
ret.merge!({key=>i[1]})
|
97
|
+
ret.merge!({key=>i[1]}) unless DEFAULT_NOIMPORT.include?(key)
|
90
98
|
end
|
91
99
|
end
|
92
100
|
end
|