lib/tracksperanto.rb in tracksperanto-1.8.4 vs lib/tracksperanto.rb in tracksperanto-1.9.0

- old
+ new

@@ -2,11 +2,11 @@ require 'delegate' require 'tempfile' module Tracksperanto PATH = File.expand_path(File.dirname(__FILE__)) - VERSION = '1.8.4' + VERSION = '1.9.0' module Import; end module Export; end module Middleware; end module Pipeline; end @@ -36,10 +36,19 @@ middlewares.map{|e| e.const_name } end end self.exporters, self.importers, self.middlewares = [], [], [] - + + # Case-insensitive search for a middleware class by name + def self.get_middleware(name) + middlewares.each do | x | + return x if x.const_name.downcase == name.downcase + end + + raise NameError, "Unknown middleware #{name}" + end + # Case-insensitive search for an export module by name def self.get_exporter(name) exporters.each do | x | return x if x.const_name.downcase == name.downcase end \ No newline at end of file