Skip to content

Commit

Permalink
Remove NonConcattingString.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Aug 30, 2010
1 parent ba52748 commit 3c8e1f9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions actionpack/lib/action_view/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
require 'action_view/log_subscriber'

module ActionView #:nodoc:
class NonConcattingString < ActiveSupport::SafeBuffer
end

# = Action View Base
#
# Action View templates can be written in three ways. If the template file has a <tt>.erb</tt> (or <tt>.rhtml</tt>) extension then it uses a mixture of ERb
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/capture_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def capture(*args)
value = nil
buffer = with_output_buffer { value = yield(*args) }
if string = buffer.presence || value and string.is_a?(String)
NonConcattingString.new(string)
string
end
end

Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/template/capture_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ def test_capture_captures_the_temporary_output_buffer_in_its_block
end
assert_nil @av.output_buffer
assert_equal 'foobar', string
assert_kind_of ActionView::NonConcattingString, string
end

def test_capture_captures_the_value_returned_by_the_block_if_the_temporary_buffer_is_blank
string = @av.capture('foo', 'bar') do |a, b|
a + b
end
assert_equal 'foobar', string
assert_kind_of ActionView::NonConcattingString, string
end

def test_capture_returns_nil_if_the_returned_value_is_not_a_string
Expand Down

0 comments on commit 3c8e1f9

Please sign in to comment.