Sha256: dda5a5483385715cd43914a4b018c7fc0e11e40670beec2da753489e7d7338ab

Contents?: true

Size: 1.48 KB

Versions: 46

Compression:

Stored size: 1.48 KB

Contents

# -*- encoding : utf-8 -*-
# Copy Blacklight test support material in place


# Need the requires here so we can call the generator from environment.rb
# as suggested above. 
require 'rails/generators'
require 'rails/generators/base'
module Blacklight
  class TestSupport < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)
  desc """ 
Installs a jetty container with a solr installed in it. A solr setup known 
good with default blacklight setup, including solr conf files for out
of the box blacklight. 

Also adds jetty_path key to solr.yml for selected environment, to refer
to this install. 

Requires system('unzip... ') to work, probably won't work on Windows.

"""
    def alternate_controller
      copy_file "alternate_controller.rb", "app/controllers/alternate_controller.rb"

      route("resources :alternate do
                member do
                  get :facet
                end
              end")


    end

    def configure_action_mailer

      if Rails::VERSION::MAJOR == 4
        insert_into_file "config/environments/test.rb", :after => "config.action_mailer.delivery_method = :test\n" do <<-EOF
           config.action_mailer.default_options = {from: 'no-reply@example.org'}
        EOF
        end
      else
        insert_into_file "config/environments/test.rb", :after => "config.action_mailer.delivery_method = :test\n" do <<-EOF
          ActionMailer::Base.default(from: 'no-reply@example.org')
        EOF
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
blacklight-4.9.0 lib/generators/blacklight/test_support_generator.rb
blacklight-4.8.0 lib/generators/blacklight/test_support_generator.rb
blacklight-5.9.1 lib/generators/blacklight/test_support_generator.rb
blacklight-5.9.0 lib/generators/blacklight/test_support_generator.rb
blacklight-5.8.2 lib/generators/blacklight/test_support_generator.rb
blacklight-5.8.1 lib/generators/blacklight/test_support_generator.rb
blacklight-5.8.0 lib/generators/blacklight/test_support_generator.rb
blacklight-5.7.2 lib/generators/blacklight/test_support_generator.rb
blacklight-5.5.4 lib/generators/blacklight/test_support_generator.rb
blacklight-5.7.1 lib/generators/blacklight/test_support_generator.rb
blacklight-5.7.0 lib/generators/blacklight/test_support_generator.rb
blacklight-5.6.0 lib/generators/blacklight/test_support_generator.rb
blacklight-5.5.3 lib/generators/blacklight/test_support_generator.rb
blacklight-5.5.2 lib/generators/blacklight/test_support_generator.rb
blacklight-5.5.1 lib/generators/blacklight/test_support_generator.rb
blacklight-5.5.0 lib/generators/blacklight/test_support_generator.rb
blacklight-5.4.0 lib/generators/blacklight/test_support_generator.rb
blacklight-5.4.0.rc1 lib/generators/blacklight/test_support_generator.rb
blacklight-5.3.0 lib/generators/blacklight/test_support_generator.rb
blacklight-5.0.3 lib/generators/blacklight/test_support_generator.rb