lib/capcode/render/erb.rb in capcode-render-erb-0.1.0 vs lib/capcode/render/erb.rb in capcode-render-erb-0.2.0
- old
+ new
@@ -33,13 +33,14 @@
end
end
# Get Layout
layout = opts.delete(:layout)||:layout
- layout_file = File.join( @erb_path, layout.to_s+".rhtml" )
-
+ layout_file = File.join( @erb_path, layout.to_s )
+ layout_file = layout_file+".rhtml" if File.extname(layout_file) == ""
+
# Get file
- f = f + ".rhtml" if File.extname( f ) != ".rhtml"
+ f = f + ".rhtml" if File.extname( f ) == ""
file = File.join( @erb_path, f )
if( File.exist?( file ) )
if( File.exist?( layout_file ) )
ERB.new(open(layout_file).read).result( get_binding { |*args|
\ No newline at end of file