public
Description: Merb More: The Full Stack. Take what you need; leave what you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-more.git
Fixes Haml to support the new API.
wycats (author)
Wed Jun 18 16:09:54 -0700 2008
commit  5b553867bde7753b0c4da77f50d79eef30fa924c
tree    9f7045096ebf7b17e42a1171294837eff8b79ba1
parent  0d7493a64a21412eb466f67b646dfaa8fd371e44
...
9
10
11
12
13
14
 
 
 
15
16
17
18
 
19
20
21
...
9
10
11
 
 
 
12
13
14
15
16
17
 
18
19
20
21
0
@@ -9,13 +9,13 @@ module Merb::Template
0
     # name<~to_s>:: The name of the template method.
0
     # mod<Class, Module>::
0
     # The class or module wherein this method should be defined.
0
- def self.compile_template(path, name, mod)
0
- path = File.expand_path(path)
0
- config = (Merb::Config[:haml] || {}).inject({}) do |c, (k, v)|
0
+ def self.compile_template(io, name, mod)
0
+ path = File.expand_path(io.path)
0
+ config = (Merb::Plugins.config[:haml] || {}).inject({}) do |c, (k, v)|
0
         c[k.to_sym] = v
0
         c
0
       end.merge :filename => path
0
- template = ::Haml::Engine.new(File.read(path), config)
0
+ template = ::Haml::Engine.new(io.read, config)
0
       template.def_method(mod, name)
0
       name
0
     end
...
11
12
13
14
 
15
16
17
...
11
12
13
 
14
15
16
17
0
@@ -11,7 +11,7 @@ describe "HAML" do
0
     c.body.should == ::Haml::Engine.new("#foo\n %p Partial").render
0
   end
0
 
0
- it "should use the haml configuration in Merb::Config" do
0
+ it "should use the haml configuration in Merb::Plugins.config" do
0
     c = dispatch_to(HamlConfig, :index)
0
     c.body.should == ::Haml::Engine.new("#foo\n %foo", :autoclose => ["foo"]).render
0
   end

Comments

    No one has commented yet.