ignores = %w()

# $DEBUG = true

module Enumerable
  def all?
    self.each{|e|
      return false unless yield(e)
    }
    true
  end
end

ARGV.each{|dir|
  dir = File.expand_path(dir)
  Dir.glob(File.join(dir, '**/*.rb')){|file|
    p file if $DEBUG
    if ignores.all?{|e|
      r = Regexp.compile(Regexp.escape(e))
      r !~ file
    }
    parsed = YARVCore::InstructionSequence.compile_file(file)
    puts parsed.disasm if $DEBUG
    else
      puts "ignore: #{file}"
    end
  }
}
