Sha256: c287dcd9bbfd2b3f3c550c1de0e44b8fa2ee70402499c2b3066d5703140385a5

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

require 'rails/generators'

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

  # This is only necessary for Rails 3
  def remove_index
    remove_file "public/index.html"
  end

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

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

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

    generate 'blacklight_range_limit'
  end

  def fixtures
    FileUtils.mkdir_p 'spec/fixtures/solr_documents'
    directory 'solr_documents', 'spec/fixtures/solr_documents'
  end

  def inject_into_catalog_controller
    inject_into_file 'app/controllers/catalog_controller.rb', after: "config.add_facet_field 'example_pivot_field', :label => 'Pivot Field', :pivot => ['format', 'language_facet']" do
      "\n    config.add_facet_field 'pub_date_sort', :label => 'Publication Date Sort', :range => true"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blacklight_range_limit-5.2.0 spec/test_app_templates/lib/generators/test_app_generator.rb
blacklight_range_limit-5.1.0 spec/test_app_templates/lib/generators/test_app_generator.rb
blacklight_range_limit-5.0.4 spec/test_app_templates/lib/generators/test_app_generator.rb
blacklight_range_limit-5.0.3 spec/test_app_templates/lib/generators/test_app_generator.rb