Have I Ever Said that I Love Ruby?

In just 34 lines of code, I wrote a script to take all of the files in a particular directory, search for the desired filetype and resize those images to a specific maximum size.

Here's a sample method:
def append_before_extension(filepath, append_string)
ext = File.extname(filepath)
base = File.basename(filepath, ext)
return base + append_string + ext

Why can't Java make file processing so simple? Why can't I just use Ruby all the time?