Sha256: b66757fc70e70d9869b8d9093f610bd3c4f4856277e908749164c9d6a6483280

Contents?: true

Size: 1.2 KB

Versions: 15

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

module Hyrax
  # This class was created for use in rake tasks and db/seeds.rb.  It generates
  # repository metadata needed for release testing.  This data can also be helpful
  # for local development testing.
  class TestDataSeeder
    attr_accessor :logger, :allow_seeding_in_production

    def initialize(logger: Logger.new(STDOUT), allow_seeding_in_production: false)
      raise("TestDataSeeder is not for use in production!") if Rails.env.production? && !allow_seeding_in_production
      @logger = logger
      @allow_seeding_in_production = allow_seeding_in_production
    end

    def generate_seed_data
      Hyrax::TestDataSeeders::UserSeeder.generate_seeds(logger: logger, allow_seeding_in_production: allow_seeding_in_production)
      Hyrax::TestDataSeeders::CollectionTypeSeeder.generate_seeds(logger: logger, allow_seeding_in_production: allow_seeding_in_production)
      Hyrax::TestDataSeeders::CollectionSeeder.generate_seeds(logger: logger, allow_seeding_in_production: allow_seeding_in_production)
      # TODO: add work seeder
      # Hyrax::TestDataSeeders::WorkSeeder.generate_seeds(logger: logger, allow_seeding_in_production: allow_seeding_in_production)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/utils/hyrax/test_data_seeder.rb
hyrax-5.0.0 app/utils/hyrax/test_data_seeder.rb
hyrax-5.0.0.rc3 app/utils/hyrax/test_data_seeder.rb
hyrax-5.0.0.rc2 app/utils/hyrax/test_data_seeder.rb
hyrax-5.0.0.rc1 app/utils/hyrax/test_data_seeder.rb
hyrax-3.6.0 app/utils/hyrax/test_data_seeder.rb
hyrax-4.0.0 app/utils/hyrax/test_data_seeder.rb
hyrax-4.0.0.rc3 app/utils/hyrax/test_data_seeder.rb
hyrax-4.0.0.rc2 app/utils/hyrax/test_data_seeder.rb
hyrax-4.0.0.rc1 app/utils/hyrax/test_data_seeder.rb
hyrax-3.5.0 app/utils/hyrax/test_data_seeder.rb
hyrax-4.0.0.beta2 app/utils/hyrax/test_data_seeder.rb
hyrax-3.4.2 app/utils/hyrax/test_data_seeder.rb
hyrax-4.0.0.beta1 app/utils/hyrax/test_data_seeder.rb
hyrax-3.4.1 app/utils/hyrax/test_data_seeder.rb