From 573e361a3ccb2cc716ed028d66da8af144bc0db2 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Sun, 17 Mar 2019 23:53:39 -0700 Subject: Deprecate custom patterns for PathResolver Custom glob patterns tie the implementation (Using Dir.glob) to the API we provide. It also doesn't really work. extract_handler_and_format_and_variant expects the handler, format, and variant to be at the end of the template path, and in the same order as they are in the default pattern. This deprecates specifying a custom path for FileSystemResolver and removes the pattern argument of OptimizedFileSystemResolver#initialize, which does not work with a custom pattern. --- actionview/test/template/resolver_patterns_test.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'actionview/test/template/resolver_patterns_test.rb') diff --git a/actionview/test/template/resolver_patterns_test.rb b/actionview/test/template/resolver_patterns_test.rb index 8122de779f..22815c8dbe 100644 --- a/actionview/test/template/resolver_patterns_test.rb +++ b/actionview/test/template/resolver_patterns_test.rb @@ -6,7 +6,10 @@ class ResolverPatternsTest < ActiveSupport::TestCase def setup path = File.expand_path("../fixtures", __dir__) pattern = ":prefix/{:formats/,}:action{.:formats,}{+:variants,}{.:handlers,}" - @resolver = ActionView::FileSystemResolver.new(path, pattern) + + assert_deprecated do + @resolver = ActionView::FileSystemResolver.new(path, pattern) + end end def test_should_return_empty_list_for_unknown_path -- cgit v1.2.3