From 8ece44ee0830fcd37bb945ad3604a09cfb7d3329 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 11 Jun 2014 23:26:00 +0300 Subject: Fix dynamic loading match We can't use #match, if IOSXR is seen in source list before IOS, then IOS will #match on IOSXR class and wrong model is used for IOS devices. And obviously stupid to use regexp if you don't atbsolutely have to. --- lib/oxidized/manager.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/oxidized/manager.rb b/lib/oxidized/manager.rb index f901a5f..ed49b7e 100644 --- a/lib/oxidized/manager.rb +++ b/lib/oxidized/manager.rb @@ -10,7 +10,7 @@ module Oxidized require File.join dir, file+'.rb' klass = nil [Oxidized, Object].each do |mod| - klass = mod.constants.find { |const| const.to_s.downcase.match file.downcase } + klass = mod.constants.find { |const| const.to_s.downcase == file.downcase } klass = mod.const_get klass if klass break if klass end -- cgit v1.2.1