GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Fork of nex3/haml
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/chriseppstein/haml.git
Add "haml_" prefixes to private Helpers methods.
nex3 (author)
Fri Feb 22 18:40:26 -0800 2008
commit  b8e4cb7ae83766bef22802730f761777b1b60b57
tree    bf701c8836ec110b4af41697a19747882e835466
parent  0af2c27953842d0734182820453ec16889b464d4
...
153
154
155
156
 
157
158
159
...
161
162
163
164
 
165
166
167
...
235
236
237
238
 
239
240
241
242
243
 
244
245
246
...
293
294
295
296
 
297
298
299
300
 
301
302
303
...
324
325
326
327
 
328
329
330
331
332
333
334
 
 
335
336
337
...
153
154
155
 
156
157
158
159
...
161
162
163
 
164
165
166
167
...
235
236
237
 
238
239
240
241
242
 
243
244
245
246
...
293
294
295
 
296
297
298
299
 
300
301
302
303
...
324
325
326
 
327
328
329
330
331
332
 
 
333
334
335
336
337
0
@@ -153,7 +153,7 @@ module Haml
0
     # <strong>baz</strong>
0
     #
0
     def tab_up(i = 1)
0
- buffer.tabulation += i
0
+ haml_buffer.tabulation += i
0
     end
0
 
0
     # Increments the number of tabs the buffer automatically adds
0
@@ -161,7 +161,7 @@ module Haml
0
     #
0
     # See tab_up.
0
     def tab_down(i = 1)
0
- buffer.tabulation -= i
0
+ haml_buffer.tabulation -= i
0
     end
0
     
0
     # Surrounds the given block of Haml code with the given characters,
0
@@ -235,12 +235,12 @@ module Haml
0
     # the local variable <tt>foo</tt> would be assigned to "<p>13</p>\n".
0
     #
0
     def capture_haml(*args, &block)
0
- capture_haml_with_buffer(buffer.buffer, *args, &block)
0
+ capture_haml_with_buffer(haml_buffer.buffer, *args, &block)
0
     end
0
 
0
     # Outputs text directly to the Haml buffer, with the proper tabulation
0
     def puts(text = "")
0
- buffer.buffer << (' ' * buffer.tabulation) << text.to_s << "\n"
0
+ haml_buffer.buffer << (' ' * haml_buffer.tabulation) << text.to_s << "\n"
0
       nil
0
     end
0
 
0
@@ -293,11 +293,11 @@ module Haml
0
       end
0
 
0
       if text.nil? && block.nil?
0
- puts "<#{name}#{Haml::Precompiler.build_attributes(buffer.options[:attr_wrapper], attributes)} />"
0
+ puts "<#{name}#{Haml::Precompiler.build_attributes(haml_buffer.options[:attr_wrapper], attributes)} />"
0
         return nil
0
       end
0
 
0
- puts "<#{name}#{Haml::Precompiler.build_attributes(buffer.options[:attr_wrapper], attributes)}>"
0
+ puts "<#{name}#{Haml::Precompiler.build_attributes(haml_buffer.options[:attr_wrapper], attributes)}>"
0
       unless text && text.empty?
0
         tab_up
0
         # Print out either the text (using push_text) or call the block and add an endline
0
@@ -324,14 +324,14 @@ END
0
     private
0
 
0
     # Gets a reference to the current Haml::Buffer object.
0
- def buffer
0
+ def haml_buffer
0
       @haml_stack[-1]
0
     end
0
     
0
     # Gives a proc the same local "_hamlout" and "_erbout" variables
0
     # that the current template has.
0
- def bind_proc(&proc)
0
- _hamlout = buffer
0
+ def haml_bind_proc(&proc)
0
+ _hamlout = haml_buffer
0
       _erbout = _hamlout.buffer
0
       proc { |*args| proc.call(*args) }
0
     end
...
31
32
33
34
 
35
36
37
...
45
46
47
48
 
49
50
51
...
67
68
69
70
 
71
72
73
...
31
32
33
 
34
35
36
37
...
45
46
47
 
48
49
50
51
...
67
68
69
 
70
71
72
73
0
@@ -31,7 +31,7 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
       module TextHelper
0
         def concat_with_haml(string, binding = nil)
0
           if is_haml?
0
- buffer.buffer.concat(string)
0
+ haml_buffer.buffer.concat(string)
0
           else
0
             concat_without_haml(string, binding)
0
           end
0
@@ -45,7 +45,7 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
           if is_haml?
0
             if block_given?
0
               oldproc = proc
0
- proc = bind_proc do |*args|
0
+ proc = haml_bind_proc do |*args|
0
                 concat "\n"
0
                 tab_up
0
                 oldproc.call(*args)
0
@@ -67,7 +67,7 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
         def form_for_with_haml(object_name, *args, &proc)
0
           if block_given? && is_haml?
0
             oldproc = proc
0
- proc = bind_proc do |*args|
0
+ proc = haml_bind_proc do |*args|
0
               tab_up
0
               oldproc.call(*args)
0
               tab_down
...
31
32
33
34
 
35
36
37
 
38
39
40
...
31
32
33
 
34
35
36
 
37
38
39
40
0
@@ -31,10 +31,10 @@ click
0
 = succeed '.' do
0
   %a{:href=>"thing"} here
0
 %p baz
0
-- buffer.tabulation = 10
0
+- haml_buffer.tabulation = 10
0
 %p boom
0
 - concat "foo\n"
0
-- buffer.tabulation = 0
0
+- haml_buffer.tabulation = 0
0
 - def url_for(*stuff); stuff.join(' '); end
0
 -# The form URLs must be empty
0
 -# because of a weird bug that causes url_for to misbehave.

Comments

    No one has commented yet.