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

Rename File to RawFile

This commit is contained in:
Cliff Pruitt 2019-04-01 19:29:03 -04:00
parent beb0bc9907
commit 90196398a1
5 changed files with 5 additions and 5 deletions

View file

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

View file

@ -27,7 +27,7 @@ module ActionView
Template::HTML.new(options[:html], formats.first) Template::HTML.new(options[:html], formats.first)
elsif options.key?(:file) elsif options.key?(:file)
if File.exist?(options[:file]) if File.exist?(options[:file])
Template::File.new(options[:file]) Template::RawFile.new(options[:file])
else else
ActiveSupport::Deprecation.warn "render file: should be given the absolute path to a file" 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) @lookup_context.with_fallbacks.find_file(options[:file], nil, false, keys, @details)

View file

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

View file

@ -104,7 +104,7 @@ module ActionView
def line_number def line_number
@line_number ||= @line_number ||=
if file_name 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 } $1 if message =~ regexp || backtrace.find { |line| line =~ regexp }
end end
end end

View file

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