Skip to content

Commit 88aea3a

Browse files
kronthtocoderobe
authored andcommitted
Fix some issues in check_cpy
1 parent b48da3e commit 88aea3a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/methods.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
require "./src/extract-polyglot"
1010
require "./src/extract-zlib"
1111
require 'digest/md5'
12-
hash = {}
12+
hashm = Hash.new
1313
module VBiosFinder
1414
class Main
1515
@extractions = []
@@ -93,14 +93,17 @@ def self.run file
9393

9494

9595

96-
def check_cpy(new_filename,romdata)
96+
define_method (:check_cpy) do |new_filename,romdata|
9797
count = 0
9898
Dir.glob('**/*',File::FNM_DOTMATCH).each do |f|
99+
if File.directory?(f)
100+
next
101+
end
99102
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
101104
end
102105

103-
hash.each_value do |a|
106+
hashm.each_value do |a|
104107
next if a.length == 1
105108
count+= 1
106109
new_filename = "vbios_#{romdata['vendor']}_#{romdata['device']}_#{count}.rom"

0 commit comments

Comments
 (0)