Sha256: d638631e5ba8fc33346af56c82415ff861bce4b3fdcf36099a1d5f62640ffb0c

Contents?: true

Size: 1009 Bytes

Versions: 2

Compression:

Stored size: 1009 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', ">= 0.0.9", :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

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-5.0.0 spec/test_app_templates/lib/generators/test_app_generator.rb
blacklight-5.0.0.pre4 spec/test_app_templates/lib/generators/test_app_generator.rb