require 'rails/generators/named_base'

module Erb # :nodoc:
  module Generators # :nodoc:
    class Base < Rails::Generators::NamedBase #:nodoc:
      protected

      def formats
        format
      end

      def format
        :html
      end

      def handler
        :erb
      end

      def filename_with_extensions(name, format)
        [name, format, handler].compact.join(".")
      end
    end
  end
end

require 'rails/generators/named_base'

module Erb # :nodoc:
  module Generators # :nodoc:
    class Base < Rails::Generators::NamedBase #:nodoc:
      protected

      def formats
        format
      end

      def format
        :html
      end

      def handler
        :erb
      end

      def filename_with_extensions(name, format = self.format)
        [name, format, handler].compact.join(".")
      end
    end
  end
end

Fix for external generators extend Erb::Generators
Fix for external generators extend Erb::Generators

HAML and probably other generators extend this class and invoke
filename_with_extensions with the old signature (without format).
This makes the second argument optional and defaults it to the #format
method which could be overridden as well.

Closes #14132.
