File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 9
9
require "./src/extract-polyglot"
10
10
require "./src/extract-zlib"
11
11
require 'digest/md5'
12
- hash = { }
12
+ hashm = Hash . new
13
13
module VBiosFinder
14
14
class Main
15
15
@extractions = [ ]
@@ -93,14 +93,17 @@ def self.run file
93
93
94
94
95
95
96
- def check_cpy ( new_filename , romdata )
96
+ define_method ( :check_cpy ) do | new_filename , romdata |
97
97
count = 0
98
98
Dir . glob ( '**/*' , File ::FNM_DOTMATCH ) . each do |f |
99
+ if File . directory? ( f )
100
+ next
101
+ end
99
102
key = Digest ::MD5 . hexdigest ( IO . read ( f ) ) . to_sym
100
- if hash . has_key? ( key ) then hash [ key ] . push ( f ) else hash [ key ] = [ f ] end
103
+ if hashm . has_key? ( key ) then hashm [ key ] . push ( f ) else hashm [ key ] = [ f ] end
101
104
end
102
105
103
- hash . each_value do |a |
106
+ hashm . each_value do |a |
104
107
next if a . length == 1
105
108
count += 1
106
109
new_filename = "vbios_#{ romdata [ 'vendor' ] } _#{ romdata [ 'device' ] } _#{ count } .rom"
You can’t perform that action at this time.
0 commit comments