lib/coypond.rb in coypond-0.1.1 vs lib/coypond.rb in coypond-0.2.0

- old
+ new

@@ -19,10 +19,13 @@ result = classes.merge(modules.merge(methods)) result.each do |dec, location| context = source.lines.to_a[location.first - 1] final_result[file_name] << [dec, location, context] end + + yield(file_name, final_result[file_name]) if block_given? + end return final_result end private @@ -30,10 +33,10 @@ search_term = options[:search_term] search_term = search_term.downcase if options[:ignore_case] collection.select do |k,v| k = k.downcase if options[:ignore_case] if options[:regexp] - Regexp.new("#{search_term}$").match(k) + Regexp.new("(#{search_term})$").match(k) else k.end_with?(search_term) end end end