Skip to content
Browse files

Changed loops class loading code to work with non-stadard loop names

  • Loading branch information...
1 parent 343d295 commit 7af4f549f6c0424cfb6a80dcc051b90adbc783f0 @kovyrin kovyrin committed Apr 1, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/loops/engine.rb
View
3 lib/loops/engine.rb
@@ -97,8 +97,9 @@ def load_loop_class(name, config)
return false
end
- klass_name = "#{loop_name}_loop".capitalize.gsub(/_(.)/) { $1.upcase }
+ klass_name = "#{loop_name}_loop".split('/').map { |x| x.capitalize.gsub(/_(.)/) { $1.upcase } }.join('::')
klass = Object.const_get(klass_name) rescue nil
+ klass = klass_name.constantize if klass_name.respond_to?(:constantize) && !klass
unless klass
error "Can't find class: #{klass_name}. Worker #{name} won't be started!"

0 comments on commit 7af4f54

Please sign in to comment.
Something went wrong with that request. Please try again.