214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
|
# File 'lib/malt/machine.rb', line 214
def engine(type, engine=nil)
type = ext_to_type(type)
case engine
when Class
engine
when String, Symbol
match = engine.to_s.downcase.to_sym
engines[type].find{ |e| match == e.type }
else
if engines[type]
types = engines[type]
if prior = types.find{ |e| priority.include?(e.type) }
return prior
end
if default = Engine.defaults[type]
return default end
types.first
else
nil
end
end
end
|