diff options
author | Saku Ytti <saku@ytti.fi> | 2014-06-11 23:26:00 +0300 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2014-06-11 23:26:00 +0300 |
commit | 8ece44ee0830fcd37bb945ad3604a09cfb7d3329 (patch) | |
tree | 07ca38ece508575d8cd2be68a854e1351080ce49 | |
parent | 96dfa21e6f0bdc5d55d15fa5f7268982006d1f0c (diff) |
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.
-rw-r--r-- | lib/oxidized/manager.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |