@classmethod
def replace_file(cls, replacer, input_filename, output_filename):
    """Performs the variable substitution via the replacer on the contents
        of the file pointed by input_filename and writes the result to a
        new file named after output_filename

        :param replacer: the Replacer instance that performs the variable
         substitution
        :param input_filename: the name of the file to read the contents from
        :param output_filename: the name of the file to write the replaced
        contents to
        """
    with open(input_filename, 'r') as input_file:
        with open(output_filename, 'w') as output_file:
            print('Creating {0}'.format(output_filename))
            for line in input_file:
                output_file.write(replacer.do_variable_substitution(line))
