diff options
author | John Hawthorn <john@hawthorn.email> | 2019-04-04 15:04:30 -0700 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2019-04-04 16:21:12 -0700 |
commit | 6e85c5c634ff0e35b0f59d2e9da1d72e371f61af (patch) | |
tree | d1190defd0f0187303b35a3dba5fd5bc30538446 | |
parent | 151cac65f12e4718317f39254f6a7ccea4ade25b (diff) | |
download | rails-6e85c5c634ff0e35b0f59d2e9da1d72e371f61af.tar.gz rails-6e85c5c634ff0e35b0f59d2e9da1d72e371f61af.tar.bz2 rails-6e85c5c634ff0e35b0f59d2e9da1d72e371f61af.zip |
Remove FileTemplate
This is unnecessary now that we can just provide a file source
-rw-r--r-- | actionview/lib/action_view.rb | 1 | ||||
-rw-r--r-- | actionview/lib/action_view/file_template.rb | 12 | ||||
-rw-r--r-- | actionview/lib/action_view/template/resolver.rb | 4 |
3 files changed, 3 insertions, 14 deletions
diff --git a/actionview/lib/action_view.rb b/actionview/lib/action_view.rb index f398ba0ff0..5ee14bfc78 100644 --- a/actionview/lib/action_view.rb +++ b/actionview/lib/action_view.rb @@ -44,7 +44,6 @@ module ActionView autoload :Rendering autoload :RoutingUrlFor autoload :Template - autoload :FileTemplate autoload :ViewPaths autoload_under "renderer" do diff --git a/actionview/lib/action_view/file_template.rb b/actionview/lib/action_view/file_template.rb deleted file mode 100644 index f952c364c9..0000000000 --- a/actionview/lib/action_view/file_template.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -require "action_view/template" - -module ActionView - class FileTemplate < Template - def initialize(filename, handler, details) - source = ActionView::Template::Sources::File.new(filename) - super(source, filename, handler, details) - end - end -end diff --git a/actionview/lib/action_view/template/resolver.rb b/actionview/lib/action_view/template/resolver.rb index d5cb3c823a..e291dc268a 100644 --- a/actionview/lib/action_view/template/resolver.rb +++ b/actionview/lib/action_view/template/resolver.rb @@ -191,7 +191,9 @@ module ActionView def build_template(template, virtual_path, locals) handler, format, variant = extract_handler_and_format_and_variant(template) - FileTemplate.new(File.expand_path(template), handler, + filename = File.expand_path(template) + source = Template::Sources::File.new(filename) + Template.new(source, filename, handler, virtual_path: virtual_path, format: format, variant: variant, |