import_remotecontrol 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/import_code.rb +33 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTI2YjM0YmYxMjdlY2VhMDFhNWQ5NjE3YTFhOTlmNzZkMzNlY2IzOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTgwZTI5OGZiNmJiMWIzYTFiOGUwOGIwZmFmMzZhYmI5MWU3ZjI3YQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTg2ZTM4MGY0MWQwMDAwZDZkMTg4MGQzM2MwZjljMTEzMDIyNzljNTEyYzM2
|
10
|
+
YzFlNGEyMzZhZmEwNTkwODUxMzY0YTgyMjYxYzViNzAxOTgxZjRjODk4ODZk
|
11
|
+
ODM4MTk4MWIxOTNhYjU2NTc0MzUzZjVhNmRhODFmYzlhODM5OGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDhmZGM0OTFlMDk5OWRlZmM1MmYyOTU3YWNhYjg2ZGQzOTA3MTZjOGI3ZTgz
|
14
|
+
NTJlN2VjNDgzNDQxOTQ5NWFhMGQxNjA1MjRjZmE3MzU2NTM0MzUzYzgwMTJh
|
15
|
+
MGE4ZDg4NWU1OWFkNWVmZjFiMjQ4NDdmZTc3NmJiMTMwNDI4MDE=
|
data/lib/import_code.rb
CHANGED
@@ -76,9 +76,38 @@ module ImportCode
|
|
76
76
|
rescue => err
|
77
77
|
raise ArgumentError, get_error_msg(err,{METHOD_NAME => "getFileNames"})
|
78
78
|
end
|
79
|
+
p "File_path: #{@file_path_array}"
|
79
80
|
@file_path_array
|
80
81
|
end
|
81
82
|
|
83
|
+
def self.getFileNames(dir_path)
|
84
|
+
file_path_array = []
|
85
|
+
allre= []
|
86
|
+
begin
|
87
|
+
Dir.foreach(dir_path).each do |path|
|
88
|
+
allre << path
|
89
|
+
end
|
90
|
+
allre.each do |file_name|
|
91
|
+
full_file_name = dir_path + "/" + file_name
|
92
|
+
unless file_name == "."||file_name == ".."
|
93
|
+
if File.directory?(full_file_name)
|
94
|
+
fileNames = getFileNames(full_file_name)
|
95
|
+
if fileNames.count>0
|
96
|
+
file_path_array = file_path_array + fileNames
|
97
|
+
end
|
98
|
+
elsif(file_name.eql?("protocol"))
|
99
|
+
getProtocolList(full_file_name)
|
100
|
+
else
|
101
|
+
file_path_array << {"file_path"=>full_file_name,"file_name"=>file_name}
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
rescue => err
|
106
|
+
raise ArgumentError, get_error_msg(err,{METHOD_NAME => "getFileNames"})
|
107
|
+
end
|
108
|
+
file_path_array
|
109
|
+
end
|
110
|
+
|
82
111
|
#判断是否是按键编码对应的KEY
|
83
112
|
def self.isProcolCode?(key)
|
84
113
|
!DEFAULT_UNCLUDE.include?(key)
|
@@ -265,18 +294,19 @@ module ImportCode
|
|
265
294
|
|
266
295
|
|
267
296
|
|
268
|
-
|
269
|
-
#获取遥控编码数组
|
270
297
|
def self.getRemoteCodeArray(dir_path)
|
271
298
|
@remote_code_array = []
|
272
299
|
@statistics = {}
|
273
300
|
if FileTest.directory?(dir_path)
|
274
301
|
filenames = getFileNames(dir_path)
|
275
302
|
filenames.each do |file_msg|
|
276
|
-
|
303
|
+
p "File_Path : #{file_msg["file_path"]}"
|
304
|
+
@statistics = {}
|
277
305
|
@remote_code_array<<importRemoteCode(file_msg)
|
278
306
|
end
|
279
307
|
end
|
280
308
|
@remote_code_array
|
281
309
|
end
|
310
|
+
|
311
|
+
|
282
312
|
end
|