Limit the size of file names created by Ruby
Closed this issue · 4 comments
Long posts that are created without a URL are creating long file names, and Ruby is crashing when it tries to save a file with a too-long name. Let the script limit file names to a certain number of characters (maybe 50?) so it stops crashing.
I have preliminary code written to make this feature happen. File-name length should be a variable set in the configuration file, and I am writing the method in a modular fashion that can do any trimming needed in the app.
Also, I am adding a method to make sure the last character in a URL isn't the underscore (aka "_").
I'm not sure if I fixed the "last underscore" issue, but the file-name limiter is in place.
I did NOT fix the "last underscore" issue. Will open a new issue on that.
I did fix the issue with long filenames. There is now a configuration option for setting the filename to a certain number of maximum characters.