Re: import you mother f*!*er

John Evans
Tue, 16 Aug 2005 12:01:09 -0000

On Aug 16, 2005, at 2:15 PM, Andrew Stuart wrote:

> I use Jim Willsher''s bulk rename utility under windows to rename
> thousands
> of files and strip out stuff like spaces from filenames.
>
> http://www.pcworld.com/downloads/file_description/0,fid,22983,00.asp
>
> AS
>
>
> ----- Original Message -----
> From: "Aaron Ransley"
<jomdom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org>
> Sent: Tuesday, August 16, 2005 2:09 PM
> Subject: Re: [Rails] import you mother f*!*er
>
>
> Have you considered doing a UNIX kind of replace on the filenames?
> Replace all + in the .textile files with spaces?
>
> Just throwing it out there.

Of course I have, but then it fails to import anything and just
ignores everything after a filename with a character it doesn''t like,
spaces being one of them. This kinda renders the above useless too.

I found a solution though.

In file_controller.rb, look for the lines regarding the importer
adding entries to the wiki.

and just modify page_name in each entry to read CGI.unescape(page_name)

so for example

wiki.write_page(@web.address, CGI.unescape(page_name), page_content,
Time.now, @author)

Then it works fine, or as close to it as possible

But the importer is not only broken but very temperamental, for
example downloading a zip of the textile, unzipping and re-zipping on
a mac causes it to not work, seems it has issues with thing
like .DS_STORE or whatever, and a few other issues I cant even debug
as the amount of information regarding the import isn''t exactly
there. But then its off for a reason right. Also knowing Ruby would
help :)