Sha256: 5497a6f6bf2865e7dee947d9ce672de9bc5e720209ce50edb911ac7317fb37a5

Contents?: true

Size: 1.02 KB

Versions: 24

Compression:

Stored size: 1.02 KB

Contents

require 'rails/generators'

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

  def run_curate_generator
    say_status("warning", "GENERATING CURATE", :yellow)

    generate 'curate', '-f --with-doi'

    gsub_file('config/environments/test.rb', /^.*config\.consider_all_requests_local.*$/) do |match|
      match = "  # For end to end specs, I want the exception handler capturing things; Not raising exceptions.\n  config.consider_all_requests_local = ENV['LOCAL'] || false"
    end

    inject_into_file 'config/initializers/curate_config.rb', after: "Curate.configure do |config|\n" do
      <<-EOV
        config.application_root_url = 'http://localhost'
        config.default_antivirus_instance = lambda {|file_path|
          AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE
        }
        config.characterization_runner = lambda {|file_path|
          Curate::Engine.root.join('spec/support/files/default_fits_output.xml').read
        }
      EOV
    end
  end
end

Version data entries

24 entries across 13 versions & 1 rubygems

Version Path
curate-0.6.6 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.6.6 spec/internal/lib/generators/test_app_generator.rb
curate-0.6.5 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.6.4 spec/internal/lib/generators/test_app_generator.rb
curate-0.6.4 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.6.3 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.6.3 spec/internal/lib/generators/test_app_generator.rb
curate-0.6.1 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.6.1 spec/internal/lib/generators/test_app_generator.rb
curate-0.6.0 spec/internal/lib/generators/test_app_generator.rb
curate-0.6.0 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.5.6 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.5.6 spec/internal/lib/generators/test_app_generator.rb
curate-0.5.5 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.5.5 spec/internal/lib/generators/test_app_generator.rb
curate-0.5.4 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.5.4 spec/internal/lib/generators/test_app_generator.rb
curate-0.5.2 spec/internal/lib/generators/test_app_generator.rb
curate-0.5.2 spec/skeleton/lib/generators/test_app_generator.rb
curate-0.5.1 spec/skeleton/lib/generators/test_app_generator.rb