public
Fork of rubys/mars
Description: Yet Another Planet Refactoring
Homepage: http://intertwingly.net/blog/2007/12/19/Yet-Another-Planet-Refactoring
Clone URL: git://github.com/technomancy/mars.git
beginnings of ERB template support
technomancy (author)
Wed Jun 25 17:18:00 -0700 2008
commit  092defd579f5fecd92889dbb05c43a0ed6bb3ebc
tree    b1903929d08c296bb4162f042f2c675ee1dd62bd
parent  7eaf87996f2bac47b78322f50fb137d94eb94ac2
...
1
2
 
 
3
4
5
...
93
94
95
96
97
98
 
 
 
99
100
101
102
 
 
 
 
 
 
 
 
103
104
105
...
1
 
2
3
4
5
6
...
94
95
96
 
 
 
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
0
@@ -1,5 +1,6 @@
0
 require 'planet/config'
0
-require 'planet/style'
0
+
0
+require 'planet/erb'
0
 require 'planet/xmlparser'
0
 require 'fileutils'
0
 require 'time'
0
@@ -93,13 +94,21 @@ module Planet
0
     config['template_files'].split.each do |template|
0
       next unless template =~ /^ .* \/ (.*) \. (\w+)/x
0
 
0
- if $2 != 'xslt'
0
- Planet.log.warn "#{$2}: not yet supported"
0
- else
0
+ case Regexp.last_match[2]
0
+ when 'xslt'
0
+ require 'planet/style'
0
         File.open(File.join(output_dir,$1),'w') do |file|
0
           Planet.log.info "Processing template #{template}"
0
           file.write Planet::Xslt.process(template, feed)
0
         end
0
+ when 'erb'
0
+ require 'planet/erb'
0
+ File.open(File.join(output_dir,$1),'w') do |file|
0
+ Planet.log.info "Processing template #{template}"
0
+ file.write Planet::ERb.process(template, feed)
0
+ end
0
+ else
0
+ Planet.log.warn "#{$2}: not yet supported"
0
       end
0
     end
0
   end

Comments

    No one has commented yet.