提交 e97180c2 编写于 作者: S Simon Jefford 提交者: Joshua Peek

Ensure that loading metals from the main app and engines works on older Ruby...

Ensure that loading metals from the main app and engines works on older Ruby versions [#2143 state:resolved]
Signed-off-by: NJoshua Peek <josh@joshpeek.com>
上级 3191535f
......@@ -15,9 +15,11 @@ def self.metals
metal_glob = metal_paths.map{ |base| "#{base}/**/*.rb" }
all_metals = {}
Dir[*metal_glob].sort.map do |file|
file = file.match(matcher)[1]
all_metals[file.classify] = file
metal_glob.each do |glob|
Dir[glob].sort.map do |file|
file = file.match(matcher)[1]
all_metals[file.classify] = file
end
end
load_list = requested_metals || all_metals.keys
......
......@@ -41,6 +41,15 @@ def test_metal_finding_with_requested_metals_should_work_with_subfolders
end
end
def test_metal_finding_should_work_with_multiple_metal_paths_in_185_and_below
use_appdir("singlemetal") do
engine_metal_path = "#{File.dirname(__FILE__)}/fixtures/plugins/engines/engine/app/metal"
Rails::Rack::Metal.metal_paths << engine_metal_path
$LOAD_PATH << engine_metal_path
assert_equal(["FooMetal", "EngineMetal"], found_metals_as_string_array)
end
end
private
def use_appdir(root)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册