<commit_before>require 'rails/generators'
require 'rails/generators/migration'

module HasPublishing
  class PublishingGenerator < ::Rails::Generators::Base
    include Rails::Generators::Migration

    def self.source_root
      @source_root ||= File.join(File.dirname(__FILE__), 'templates')
    end

    def self.next_migration_number(dirname)
      if ActiveRecord::Base.timestamped_migrations
        Time.new.utc.strftime("%Y%m%d%H%M%S")
      else
        "%.3d" % (current_migration_number(dirname) + 1)
      end
    end

    def create_migration_file
      set_local_assigns!
      validate_file_name!
      migration_template 'migration.rb', "db/migrate/publishing_fields_for_#{@table_name}.rb"
    end

    def set_local_assigns!
      @table_name = file_name.pluralize
    end
  end
end<commit_msg>Inherit from namedbase, not base<commit_after>require 'rails/generators'
require 'rails/generators/migration'

module HasPublishing
  class PublishingGenerator < ::Rails::Generators::NamedBase
    include Rails::Generators::Migration

    def self.source_root
      @source_root ||= File.join(File.dirname(__FILE__), 'templates')
    end

    def self.next_migration_number(dirname)
      if ActiveRecord::Base.timestamped_migrations
        Time.new.utc.strftime("%Y%m%d%H%M%S")
      else
        "%.3d" % (current_migration_number(dirname) + 1)
      end
    end

    def create_migration_file
      set_local_assigns!
      validate_file_name!
      migration_template 'migration.rb', "db/migrate/publishing_fields_for_#{@table_name}.rb"
    end

    def set_local_assigns!
      @table_name = file_name.pluralize
    end
  end
end
{'fraction_non_alphanumeric': 0.10145808019441069, 'fraction_numerical': 0.002430133657351154, 'mean_word_length': 3.6923076923076925, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3310046', 'n_tokens_mistral': 554, 'n_tokens_neox': 543, 'n_words': 89}