aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/file_template.rb2
-rw-r--r--actionview/lib/action_view/renderer/template_renderer.rb2
-rw-r--r--actionview/lib/action_view/template.rb2
-rw-r--r--actionview/lib/action_view/template/error.rb2
-rw-r--r--actionview/lib/action_view/template/raw_file.rb (renamed from actionview/lib/action_view/template/file.rb)4
5 files changed, 6 insertions, 6 deletions
diff --git a/actionview/lib/action_view/file_template.rb b/actionview/lib/action_view/file_template.rb
index e0dc7da3b6..dea02176eb 100644
--- a/actionview/lib/action_view/file_template.rb
+++ b/actionview/lib/action_view/file_template.rb
@@ -11,7 +11,7 @@ module ActionView
end
def source
- ::File.binread @filename
+ File.binread @filename
end
def refresh(_)
diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb
index e30016a027..4aab3f913f 100644
--- a/actionview/lib/action_view/renderer/template_renderer.rb
+++ b/actionview/lib/action_view/renderer/template_renderer.rb
@@ -27,7 +27,7 @@ module ActionView
Template::HTML.new(options[:html], formats.first)
elsif options.key?(:file)
if File.exist?(options[:file])
- Template::File.new(options[:file])
+ Template::RawFile.new(options[:file])
else
ActiveSupport::Deprecation.warn "render file: should be given the absolute path to a file"
@lookup_context.with_fallbacks.find_template(options[:file], nil, false, keys, @details)
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb
index ebe52532d6..94f8a194a0 100644
--- a/actionview/lib/action_view/template.rb
+++ b/actionview/lib/action_view/template.rb
@@ -113,7 +113,7 @@ module ActionView
eager_autoload do
autoload :Error
- autoload :File
+ autoload :RawFile
autoload :Handlers
autoload :HTML
autoload :Inline
diff --git a/actionview/lib/action_view/template/error.rb b/actionview/lib/action_view/template/error.rb
index aace0be04d..d0ea03e228 100644
--- a/actionview/lib/action_view/template/error.rb
+++ b/actionview/lib/action_view/template/error.rb
@@ -104,7 +104,7 @@ module ActionView
def line_number
@line_number ||=
if file_name
- regexp = /#{Regexp.escape ::File.basename(file_name)}:(\d+)/
+ regexp = /#{Regexp.escape File.basename(file_name)}:(\d+)/
$1 if message =~ regexp || backtrace.find { |line| line =~ regexp }
end
end
diff --git a/actionview/lib/action_view/template/file.rb b/actionview/lib/action_view/template/raw_file.rb
index 487e5735cf..623351305f 100644
--- a/actionview/lib/action_view/template/file.rb
+++ b/actionview/lib/action_view/template/raw_file.rb
@@ -1,9 +1,9 @@
# frozen_string_literal: true
module ActionView #:nodoc:
- # = Action View File Template
+ # = Action View RawFile Template
class Template #:nodoc:
- class File #:nodoc:
+ class RawFile #:nodoc:
attr_accessor :type, :format
def initialize(filename)