2018-11-09 20:58:42 +00:00
|
|
|
require_relative 'coop'
|
2018-11-09 16:02:15 +00:00
|
|
|
require 'erb'
|
|
|
|
|
2018-11-09 20:56:26 +00:00
|
|
|
Coop.all.each do |coop|
|
|
|
|
output_fn = File.join(File.dirname(__FILE__), '..', '_coops', coop.slug + '.md')
|
2018-11-09 16:02:15 +00:00
|
|
|
|
|
|
|
renderer = ERB.new(File.read('coop.erb.md'), nil, '<>')
|
|
|
|
result = renderer.result(coop.erb_binding)
|
|
|
|
File.open(output_fn, 'w') { |file| file.write(result) }
|
|
|
|
end
|