Sha256: 583183f4b4d4eb5a0985c98f16c931debec4ec2d69d93c0e0cab8877c4c775f6

Contents?: true

Size: 1007 Bytes

Versions: 3

Compression:

Stored size: 1007 Bytes

Contents

require 'rails/generators'

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

  def fix_travis_rails_4 
    if ENV['TRAVIS']
      insert_into_file 'app/assets/stylesheets/application.css', :before =>'/*' do      
        "@charset \"UTF-8\";\n"
      end
    end
  end

  def copy_blacklight_test_app_rake_task
    copy_file "lib/tasks/blacklight_test_app.rake"
  end

  def remove_index 
    remove_file "public/index.html"
    remove_file 'app/assets/images/rails.png'
  end

  def run_blacklight_generator
    say_status("warning", "GENERATING BL", :yellow)       
    gem 'blacklight-marc', "~> 5.0", :github => 'projectblacklight/blacklight_marc'

    Bundler.with_clean_env do
      run "bundle install"
    end

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

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

    generate 'blacklight:test_support'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blacklight-5.1.0 spec/test_app_templates/lib/generators/test_app_generator.rb
blacklight-5.0.2 spec/test_app_templates/lib/generators/test_app_generator.rb
blacklight-5.0.1 spec/test_app_templates/lib/generators/test_app_generator.rb