Sha256: 63e087dc29b240890007ee000d4528160bc1e4e275a69f555a4ed5b4718463d3

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

require 'rails/generators'

class TestAppGenerator < Rails::Generators::Base
  source_root "../../spec/test_app_templates"

  def add_gems
    gem 'blacklight', ">= 5.4.0.rc1", "<6"
    gem "blacklight-gallery", ">= 0.3.0"
    gem "sir_trevor_rails", github: "sul-dlss/sir-trevor-rails"
    gem "jettywrapper"
    Bundler.with_clean_env do
      run "bundle install"
    end
  end

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

    generate 'blacklight:install', '--devise'
  end

  def run_spotlight_migrations
    rake "spotlight:install:migrations"
    rake "db:migrate"
  end

  def add_spotlight_routes_and_assets
    generate 'spotlight:install', '-f --mailer_default_url_host=localhost:3000'
  end

  def install_test_catalog_controller
    copy_file "catalog_controller.rb", "app/controllers/catalog_controller.rb", force: true
  end

  def add_rake_tasks_to_app
    rakefile 'spotlight_test.rake', File.read(find_in_source_paths('spotlight_test.rake'))
  end

  def disable_carrierwave_processing
    copy_file "carrierwave.rb", "config/initializers/carrierwave.rb"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-spotlight-0.4.1 spec/test_app_templates/lib/generators/test_app_generator.rb