Use Kernel#Array in ActionController::Helpers

This commit is contained in:
Rafael Mendonça França 2012-01-05 17:13:27 -03:00
parent ec28c4fb24
commit 56715c49d4

@ -1,4 +1,3 @@
require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/class/attribute' require 'active_support/core_ext/class/attribute'
module ActionController module ActionController
@ -94,7 +93,7 @@ def modules_for_helpers(args)
def all_helpers_from_path(path) def all_helpers_from_path(path)
helpers = [] helpers = []
Array.wrap(path).each do |_path| Array(path).each do |_path|
extract = /^#{Regexp.quote(_path.to_s)}\/?(.*)_helper.rb$/ extract = /^#{Regexp.quote(_path.to_s)}\/?(.*)_helper.rb$/
helpers += Dir["#{_path}/**/*_helper.rb"].map { |file| file.sub(extract, '\1') } helpers += Dir["#{_path}/**/*_helper.rb"].map { |file| file.sub(extract, '\1') }
end end