I find this hard to read, how about:

    Puppet::FileSystem::File.new(subfile ? ::File.join(basedir, subfile) : basedir)