forked from acdcorp/ruby-api-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
28 lines (24 loc) · 802 Bytes
/
Rakefile
File metadata and controls
28 lines (24 loc) · 802 Bytes
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
$:.unshift(File.expand_path("./application"))
current_task = Rake.application.top_level_tasks.first
ENV['RACK_ENV'] ||= current_task['spec'] ? 'test' : 'development'
require 'bundler'
require 'bundler/setup'
# Database tasks should not need the whole app
if current_task['db:']
require 'sequel'
require 'config/variables'
require 'config/sequel'
SEQUEL_DB = Api::SEQUEL_DB
# Testing does not need the app either as it will create its own app
elsif !current_task['spec']
require 'api'
end
if current_task['spec']
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = Dir.glob('application/spec/**/*_spec.rb')
t.ruby_opts = "-I#{File.expand_path("./application/spec")}"
end
else
Dir["./application/tasks/**/*.rake"].each { |rb| import rb }
end