radiant 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of radiant might be problematic. Click here for more details.

Files changed (96) hide show
  1. data/CHANGELOG +35 -3
  2. data/CONTRIBUTORS +11 -1
  3. data/README +5 -3
  4. data/app/controllers/admin/welcome_controller.rb +7 -0
  5. data/app/migrate/020_add_session_info_to_users.rb +11 -0
  6. data/app/models/page.rb +22 -9
  7. data/app/models/standard_tags.rb +133 -10
  8. data/app/models/user.rb +9 -1
  9. data/app/views/admin/page/edit.html.haml +5 -4
  10. data/app/views/admin/welcome/login.html.haml +42 -24
  11. data/app/views/layouts/application.html.haml +1 -1
  12. data/config/environment.rb +4 -2
  13. data/db/migrate/020_add_session_info_to_users.rb +11 -0
  14. data/db/migrate/021_remove_session_expire_from_users.rb +9 -0
  15. data/db/schema.rb +3 -2
  16. data/lib/generators/instance/instance_generator.rb +2 -1
  17. data/lib/generators/instance/templates/instance_environment.rb +5 -3
  18. data/lib/login_system.rb +13 -0
  19. data/lib/radiant.rb +1 -1
  20. data/lib/radiant/admin_ui.rb +21 -21
  21. data/lib/radiant/extension/script.rb +251 -0
  22. data/lib/radiant/extension_loader.rb +22 -20
  23. data/lib/radiant/initializer.rb +1 -1
  24. data/lib/radiant/setup.rb +2 -0
  25. data/lib/tasks/framework.rake +39 -29
  26. data/public/500.html +1 -1
  27. data/public/javascripts/admin/admin.js +11 -9
  28. data/script/extension +5 -0
  29. data/spec/controllers/admin/user_controller_spec.rb +1 -1
  30. data/spec/controllers/admin/welcome_controller_spec.rb +31 -5
  31. data/spec/controllers/site_controller_spec.rb +15 -2
  32. data/spec/lib/login_system_spec.rb +106 -60
  33. data/spec/lib/radiant/extension/script_spec.rb +349 -0
  34. data/spec/lib/radiant/extension_loader_spec.rb +3 -0
  35. data/spec/models/page_spec.rb +62 -2
  36. data/spec/models/standard_tags_spec.rb +150 -3
  37. data/spec/models/user_spec.rb +28 -0
  38. data/spec/scenarios/file_not_found_scenario.rb +5 -0
  39. data/spec/scenarios/pages_scenario.rb +6 -0
  40. data/spec/scenarios/snippets_scenario.rb +4 -0
  41. data/test/fixtures/users.yml +11 -6
  42. data/vendor/plugins/haml/FAQ +138 -0
  43. data/vendor/plugins/haml/REVISION +1 -0
  44. data/vendor/plugins/haml/Rakefile +54 -62
  45. data/vendor/plugins/haml/VERSION +1 -1
  46. data/vendor/plugins/haml/init.rb +6 -1
  47. data/vendor/plugins/haml/lib/haml.rb +72 -12
  48. data/vendor/plugins/haml/lib/haml/buffer.rb +47 -40
  49. data/vendor/plugins/haml/lib/haml/engine.rb +20 -30
  50. data/vendor/plugins/haml/lib/haml/error.rb +4 -5
  51. data/vendor/plugins/haml/lib/haml/exec.rb +4 -2
  52. data/vendor/plugins/haml/lib/haml/filters.rb +30 -15
  53. data/vendor/plugins/haml/lib/haml/helpers.rb +47 -28
  54. data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb +74 -25
  55. data/vendor/plugins/haml/lib/haml/precompiler.rb +92 -51
  56. data/vendor/plugins/haml/lib/haml/template.rb +11 -3
  57. data/vendor/plugins/haml/lib/haml/template/patch.rb +1 -1
  58. data/vendor/plugins/haml/lib/sass.rb +26 -3
  59. data/vendor/plugins/haml/lib/sass/constant.rb +26 -57
  60. data/vendor/plugins/haml/lib/sass/constant/literal.rb +1 -0
  61. data/vendor/plugins/haml/lib/sass/constant/nil.rb +9 -0
  62. data/vendor/plugins/haml/lib/sass/css.rb +17 -2
  63. data/vendor/plugins/haml/lib/sass/engine.rb +11 -5
  64. data/vendor/plugins/haml/test/haml/engine_test.rb +57 -39
  65. data/vendor/plugins/haml/test/haml/helper_test.rb +20 -4
  66. data/vendor/plugins/haml/test/haml/html2haml_test.rb +1 -3
  67. data/vendor/plugins/haml/test/haml/results/content_for_layout.xhtml +1 -2
  68. data/vendor/plugins/haml/test/haml/results/eval_suppressed.xhtml +2 -4
  69. data/vendor/plugins/haml/test/haml/results/filters.xhtml +12 -8
  70. data/vendor/plugins/haml/test/haml/results/helpers.xhtml +2 -5
  71. data/vendor/plugins/haml/test/haml/results/just_stuff.xhtml +1 -3
  72. data/vendor/plugins/haml/test/haml/results/nuke_inner_whitespace.xhtml +40 -0
  73. data/vendor/plugins/haml/test/haml/results/nuke_outer_whitespace.xhtml +148 -0
  74. data/vendor/plugins/haml/test/haml/results/original_engine.xhtml +2 -4
  75. data/vendor/plugins/haml/test/haml/results/tag_parsing.xhtml +1 -6
  76. data/vendor/plugins/haml/test/haml/results/very_basic.xhtml +2 -4
  77. data/vendor/plugins/haml/test/haml/results/whitespace_handling.xhtml +13 -21
  78. data/vendor/plugins/haml/test/haml/template_test.rb +31 -48
  79. data/vendor/plugins/haml/test/haml/templates/filters.haml +13 -0
  80. data/vendor/plugins/haml/test/haml/templates/helpers.haml +1 -1
  81. data/vendor/plugins/haml/test/haml/templates/just_stuff.haml +0 -1
  82. data/vendor/plugins/haml/test/haml/templates/nuke_inner_whitespace.haml +32 -0
  83. data/vendor/plugins/haml/test/haml/templates/nuke_outer_whitespace.haml +144 -0
  84. data/vendor/plugins/haml/test/haml/templates/partials.haml +1 -1
  85. data/vendor/plugins/haml/test/haml/templates/tag_parsing.haml +0 -3
  86. data/vendor/plugins/haml/test/haml/templates/whitespace_handling.haml +10 -10
  87. data/vendor/plugins/haml/test/sass/engine_test.rb +11 -5
  88. data/vendor/plugins/haml/test/sass/plugin_test.rb +2 -6
  89. data/vendor/plugins/haml/test/sass/results/constants.css +2 -0
  90. data/vendor/plugins/haml/test/sass/templates/constants.sass +3 -0
  91. data/vendor/plugins/haml/test/{haml/test_helper.rb → test_helper.rb} +4 -3
  92. metadata +21 -11
  93. data/vendor/plugins/haml/TODO +0 -9
  94. data/vendor/plugins/haml/extra/haml-mode.el +0 -328
  95. data/vendor/plugins/haml/extra/sass-mode.el +0 -88
  96. data/vendor/plugins/haml/test/profile.rb +0 -65
@@ -45,11 +45,11 @@ module Haml
45
45
 
46
46
  # Creates a new instace of Haml::Engine that will compile the given
47
47
  # template string when <tt>render</tt> is called.
48
- # See README.rdoc for available options.
48
+ # See the Haml module documentation for available options.
49
49
  #
50
50
  #--
51
51
  # When adding options, remember to add information about them
52
- # to README.rdoc!
52
+ # to lib/haml.rb!
53
53
  #++
54
54
  #
55
55
  def initialize(template, options = {})
@@ -61,53 +61,44 @@ module Haml
61
61
  :autoclose => %w[meta img link br hr input area param col base],
62
62
  :preserve => %w[textarea pre],
63
63
 
64
- :filters => {
65
- 'sass' => Haml::Filters::Sass,
66
- 'plain' => Haml::Filters::Plain,
67
- 'javascript' => Haml::Filters::Javascript,
68
- 'preserve' => Haml::Filters::Preserve,
69
- 'redcloth' => Haml::Filters::RedCloth,
70
- 'textile' => Haml::Filters::Textile,
71
- 'markdown' => Haml::Filters::Markdown },
72
64
  :filename => '(haml)',
73
65
  :line => 1,
74
66
  :ugly => false,
75
67
  :format => :xhtml,
76
68
  :escape_html => false
77
69
  }
78
- @options[:filters].merge! options.delete(:filters) if options[:filters]
79
70
  @options.merge! options
80
71
 
81
72
  unless [:xhtml, :html4, :html5].include?(@options[:format])
82
73
  raise Haml::Error, "Invalid format #{@options[:format].inspect}"
83
74
  end
84
75
 
85
- unless @options[:suppress_eval]
86
- @options[:filters].merge!({
87
- 'erb' => Haml::Filters::ERB,
88
- 'ruby' => Haml::Filters::Ruby
89
- })
90
- end
91
-
92
- if @options[:locals]
93
- warn <<END
94
- DEPRECATION WARNING:
95
- The Haml :locals option is deprecated and will be removed in version 2.0.
96
- Use the locals option for Haml::Engine#render instead.
97
- END
98
- end
99
-
100
- @template = template.rstrip #String
76
+ @template = template.rstrip + "\n-#\n-#"
101
77
  @to_close_stack = []
102
78
  @output_tabs = 0
103
79
  @template_tabs = 0
104
80
  @index = 0
105
81
  @flat_spaces = -1
106
82
  @newlines = 0
83
+ @precompiled = ''
84
+ @merged_text = ''
85
+ @tab_change = 0
86
+
87
+ if @template =~ /\A(\s*\n)*[ \t]+\S/
88
+ raise SyntaxError.new("Indenting at the beginning of the document is illegal.", ($1 || "").count("\n"))
89
+ end
90
+
91
+ if @options[:filters]
92
+ warn <<END
93
+ DEPRECATION WARNING:
94
+ The Haml :filters option is deprecated and will be removed in version 2.1.
95
+ Filters are now automatically registered.
96
+ END
97
+ end
107
98
 
108
99
  precompile
109
- rescue Haml::Error
110
- $!.backtrace.unshift "#{@options[:filename]}:#{@index + $!.line_offset + @options[:line] - 1}" if @index
100
+ rescue Haml::Error => e
101
+ e.backtrace.unshift "#{@options[:filename]}:#{(e.line ? e.line + 1 : @index) + @options[:line] - 1}" if @index
111
102
  raise
112
103
  end
113
104
 
@@ -147,7 +138,6 @@ END
147
138
  # but if you're relying on local variables defined in the context of scope,
148
139
  # they won't work.
149
140
  def render(scope = Object.new, locals = {}, &block)
150
- locals = (@options[:locals] || {}).merge(locals)
151
141
  buffer = Haml::Buffer.new(scope.instance_variable_get('@haml_buffer'), options_for_buffer)
152
142
 
153
143
  if scope.is_a?(Binding) || scope.is_a?(Proc)
@@ -5,13 +5,12 @@ module Haml
5
5
 
6
6
  # By default, an error is taken to refer to the line of the template
7
7
  # that was being processed when the exception was raised.
8
- # However, if line_offset is non-zero, it's added to that line number
9
- # to get the line to report for the error.
10
- attr_reader :line_offset
8
+ # However, if line is non-nil, it + 1 is used instead.
9
+ attr_reader :line
11
10
 
12
- def initialize(message = nil, line_offset = 0)
11
+ def initialize(message = nil, line = nil)
13
12
  super(message)
14
- @line_offset = line_offset
13
+ @line = line
15
14
  end
16
15
  # :startdoc:
17
16
  end
@@ -1,5 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../haml'
2
2
  require 'optparse'
3
+ require 'fileutils'
3
4
 
4
5
  module Haml
5
6
  # This module contains code for working with the
@@ -128,8 +129,9 @@ END
128
129
  dir = File.join(dir, 'haml')
129
130
 
130
131
  if File.exists?(dir)
131
- puts "Directory #{dir} already exists."
132
- exit
132
+ print "Directory #{dir} already exists, overwrite [y/N]? "
133
+ exit if gets !~ /y/i
134
+ FileUtils.rm_rf(dir)
133
135
  end
134
136
 
135
137
  begin
@@ -6,6 +6,11 @@ module Haml
6
6
  # as well as the base module,
7
7
  # Haml::Filters::Base.
8
8
  module Filters
9
+ # Returns a hash of defined filters.
10
+ def self.defined
11
+ @defined ||= {}
12
+ end
13
+
9
14
  # The base module for Haml filters.
10
15
  # User-defined filters should be modules including this module.
11
16
  #
@@ -28,6 +33,7 @@ module Haml
28
33
  #
29
34
  module Base
30
35
  def self.included(base) # :nodoc:
36
+ Filters.defined[base.name.split("::").last.downcase] = base
31
37
  base.extend(base)
32
38
  end
33
39
 
@@ -64,11 +70,13 @@ module Haml
64
70
  if contains_interpolation?(text)
65
71
  return if options[:suppress_eval]
66
72
 
67
- push_script("#{filter.inspect}.render(#{unescape_interpolation(text)})", false)
73
+ push_script(<<RUBY, false)
74
+ find_and_preserve(#{filter.inspect}.render(#{unescape_interpolation(text)}))
75
+ RUBY
68
76
  return
69
77
  end
70
78
 
71
- rendered = filter.render(text)
79
+ rendered = Haml::Helpers::find_and_preserve(filter.render(text), precompiler.options[:preserve])
72
80
 
73
81
  if !options[:ugly]
74
82
  push_text(rendered.rstrip.gsub("\n", "\n#{' ' * @output_tabs}"))
@@ -156,11 +164,28 @@ END
156
164
  end
157
165
  end
158
166
 
167
+ module Cdata
168
+ include Base
169
+
170
+ def render(text)
171
+ "<![CDATA[#{("\n" + text).rstrip.gsub("\n", "\n ")}\n]]>"
172
+ end
173
+ end
174
+
175
+ module Escaped
176
+ include Base
177
+
178
+ def render(text)
179
+ Haml::Helpers.html_escape text
180
+ end
181
+ end
182
+
159
183
  module Ruby
160
184
  include Base
161
185
  lazy_require 'stringio'
162
186
 
163
187
  def compile(precompiler, text)
188
+ return if precompiler.options[:suppress_eval]
164
189
  precompiler.instance_eval do
165
190
  push_silent <<-END.gsub("\n", ';')
166
191
  _haml_old_stdout = $stdout
@@ -176,19 +201,8 @@ END
176
201
  module Preserve
177
202
  include Base
178
203
 
179
- def compile(precompiler, text)
180
- text = Haml::Helpers.preserve(text) + "\n"
181
-
182
- precompiler.instance_eval do
183
- if contains_interpolation?(text)
184
- return if options[:suppress_eval]
185
-
186
- push_silent("_hamlout.buffer << #{unescape_interpolation(text)};")
187
- return
188
- end
189
-
190
- concat_merged_text(text)
191
- end
204
+ def render(text)
205
+ Haml::Helpers.preserve text
192
206
  end
193
207
  end
194
208
 
@@ -206,6 +220,7 @@ END
206
220
  lazy_require 'erb'
207
221
 
208
222
  def compile(precompiler, text)
223
+ return if precompiler.options[:suppress_eval]
209
224
  src = ::ERB.new(text).src.sub(/^_erbout = '';/, "").gsub("\n", ';')
210
225
  precompiler.send(:push_silent, src)
211
226
  end
@@ -60,16 +60,18 @@ module Haml
60
60
  end
61
61
 
62
62
  # call-seq:
63
- # find_and_preserve(input)
63
+ # find_and_preserve(input, tags = haml_buffer.options[:preserve])
64
64
  # find_and_preserve {...}
65
65
  #
66
- # Isolates the whitespace-sensitive tags in the string and uses preserve
67
- # to convert any endlines inside them into HTML entities for endlines.
68
- def find_and_preserve(input = '', &block)
66
+ # Uses preserve to convert any newlines inside whitespace-sensitive tags
67
+ # into the HTML entities for endlines.
68
+ # @tags@ is an array of tags to preserve.
69
+ # It defaults to the value of the <tt>:preserve</tt> option.
70
+ def find_and_preserve(input = '', tags = haml_buffer.options[:preserve], &block)
69
71
  return find_and_preserve(capture_haml(&block)) if block
70
72
 
71
73
  input = input.to_s
72
- input.gsub(/<(textarea|code|pre)([^>]*)>(.*?)(<\/\1>)/im) do
74
+ input.gsub(/<(#{tags.map(&Regexp.method(:escape)).join('|')})([^>]*)>(.*?)(<\/\1>)/im) do
73
75
  "<#{$1}#{$2}>#{preserve($3)}</#{$1}>"
74
76
  end
75
77
  end
@@ -84,7 +86,7 @@ module Haml
84
86
  def preserve(input = '', &block)
85
87
  return preserve(capture_haml(&block)) if block
86
88
 
87
- input.gsub(/\n/, '&#x000A;').gsub(/\r/, '')
89
+ input.chomp("\n").gsub(/\n/, '&#x000A;').gsub(/\r/, '')
88
90
  end
89
91
 
90
92
  alias_method :flatten, :preserve
@@ -263,8 +265,8 @@ module Haml
263
265
 
264
266
  #
265
267
  # call-seq:
266
- # haml_tag(name, attributes = {}) {...}
267
- # haml_tag(name, text, attributes = {}) {...}
268
+ # haml_tag(name, *flags, attributes = {}) {...}
269
+ # haml_tag(name, text, *flags, attributes = {}) {...}
268
270
  #
269
271
  # Creates an HTML tag with the given name and optionally text and attributes.
270
272
  # Can take a block that will be executed
@@ -272,6 +274,11 @@ module Haml
272
274
  # If the block is a Haml block or outputs text using puts,
273
275
  # the text will be properly indented.
274
276
  #
277
+ # <tt>flags</tt> is a list of symbol flags
278
+ # like those that can be put at the end of a Haml tag
279
+ # (<tt>:/</tt>, <tt>:<</tt>, and <tt>:></tt>).
280
+ # Currently, only <tt>:/</tt> and <tt>:<</tt> are supported.
281
+ #
275
282
  # For example,
276
283
  #
277
284
  # haml_tag :table do
@@ -302,34 +309,46 @@ module Haml
302
309
  # </tr>
303
310
  # </table>
304
311
  #
305
- def haml_tag(name, attributes = {}, alt_atts = {}, &block)
312
+ def haml_tag(name, *rest, &block)
306
313
  name = name.to_s
314
+ text = rest.shift if rest.first.is_a? String
315
+ flags = []
316
+ flags << rest.shift while rest.first.is_a? Symbol
317
+ attributes = Haml::Precompiler.build_attributes(haml_buffer.html?,
318
+ haml_buffer.options[:attr_wrapper],
319
+ rest.shift || {})
320
+
321
+ if text.nil? && block.nil? && (haml_buffer.options[:autoclose].include?(name) || flags.include?(:/))
322
+ puts "<#{name}#{attributes} />"
323
+ return nil
324
+ end
307
325
 
308
- text = nil
309
- if attributes.is_a? String
310
- text = attributes
311
- attributes = alt_atts
326
+ if flags.include?(:/)
327
+ raise Error.new("Self-closing tags can't have content.") if text
328
+ raise Error.new("Illegal nesting: nesting within a self-closing tag is illegal.") if block
312
329
  end
313
330
 
314
- attributes = Haml::Precompiler.build_attributes(
315
- haml_buffer.html?, haml_buffer.options[:attr_wrapper], attributes)
331
+ tag = "<#{name}#{attributes}>"
332
+ if block.nil?
333
+ tag << text.to_s << "</#{name}>"
334
+ puts tag
335
+ return
336
+ end
316
337
 
317
- if text.nil? && block.nil? && haml_buffer.options[:autoclose].include?(name)
318
- puts "<#{name}#{attributes} />"
319
- return nil
338
+ if text
339
+ raise Error.new("Illegal nesting: content can't be both given to haml_tag :#{name} and nested within it.")
320
340
  end
321
341
 
322
- puts "<#{name}#{attributes}>"
323
- unless text && text.empty?
324
- tab_up
325
- # Print out either the text (using push_text) or call the block and add an endline
326
- if text
327
- puts(text)
328
- elsif block
329
- block.call
330
- end
331
- tab_down
342
+ if flags.include?(:<)
343
+ tag << capture_haml(&block).strip << "</#{name}>"
344
+ puts tag
345
+ return
332
346
  end
347
+
348
+ puts tag
349
+ tab_up
350
+ block.call
351
+ tab_down
333
352
  puts "</#{name}>"
334
353
  nil
335
354
  end
@@ -7,44 +7,93 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
7
7
  end
8
8
  alias_method :render_without_haml, :render
9
9
  alias_method :render, :render_with_haml
10
+
11
+ # Rails >2.1
12
+ if instance_methods.include?('output_buffer')
13
+ def output_buffer_with_haml
14
+ return haml_buffer.buffer if is_haml?
15
+ output_buffer_without_haml
16
+ end
17
+ alias_method :output_buffer_without_haml, :output_buffer
18
+ alias_method :output_buffer, :output_buffer_with_haml
19
+
20
+ def set_output_buffer_with_haml(new)
21
+ if is_haml?
22
+ haml_buffer.buffer = new
23
+ else
24
+ set_output_buffer_without_haml new
25
+ end
26
+ end
27
+ alias_method :set_output_buffer_without_haml, :output_buffer=
28
+ alias_method :output_buffer=, :set_output_buffer_with_haml
29
+ end
10
30
  end
11
31
 
12
32
  # This overrides various helpers in ActionView
13
33
  # to make them work more effectively with Haml.
14
34
  module Helpers
15
35
  # :stopdoc:
16
- module CaptureHelper
17
- def capture_with_haml(*args, &block)
18
- if is_haml?
19
- capture_haml(*args, &block)
20
- else
21
- capture_without_haml(*args, &block)
36
+ # In Rails <=2.1, we've got to override considerable capturing infrastructure.
37
+ # In Rails >2.1, we can make do with only overriding #capture
38
+ # (which no longer behaves differently in helper contexts).
39
+ unless ActionView::Base.instance_methods.include?('output_buffer')
40
+ module CaptureHelper
41
+ def capture_with_haml(*args, &block)
42
+ # Rails' #capture helper will just return the value of the block
43
+ # if it's not actually in the template context,
44
+ # as detected by the existance of an _erbout variable.
45
+ # We've got to do the same thing for compatibility.
46
+ block_is_haml =
47
+ begin
48
+ eval('_hamlout', block)
49
+ true
50
+ rescue
51
+ false
52
+ end
53
+
54
+ if block_is_haml && is_haml?
55
+ capture_haml(*args, &block)
56
+ else
57
+ capture_without_haml(*args, &block)
58
+ end
22
59
  end
23
- end
24
- alias_method :capture_without_haml, :capture
25
- alias_method :capture, :capture_with_haml
60
+ alias_method :capture_without_haml, :capture
61
+ alias_method :capture, :capture_with_haml
26
62
 
27
- def capture_erb_with_buffer_with_haml(*args, &block)
28
- if is_haml?
29
- capture_haml_with_buffer(*args, &block)
30
- else
31
- capture_erb_with_buffer_without_haml(*args, &block)
63
+ def capture_erb_with_buffer_with_haml(*args, &block)
64
+ if is_haml?
65
+ capture_haml_with_buffer(*args, &block)
66
+ else
67
+ capture_erb_with_buffer_without_haml(*args, &block)
68
+ end
32
69
  end
70
+ alias_method :capture_erb_with_buffer_without_haml, :capture_erb_with_buffer
71
+ alias_method :capture_erb_with_buffer, :capture_erb_with_buffer_with_haml
33
72
  end
34
- alias_method :capture_erb_with_buffer_without_haml, :capture_erb_with_buffer
35
- alias_method :capture_erb_with_buffer, :capture_erb_with_buffer_with_haml
36
- end
37
73
 
38
- module TextHelper
39
- def concat_with_haml(string, binding = nil)
40
- if is_haml?
41
- haml_buffer.buffer.concat(string)
42
- else
43
- concat_without_haml(string, binding)
74
+ module TextHelper
75
+ def concat_with_haml(string, binding = nil)
76
+ if is_haml?
77
+ haml_buffer.buffer.concat(string)
78
+ else
79
+ concat_without_haml(string, binding)
80
+ end
81
+ end
82
+ alias_method :concat_without_haml, :concat
83
+ alias_method :concat, :concat_with_haml
84
+ end
85
+ else
86
+ module CaptureHelper
87
+ def capture_with_haml(*args, &block)
88
+ if is_haml?
89
+ capture_haml(*args, &block)
90
+ else
91
+ capture_without_haml(*args, &block)
92
+ end
44
93
  end
94
+ alias_method :capture_without_haml, :capture
95
+ alias_method :capture, :capture_with_haml
45
96
  end
46
- alias_method :concat_without_haml, :concat
47
- alias_method :concat, :concat_with_haml
48
97
  end
49
98
 
50
99
  module TagHelper