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:
commit
4525701c90
5 changed files with 5 additions and 5 deletions
|
@ -11,7 +11,7 @@ module ActionView
|
|||
end
|
||||
|
||||
def source
|
||||
::File.binread @filename
|
||||
File.binread @filename
|
||||
end
|
||||
|
||||
def refresh(_)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -113,7 +113,7 @@ module ActionView
|
|||
|
||||
eager_autoload do
|
||||
autoload :Error
|
||||
autoload :File
|
||||
autoload :RawFile
|
||||
autoload :Handlers
|
||||
autoload :HTML
|
||||
autoload :Inline
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
Loading…
Reference in a new issue