forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
55 lines (43 loc) · 1.31 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require 'bundler/gem_tasks'
desc 'Creates a test rails app for the specs to run against'
task :setup, [:parallel, :dir, :template] do |_t, opts|
require 'rails/version'
base_dir = opts[:dir] || 'spec/rails'
app_dir = "#{base_dir}/rails-#{Rails::VERSION::STRING}"
template = opts[:template] || 'rails_template'
if File.exist? app_dir
puts "test app #{app_dir} already exists; skipping"
else
system "mkdir -p #{base_dir}"
args = %W(
-m spec/support/#{template}.rb
--skip-bundle
--skip-listen
--skip-turbolinks
--skip-test-unit
--skip-coffee
)
command = ['bundle', 'exec', 'rails', 'new', app_dir, *args].join(' ')
env = { 'BUNDLE_GEMFILE' => ENV['BUNDLE_GEMFILE'] }
env['INSTALL_PARALLEL'] = 'yes' if opts[:parallel]
Bundler.with_clean_env { Kernel.exec(env, command) }
Rake::Task['parallel:after_setup_hook'].invoke if opts[:parallel]
end
end
# Import all our rake tasks
FileList['tasks/**/*.rake'].each { |task| import task }
task default: :test
begin
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
rescue LoadError
task :jasmine do
abort 'Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine'
end
end
task :console do
require 'irb'
require 'irb/completion'
ARGV.clear
IRB.start
end