import_remotecontrol 0.0.5 → 0.0.6

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 +25 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmE2NmQ2NzRjOTZjMjg2Njk2MmU2MGNhMDY3NmUwNmQzMjZhZmU5Nw==
4
+ ZDVmNDAzOTU1ZTMwMDI1MWNiYzZkODE3MGRhNThjMTk0NmVhZGVhNg==
5
5
  data.tar.gz: !binary |-
6
- NGEyOGRmMGYzMTcyY2U4MTBlZWZlM2ZmNWVmNjk3ZGI5MmViNzM4Nw==
6
+ MDY0ZjBhMGIyZDk0Njc2ZWMzZDY5MzJhYmJjZTlhYTRlMmJlNTdhYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTJlZjFiMTQxZDA3ZjE3ZWQzMDA3OWIwOWZhOWNlYWQxY2FhMmU1ZWVjZWUw
10
- YzUzOTdjMGQ2MGQzMjNmNzdlYjc2OTg3YmNhNWU5ZDQ1YzJmNjVmZGE5ZDhh
11
- ODdiNjljNmI0NTRiMWNjY2Q3NzMxYjM2YTYxNTNjMTBkZGZjMDc=
9
+ NTQzNTg5ODQ3ZGM1ZTQ3MTljMGU3YTA2YTNiNTBmZjQ2OTBlMDc2ZmU4Mjll
10
+ ZDAzMmJjOGRkYTcwNmNjM2Y4OTE5YzhkMDYzNmEyYTg3OTRhYmY1MjUwY2Nk
11
+ ZDJiYTdlZDIyODBkOGQxN2Q4YjE1ODhjMWNhMDdkNGVjZjcyMDA=
12
12
  data.tar.gz: !binary |-
13
- YzU0MGJkOGM5OTVhY2ZkNDYyM2Q3ZjJkNjVhYzVlNmJkYTg0N2VmMzA5MDJm
14
- NDJkMTczZmYwZGJjNGMxNzA5MDFhNWQzZTA2NjJiZmQ4ZDc5ZGIwNTkwM2Uy
15
- MmRmZDIzMjJlY2ZhMmZjYjNkNGQwYTZjZGNlOWZjM2UwZTAzM2Y=
13
+ MzMwZGMzOWQ1Nzk4ZDNjMzgwYWY0MThiMmQzNzJlNjM2ZmJiNzU2NjRmYTQ0
14
+ Y2U5MDcxZTZmY2M3NjJiNTRiN2Q4YWViYWZlZDlkMTZlOTYzMjI5NjVkMjhh
15
+ MzVhNzE5ZjJmZjgxNDhhMTY0ZjQ5YzlkMjkyMDc1ZDU1YjQwODY=
@@ -10,9 +10,18 @@ module ImportRemotecontrol
10
10
  @file_path_array = []
11
11
  Find.find(dir_path).each do |path|
12
12
  if FileTest.directory?(path)
13
- self.getFileNames(path)
14
- else
15
- @file_path_array << path
13
+ p path
14
+ Dir.foreach(path) do |file_path|
15
+ if(file_path != "."&&file_path!= "..")
16
+ if FileTest.directory?("#{path}/#{file_path}")
17
+ p file_path
18
+ self.getFileNames("#{path}/#{file_path}")
19
+ else
20
+ p "Where Put #{file_path}"
21
+ @file_path_array << "#{path}/#{file_path}"
22
+ end
23
+ end
24
+ end
16
25
  end
17
26
  end
18
27
  @file_path_array
@@ -21,11 +30,20 @@ module ImportRemotecontrol
21
30
 
22
31
 
23
32
  def self.getHashRemoteCode(file_path)
33
+ p "In get HashRemoteCode"
24
34
  remote_code_hash = {}
25
35
  remote_code_line = File.read(file_path)
26
36
  remote_code_line.split("\r\n").each do |code|
27
37
  i = code.split("=")
28
- remote_code_hash.merge!({i[0] => i[1]})
38
+ key = i[0]
39
+ if i
40
+ if i[0]
41
+ if(i[0].split(",").count > 1)
42
+ key = i[0].split(",")[1]
43
+ end
44
+ end
45
+ end
46
+ remote_code_hash.merge!({key => i[1]})
29
47
  end
30
48
  remote_code_hash
31
49
  end
@@ -34,7 +52,9 @@ module ImportRemotecontrol
34
52
  def self.getRemoteCodeArray(dir_path)
35
53
  @remote_code_array = []
36
54
  if FileTest.directory?(dir_path)
37
- getFileNames(dir_path).each do |file_path|
55
+ filenames = getFileNames(dir_path)
56
+ filenames.each do |file_path|
57
+ p file_path
38
58
  @remote_code_array << getHashRemoteCode(file_path)
39
59
  end
40
60
  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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - zql