Created
August 4, 2008 14:31
-
-
Save kmarsh/3899 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blob | |
mark :1 | |
data 1 | |
A | |
blob | |
mark :2 | |
data 1 | |
B | |
blob | |
mark :3 | |
data 1 | |
C | |
commit refs/heads/master | |
mark :4 | |
author Kevin Marsh <[email protected]> 1217861480 -0400 | |
committer Kevin Marsh <[email protected]> 1217861480 -0400 | |
data 15 | |
Initial import | |
M 0100644 :1 a | |
M 0100644 :2 b | |
M 0100644 :3 c | |
blob | |
mark :5 | |
data 2 | |
A2 | |
blob | |
mark :6 | |
data 2 | |
B2 | |
blob | |
mark :7 | |
data 2 | |
C2 | |
commit refs/heads/master | |
mark :8 | |
author Kevin Marsh <[email protected]> 1217861491 -0400 | |
committer Kevin Marsh <[email protected]> 1217861491 -0400 | |
data 8 | |
Changes | |
from :4 | |
M 0100644 :5 a | |
M 0100644 :6 b | |
M 0100644 :7 c | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'sqlite3' | |
require 'fileutils' | |
db = SQLite3::Database.new(ARGV[0]) | |
rows = db.execute("select junebug_pages.title, strftime('%s',junebug_page_versions.updated_at), junebug_page_versions.body from junebug_page_versions LEFT JOIN junebug_pages ON junebug_pages.id = junebug_page_versions.page_id") | |
rows.each do |row| | |
dir = "wiki/" . row[0].gsub(/\s/,'_') | |
FileUtils.mkdir_p(dir) | |
File.open("#{dir}/#{row[1]}", "w+") do |f| | |
f.puts row[3] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment