Sha256: b5c33a293131bd65926a03e89a6714fe9f6b1adf7cdcf8e66c0bb2d10ec186db

Contents?: true

Size: 1.08 KB

Versions: 25

Compression:

Stored size: 1.08 KB

Contents

require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

task :default => :spec

namespace :test do
  desc "Creates a dummy Rails app for testing"
  task :dummy_rails do
    require 'rails'

    dummy_path = File.expand_path("spec/dummy", __dir__)
    system("rm -rf #{dummy_path}") if File.directory?(dummy_path)

    rails_version = Rails::VERSION::STRING
    rails_new_command = "rails _#{rails_version}_ new #{dummy_path} --skip-bundle --skip-git --skip-keeps --skip-action-mailbox --skip-action-mailer --skip-action-text --skip-active-record --skip-active-storage --skip-action-cable --skip-puma --skip-bootsnap --skip-spring --skip-listen --skip-javascript --skip-turbolinks --skip-test --skip-system-test --quiet"
    system(rails_new_command)

    # remove the asset pipeline initializer file
    puts 'Removing assets initializer...'
    assets_file_path = File.expand_path("spec/dummy/config/initializers/assets.rb")
    File.delete(assets_file_path) if File.exist?(assets_file_path)
    puts 'Done.'

    puts "\nCreated dummy Rails app in spec/dummy"
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
builder_apm-0.2.4 Rakefile
builder_apm-0.2.3 Rakefile
builder_apm-0.2.2 Rakefile
builder_apm-0.2.1 Rakefile
builder_apm-0.2.0 Rakefile