instiki/script/reset_references

28 lines
677 B
Plaintext
Raw Normal View History

2006-04-02 06:55:58 +02:00
#!/usr/bin/env ruby
ENV['RAILS_ENV'] = ARGV.first || 'development'
$stderr.puts "Loading Rails for #{ENV['RAILS_ENV']} environment..."
require File.dirname(__FILE__) + '/../config/environment'
class StubUrlGenerator
def make_link(*args)
'StubLink'
end
end
PageRenderer.setup_url_generator(StubUrlGenerator.new)
WikiReference.delete_all
Web.find_all.each do |web|
web.pages.find(:all, :order => 'name').each do |page|
$stderr.puts "Processing page '#{page.name}'"
begin
2005-09-27 15:46:02 +02:00
PageRenderer.new(page.current_revision).display_content(update_references = true)
rescue => e
puts e
puts e.backtrace
end
end
2006-04-02 06:55:58 +02:00
end