Sha256: ab8ea876109e051333d12ab33854c8af7d0260ed500c90101233b17e4cc91ca1

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

task :restart do
  system "touch tmp/restart.txt"
  system "touch tmp/debug.txt" if ENV["DEBUG"] == 'true'
end

desc "Bootstrap project"
task :bootstrap => %w(bootstrap:files db:create db:migrate restart)

namespace :bootstrap do
  desc "Bootstrap project to run tests"
  task :test => :bootstrap do
    system "rake db:create db:migrate RAILS_ENV=test" unless ENV['RAILS_ENV'] == "test"
  end

  desc "Bootstrap project to run in production"
  task :production => :bootstrap do
    if File.exist?("public/stylesheets/sass") or File.exist?("app/sass")
      Sass::Plugin.options[:always_update] = true;
      Sass::Plugin.update_stylesheets
    end
    Rake::Task["asset:packager:build_all"].invoke if File.exist?("vendor/plugins/asset_packager")
  end

  task :files do
    system "git submodule sync"
    system "git submodule init"
    system "git submodule update --merge"
    system "git submodule foreach 'git checkout `git name-rev --name-only HEAD`'"
    system "cp config/database.sample.yml config/database.yml" unless File.exist?('config/database.yml')
  end
end

Rake::Task[:default].clear if Rake::Task.task_defined?(:default)
desc "Bootstrap the current project and run the tests."
task :default => ["bootstrap:test", :spec, :cucumber]

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bard-rake-0.1.5 lib/bard/rake/bootstrap.rb