mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Deleted all references to ActionView::SafeBuffer in favor of ActiveSupport::SafeBuffer
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
This commit is contained in:
parent
9987a00738
commit
1adfb92135
4 changed files with 5 additions and 7 deletions
|
@ -58,6 +58,4 @@ end
|
||||||
require 'active_support/core_ext/string/output_safety'
|
require 'active_support/core_ext/string/output_safety'
|
||||||
require 'action_view/base'
|
require 'action_view/base'
|
||||||
|
|
||||||
ActionView::SafeBuffer = ActiveSupport::SafeBuffer
|
|
||||||
|
|
||||||
I18n.load_path << "#{File.dirname(__FILE__)}/action_view/locale/en.yml"
|
I18n.load_path << "#{File.dirname(__FILE__)}/action_view/locale/en.yml"
|
||||||
|
|
|
@ -143,7 +143,7 @@ module ActionView
|
||||||
# Defaults to a new empty string.
|
# Defaults to a new empty string.
|
||||||
def with_output_buffer(buf = nil) #:nodoc:
|
def with_output_buffer(buf = nil) #:nodoc:
|
||||||
unless buf
|
unless buf
|
||||||
buf = ActionView::SafeBuffer.new
|
buf = ActiveSupport::SafeBuffer.new
|
||||||
buf.force_encoding(output_buffer.encoding) if buf.respond_to?(:force_encoding)
|
buf.force_encoding(output_buffer.encoding) if buf.respond_to?(:force_encoding)
|
||||||
end
|
end
|
||||||
self.output_buffer, old_buffer = buf, output_buffer
|
self.output_buffer, old_buffer = buf, output_buffer
|
||||||
|
|
|
@ -6,7 +6,7 @@ module ActionView
|
||||||
module Template::Handlers
|
module Template::Handlers
|
||||||
class Erubis < ::Erubis::Eruby
|
class Erubis < ::Erubis::Eruby
|
||||||
def add_preamble(src)
|
def add_preamble(src)
|
||||||
src << "@output_buffer = ActionView::SafeBuffer.new;"
|
src << "@output_buffer = ActiveSupport::SafeBuffer.new;"
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_text(src, text)
|
def add_text(src, text)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
require 'abstract_unit'
|
require 'abstract_unit'
|
||||||
|
|
||||||
class SafeBufferTest < ActionView::TestCase
|
class SafeBufferTest < ActiveSupport::TestCase
|
||||||
def setup
|
def setup
|
||||||
@buffer = ActionView::SafeBuffer.new
|
@buffer = ActiveSupport::SafeBuffer.new
|
||||||
end
|
end
|
||||||
|
|
||||||
test "Should look like a string" do
|
test "Should look like a string" do
|
||||||
|
@ -36,6 +36,6 @@ class SafeBufferTest < ActionView::TestCase
|
||||||
|
|
||||||
test "Should return a safe buffer when calling to_s" do
|
test "Should return a safe buffer when calling to_s" do
|
||||||
new_buffer = @buffer.to_s
|
new_buffer = @buffer.to_s
|
||||||
assert_equal ActionView::SafeBuffer, new_buffer.class
|
assert_equal ActiveSupport::SafeBuffer, new_buffer.class
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue