Permalink
Browse files

Tidy up code that selects the constants.

  • Loading branch information...
1 parent 97eebc7 commit 4971bd46bd81c7b46d82bcd8191044889344d815 @radar radar committed Jan 28, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 leaves/logga/controller.rb
@@ -145,8 +145,10 @@ def find_method(stem, sender, reply_to, name, constant=nil, opts={})
methods = @methods.select { |m| m.first == name}
methods = @methods.select { |m| /#{name}.*/.match(m.first) } if methods.empty?
methods = @methods.select { |m| Regexp.new(name.split("").join(".*")).match(m.first) } if methods.empty?
+
if constant
- methods = methods.select { |m| /#{constants.join("|")}/.match(m[1]) }
+ constants.map! { |c| "\(#{c.first}\)"}
+ methods = methods.select { |m| constants.include?(m[1])}
end
count = 0
if methods.size == 1

0 comments on commit 4971bd4

Please sign in to comment.