Sha256: 6364e79bc3838e37e00226ea7815ac9dcc25ce7aa796f784917cf93b53817bbe

Contents?: true

Size: 1.04 KB

Versions: 11

Compression:

Stored size: 1.04 KB

Contents

require 'rails/generators'

class TestAppGenerator < Rails::Generators::Base
  source_root File.expand_path("../../../../spec/test_app_templates", __FILE__)

  def add_gems
    gem 'blacklight-spotlight'
    Bundler.with_clean_env do
      run 'bundle install --quiet'
    end
  end

  def run_blacklight_generator
    say_status('warning', 'GENERATING BL', :yellow)
    generate 'blacklight:install', '--devise --jettywrapper'
  end

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

  def add_spotlight_routes_and_assets
    # spotlight will provide its own catalog controller.. remove blacklight's to
    # avoid getting prompted about file conflicts
    remove_file 'app/controllers/catalog_controller.rb'

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

  def add_catalog_controller
    copy_file 'catalog_controller.rb', 'app/controllers/catalog_controller.rb', force: true
  end

  def configure_gdor
    copy_file 'gdor.yml', 'config/gdor.yml', force: true
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spotlight-dor-resources-0.5.0 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.4.1 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.4.0 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.3.3 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.3.2 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.3.1 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.3.0 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.2.3 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.2.2 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.2.1 spec/test_app_templates/lib/generators/test_app_generator.rb
spotlight-dor-resources-0.2.0 spec/test_app_templates/lib/generators/test_app_generator.rb