1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #35826 from cpruitt/rename-file-to-rawfile

Rename `Template::File` to `Template::RawFile`
This commit is contained in:
Kasper Timm Hansen 2019-04-02 10:10:28 +02:00 committed by GitHub
commit 4525701c90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View file

@ -11,7 +11,7 @@ module ActionView
end
def source
::File.binread @filename
File.binread @filename
end
def refresh(_)

View file

@ -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_file(options[:file], nil, false, keys, @details)

View file

@ -113,7 +113,7 @@ module ActionView
eager_autoload do
autoload :Error
autoload :File
autoload :RawFile
autoload :Handlers
autoload :HTML
autoload :Inline

View file

@ -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

View file

@ -3,7 +3,7 @@
module ActionView #:nodoc:
# = Action View File Template
class Template #:nodoc:
class File #:nodoc:
class RawFile #:nodoc:
attr_accessor :type, :format
def initialize(filename)