Sha256: 0bd16227985822608a331b78976b27997a863f1f9223f232d106a97cee48228f

Contents?: true

Size: 1.1 KB

Versions: 6

Compression:

Stored size: 1.1 KB

Contents

#!/usr/bin/env rake

require 'bundler/gem_tasks'
require 'appraisal'
require 'rspec/core/rake_task'

namespace :eastwood do

  desc "Set up current environment variables"
  task :env do
    require 'rails/version'
    ENV[ 'EASTWOOD_RAILS_NAME' ] = "rails-#{Rails::VERSION::STRING}"
    ENV[ 'EASTWOOD_RAILS_PATH' ] = "spec/rails/#{ENV[ 'EASTWOOD_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 do
    if File.exist? ENV[ 'EASTWOOD_RAILS_PATH' ]
      puts "Using existing #{ENV[ 'EASTWOOD_RAILS_NAME' ]} app"
    else
      sh "bundle exec rails new #{ENV[ 'EASTWOOD_RAILS_PATH' ]} -m spec/support/rails_template.rb"
    end
  end

end

RSpec::Core::RakeTask.new :spec => [ :'eastwood:env', :'eastwood:rails' ]

desc "Run specs for all supported rails versions"
task :all do
  exec 'rake appraisal spec'
end

desc "Default: Clean, install dependencies, and run specs"
task :default => [ :'eastwood:clean', :'appraisal:install', :all ]

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
eastwood-0.5.1 Rakefile
eastwood-0.5.0 Rakefile
eastwood-0.4.0 Rakefile
eastwood-0.3.8 Rakefile
eastwood-0.3.7 Rakefile
eastwood-0.3.5 Rakefile