public this repo is viewable by everyone
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/nex3/haml.git
Make is_haml? a method of Object.
nex3 (author)
16 days ago
commit  2c32f081cf5392ba0de96634488e555131d017a0
tree    b8a4f591bcefedac20f651fe02620163b95db4c9
parent  64ba951437abecf3666dc7a24a6ca656113e01d0
...
1
2
3
4
5
6
7
8
9
10
...
1
2
3
 
 
 
 
4
5
6
0
@@ -1,10 +1,6 @@
0
 if defined?(ActionView) and not defined?(Merb::Plugins)
0
   module ActionView
0
     class Base # :nodoc:
0
- def is_haml?
0
- false
0
- end
0
-
0
       def render_with_haml(*args, &block)
0
         return non_haml { render_without_haml(*args, &block) } if is_haml?
0
         render_without_haml(*args, &block)
...
16
17
18
 
 
 
 
 
 
 
 
 
 
 
 
...
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
0
@@ -16,3 +16,15 @@ class Hash # :nodoc:
0
     self
0
   end
0
 end
0
+
0
+class Object
0
+ # Haml overrides various ActionView helpers,
0
+ # which call an #is_haml? method
0
+ # to determine whether or not the current context object
0
+ # is a proper Haml context.
0
+ # Because ActionView helpers may be included in non-ActionView::Base classes,
0
+ # it's a good idea to define is_haml? for all objects.
0
+ def is_haml?
0
+ false
0
+ end
0
+end
...
171
172
173
 
 
 
174
175
176
...
171
172
173
174
175
176
177
178
179
0
@@ -171,6 +171,9 @@ class HelperTest < Test::Unit::TestCase
0
   end
0
   
0
   class ActsLikeTag
0
+ # We want to be able to have people include monkeypatched ActionView helpers
0
+ # without redefining is_haml?.
0
+ # This is accomplished via Object#is_haml?, and this is a test for it.
0
     include ActionView::Helpers::TagHelper
0
     def to_s
0
       content_tag :p, 'some tag content'

Comments