public
Fork of bmizerany/sinatra
Description: Classy web-development dressed in a DSL
Homepage: http://sinatrarb.com
Clone URL: git://github.com/JackDanger/sinatra.git
Search Repo:
Don't automagically load erubis over erb
gmalamid (author)
Tue Apr 22 08:48:11 -0700 2008
commit  0330c15285065899e9c39c582a1261b92cb1c29b
tree    e231b7c33b53826c7b2b14e379d5508d9caecd85
parent  5f561ed51542624280930d45c44b12f76d847e7b
...
579
580
581
 
 
 
 
 
 
 
 
 
 
 
 
582
583
584
585
586
587
588
589
590
591
 
592
593
594
595
596
597
598
 
599
600
601
...
781
782
783
 
784
785
786
...
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
 
 
 
 
 
 
 
597
598
599
600
601
602
603
 
604
605
606
607
...
787
788
789
790
791
792
793
0
@@ -579,23 +579,29 @@
0
     
0
   end
0
 
0
+ module Erubis
0
+ def erb(content, options={})
0
+ render(:erb, content, options)
0
+ end
0
+
0
+ private
0
+
0
+ def render_erb(content, options={})
0
+ ::Erubis::Eruby.new(content).result(binding)
0
+ end
0
+ end
0
+
0
   module Erb
0
     
0
     def erb(content, options={})
0
- begin
0
- require 'erubis'
0
- @@erb_class = Erubis::Eruby
0
- rescue LoadError
0
- require 'erb'
0
- @@erb_class = ::ERB
0
- end
0
+ require 'erb'
0
       render(:erb, content, options)
0
     end
0
     
0
     private
0
     
0
       def render_erb(content, options = {})
0
- @@erb_class.new(content).result(binding)
0
+ ::ERB.new(content).result(binding)
0
       end
0
       
0
   end
0
@@ -781,6 +787,7 @@
0
     include Streaming
0
     include RenderingHelpers
0
     include Erb
0
+ include Erubis if defined?(::Erubis::Eruby)
0
     include Haml
0
     include Builder
0
     include Sass

Comments

    No one has commented yet.