35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/rowr/command_line.rb', line 35
def test(file)
return unless File.exist? File.expand_path(file)
f = File.expand_path(file)
rowr = Rowr::Resurrector.new
rowr.options.source_directory = File.dirname(f)
rowr.prompt_user_for_option 'old_host?'
rowr.prompt_user_for_option 'new_base_path?'
rowr.prompt_user_for_option 'check_external_urls?'
rowr.init_link_processor
rowr.link_processor.containing_file = f
text = File.read(f)
unless text.valid_encoding?
text = text.encode('UTF-16be', :invalid=>:replace, :replace=>' ').encode('UTF-8')
end
text = rowr.clean_no_quotes(text)
rowr.check_urls(text)
end
|