import_remotecontrol 0.0.0 → 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/import_remotecontrol.rb +43 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWEyMDE4M2IyMDlhMGQxMWFjOWYxMGE5NTA4NWE4YjI0YTVhM2Y1Mw==
4
+ NzM1ZjcyMDJlNjk2NjNhYjZjMTM5NTE5YjUxMzIyZjUwMTdiODllMA==
5
5
  data.tar.gz: !binary |-
6
- MTFlY2FhYjE1NDQ0MjVlNWRjMWM4MDFhOTcyMWM0OGNlYjYwYTQ5MQ==
6
+ YzA4YmFiYTgxYjdjOTBlOTNjNmQ3NzQ0OGEzM2RmMTcyYzEzNmMyMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MDExYTcyNjc1Y2FjM2Q3NTQ0MTRmOTAzZjI2MjlhYWU3ODQ4NmI0YjZiZWU0
10
- ZmJmYTA2ZmJhNGJhYmRiNjBlNDRjOTEzMjU0MzQ1ZDc1NjA0YWFlYzM1ZTM0
11
- ZjRlNDNkNjZiZDQyOGIxMDQ1MGQ5ZTJiMTBjMWY0MTE0ODA4ZTg=
9
+ ZDIyNmVlNGUyZDZlN2ZjNjFlZDgxNzYwYTdjM2I4Mzc0YmFmYjRlODQ2ZDlj
10
+ NDE1YjExNzgyN2VjZTdlNGY5ZjhlOTgxNjdhZTJkYmQ4MGI1YjRiOTY2Yjlm
11
+ YTRiNmYyNjFmNmQ4NmE2Y2RjMDRmNTc1MjE0ZTI5NjNkMTM3MjE=
12
12
  data.tar.gz: !binary |-
13
- Y2VkNTAzMzBjYTM5ZTJjZmJmYjQ2MTc1MzNlZTI1MjI0YjQ2M2Q4NGQ4Yjgz
14
- YTY2ZWM5ZGUzMWVhMGY1YmNmMDZjNWM1MTBmZjIyN2Y4YTBlNTY4YTA2YWMy
15
- ZWIwMmMyNjJmYzQzZWM1NTgxMjAxNzA5MmQ4YWVmOTI5NmYwNWM=
13
+ ODM4ZTBlOWRlOWQ2NTIyNTUwZWFmZWRkN2M0NGUzNmE3ZDczYzY4ZTllN2Fm
14
+ NDcwYWZmNTA5MTExZDdhOGRkYTE1ODQ5OGJhYjk4Yjg5YWUxYjA1ZTZiZjM0
15
+ ZDYwYzNiNTY2ODg3ZGI0ZjBiYzA2YTQzMGNkY2UzZmEyODc1MmM=
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: import_remotecontrol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - zql