Sha256: 268c095954c318ae8578a1dada99ee6d20e7fe18ecdaab7ac4aa34b7b96aec4b

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

#!/usr/bin/env rake
begin
  require 'bundler/setup'
rescue LoadError
  puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
  require 'rdoc/task'
rescue LoadError
  require 'rdoc/rdoc'
  require 'rake/rdoctask'
  RDoc::Task = Rake::RDocTask
end

RDoc::Task.new(:rdoc) do |rdoc|
  rdoc.rdoc_dir = 'rdoc'
  rdoc.title    = 'HydraEditor'
  rdoc.options << '--line-numbers'
  rdoc.rdoc_files.include('README.rdoc')
  rdoc.rdoc_files.include('lib/**/*.rb')
end


Bundler::GemHelper.install_tasks

dummy = File.expand_path('../spec/dummy', __FILE__)
rakefile = File.join(dummy, 'Rakefile')

desc "Remove the dummy app"
task :clean do
  sh "rm -rf #{dummy}"
end

desc "Generate the dummy app"
task :setup do
  unless File.exists?("#{dummy}/Rakefile")
    `rails new #{dummy}`
    `cp -r spec/support/Gemfile #{dummy}/`
    `cp -r spec/support/lib/generators #{dummy}/lib`
    Dir.chdir(dummy) do
      sh "rails g blacklight --devise"
      sh "rails g hydra:head -f"
      sh "rm spec/models/user_spec.rb" # generated by devise
      puts "Generating test app"
      sh "rails generate test_app"
      puts "running migrations"
      sh 'rake db:migrate db:test:prepare'
	  sh "touch public/test.html" # for spec/features/record_editing_spec.rb
    end
  end
end

desc "Run the spec tests"
task :spec => :setup do
  here = File.expand_path("../", __FILE__)
  Dir.chdir(dummy) do
    Bundler.with_clean_env do
      sh "bundle exec rspec --color -I#{here}/spec #{here}/spec"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hydra-editor-0.1.1 Rakefile