Sha256: 86c67f3b055117317ad0da36653068ba993c63b99d2ade38ed38f3759474c08a

Contents?: true

Size: 877 Bytes

Versions: 1

Compression:

Stored size: 877 Bytes

Contents

require 'appraisal'
require 'baldwin'

include Rake::DSL

namespace :baldwin do

  desc "Set up current environment variables"
  task :env do
    require 'rails/version'
    ENV[ 'BALDWIN_RAILS_NAME' ] = "rails-#{Rails::VERSION::STRING}"
    ENV[ 'BALDWIN_RAILS_PATH' ] = "spec/rails/#{ENV[ 'BALDWIN_RAILS_NAME' ]}"
  end

  desc "Remove all test rails apps"
  task :clean => [ :env ] do
    Dir[ 'spec/rails/rails-*' ].each do |app|
      FileUtils.rm_rf app
    end
  end

  desc "Create a test rails app if necessary"
  task :rails => [ :env ] do
    if File.exist? ENV[ 'BALDWIN_RAILS_PATH' ]
      puts "Using existing #{ENV[ 'BALDWIN_RAILS_NAME' ]} app"
    else
      sh "bundle exec rails new #{ENV[ 'BALDWIN_RAILS_PATH' ]} -m spec/support/rails_template.rb"
    end
  end

  desc "Install testing awesomeness"
  task :install do
    Baldwin::Installer.start
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
baldwin-0.0.2 lib/baldwin/tasks.rb