Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: gh-pages
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (21 sloc) 0.537 kB
(2..8).each do |assn_number|
Dir.glob("#{assn_number}/*.html") do |fname|
matched = /(\w)(\d+)\.html/.match fname
page_type = matched[1]
page_number = matched[2].to_i
str = ''
File.open(fname, "r") do |f|
str = <<-END
---
layout: assn
assn_number: #{assn_number}
page_type: #{page_type}
page_number: #{page_number}
page_number_zero: #{page_number-1}
---
END
str << f.read
end
File.open("2012-01-01-a#{assn_number}#{page_type}#{page_number}.html", "w+") {|f_new| f_new.puts str }
end
end
Jump to Line
Something went wrong with that request. Please try again.