import_remotecontrol 0.0.0 → 0.0.1
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 +43 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzM1ZjcyMDJlNjk2NjNhYjZjMTM5NTE5YjUxMzIyZjUwMTdiODllMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzA4YmFiYTgxYjdjOTBlOTNjNmQ3NzQ0OGEzM2RmMTcyYzEzNmMyMg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDIyNmVlNGUyZDZlN2ZjNjFlZDgxNzYwYTdjM2I4Mzc0YmFmYjRlODQ2ZDlj
|
10
|
+
NDE1YjExNzgyN2VjZTdlNGY5ZjhlOTgxNjdhZTJkYmQ4MGI1YjRiOTY2Yjlm
|
11
|
+
YTRiNmYyNjFmNmQ4NmE2Y2RjMDRmNTc1MjE0ZTI5NjNkMTM3MjE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODM4ZTBlOWRlOWQ2NTIyNTUwZWFmZWRkN2M0NGUzNmE3ZDczYzY4ZTllN2Fm
|
14
|
+
NDcwYWZmNTA5MTExZDdhOGRkYTE1ODQ5OGJhYjk4Yjg5YWUxYjA1ZTZiZjM0
|
15
|
+
ZDYwYzNiNTY2ODg3ZGI0ZjBiYzA2YTQzMGNkY2UzZmEyODc1MmM=
|
data/lib/import_remotecontrol.rb
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
#encoding:utf-8
|
2
|
+
require 'find'
|
3
|
+
|
4
|
+
|
5
|
+
module ImportRemotecontrol
|
6
|
+
class importRemoteControl
|
7
|
+
attr_accessor :file_path_array
|
8
|
+
attr_accessor :remote_code_array
|
9
|
+
|
10
|
+
#遍历文件夹获取全部的文件名
|
11
|
+
def self.getFileNames(dir_path)
|
12
|
+
@file_path_array = []
|
13
|
+
Find.find(dir_path).each do |path|
|
14
|
+
if FileTest.directory?(path)
|
15
|
+
@file_path_array << path
|
16
|
+
end
|
17
|
+
end
|
18
|
+
@file_path_array
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
def self.getHashRemoteCode(file_path)
|
24
|
+
remote_code_hash = {}
|
25
|
+
remote_code_line = File.read(file_path)
|
26
|
+
remote_code_line.split("\r\n").each do |code|
|
27
|
+
i = code.split("=")
|
28
|
+
remote_code_hash.merge!({i[0] => i[1]})
|
29
|
+
end
|
30
|
+
remote_code_hash
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
def self.getRemoteCodeArray(dir_path)
|
35
|
+
@remote_code_array = []
|
36
|
+
getFileNames(dir_path).each do |file_path|
|
37
|
+
@remote_code_array << getHashRemoteCode(file_path)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|