temple 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,10 @@
1
1
  master
2
2
 
3
+ * Don't modify strings destructively with gsub! in HTML::Pretty.
4
+ This doesn't work with Rails safe buffers in version >= 3.0.8.
5
+
6
+ 0.3.0
7
+
3
8
  * Compiled expression dispatching
4
9
  * Method temple_dispatch is obsolete
5
10
  * EscapeHTML renamed to Escapable
@@ -118,7 +118,7 @@ module Temple
118
118
  #
119
119
  # @api public
120
120
  class RailsOutputBuffer < StringBuffer
121
- set_default_options :buffer_class => 'ActionView::OutputBuffer',
121
+ set_default_options :buffer_class => 'ActiveSupport::SafeBuffer',
122
122
  :buffer => '@output_buffer',
123
123
  :capture_generator => RailsOutputBuffer
124
124
 
@@ -35,7 +35,7 @@ module Temple
35
35
  tmp = unique_name
36
36
  [:multi,
37
37
  [:code, "#{tmp} = (#{code}).to_s"],
38
- [:code, "#{tmp}.gsub!(\"\\n\", #{indent.inspect}) if #{@pre_tags_name} !~ #{tmp}"],
38
+ [:code, "#{tmp} = #{tmp}.gsub(\"\\n\", #{indent.inspect}) if #{@pre_tags_name} !~ #{tmp}"],
39
39
  [:dynamic, tmp]]
40
40
  else
41
41
  [:dynamic, code]
@@ -1,3 +1,3 @@
1
1
  module Temple
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
@@ -22,7 +22,7 @@ describe Temple::HTML::Pretty do
22
22
  [:static, "text"],
23
23
  [:multi,
24
24
  [:code, "_temple_html_pretty2 = (code).to_s"],
25
- [:code, '_temple_html_pretty2.gsub!("\n", "\n ") if _temple_html_pretty1 !~ _temple_html_pretty2'],
25
+ [:code, '_temple_html_pretty2 = _temple_html_pretty2.gsub("\n", "\n ") if _temple_html_pretty1 !~ _temple_html_pretty2'],
26
26
  [:dynamic, "_temple_html_pretty2"]]],
27
27
  [:static, "</p>"]],
28
28
  [:static, "\n</div>"]]]
@@ -105,11 +105,11 @@ end
105
105
  describe Temple::Generators::RailsOutputBuffer do
106
106
  it 'should compile simple expressions' do
107
107
  gen = Temple::Generators::RailsOutputBuffer.new
108
- gen.call([:static, 'test']).should.equal '@output_buffer = ActionView::OutputBuffer.new; ' +
108
+ gen.call([:static, 'test']).should.equal '@output_buffer = ActiveSupport::SafeBuffer.new; ' +
109
109
  '@output_buffer.safe_concat(("test")); @output_buffer'
110
- gen.call([:dynamic, 'test']).should.equal '@output_buffer = ActionView::OutputBuffer.new; ' +
110
+ gen.call([:dynamic, 'test']).should.equal '@output_buffer = ActiveSupport::SafeBuffer.new; ' +
111
111
  '@output_buffer.safe_concat(((test).to_s)); @output_buffer'
112
- gen.call([:code, 'test']).should.equal '@output_buffer = ActionView::OutputBuffer.new; ' +
112
+ gen.call([:code, 'test']).should.equal '@output_buffer = ActiveSupport::SafeBuffer.new; ' +
113
113
  'test; @output_buffer'
114
114
  end
115
115
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: temple
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.3.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Magnus Holm
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-05-15 00:00:00 Z
14
+ date: 2011-06-09 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: tilt