Sha256: 33511ad1cafec2579989c10cc4fa1da43c53a3e15c4888a54bafc390e88f3c24

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 Bytes

Contents

# frozen_string_literal: true

require 'rails/generators'

class TestAppGenerator < Rails::Generators::Base
  source_root File.expand_path('../../../test_app_templates', __dir__)

  def remove_index
    remove_file "public/index.html"
  end

  def run_blacklight_generator
    say_status("warning", "GENERATING BL", :yellow)

    Bundler.with_unbundled_env do
      run "bundle install"
    end
    options = '--devise'
    if ENV['BLACKLIGHT_API_TEST'].present?
      options += ' --skip-assets'
    end

    generate 'blacklight:install', options
  end

  def run_test_support_generator
    say_status("warning", "GENERATING test_support", :yellow)

    generate 'blacklight:test_support'
  end

  def add_local_assets_for_propshaft
    return unless defined?(Propshaft)

    run "yarn add #{Blacklight::Engine.root}"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blacklight-8.0.0.beta4 spec/test_app_templates/lib/generators/test_app_generator.rb
blacklight-8.0.0.beta3 spec/test_app_templates/lib/generators/test_app_generator.rb
blacklight-8.0.0.beta2 spec/test_app_templates/lib/generators/test_app_generator.rb
blacklight-8.0.0.beta1 spec/test_app_templates/lib/generators/test_app_generator.rb