-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
40 lines (33 loc) · 901 Bytes
/
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
require File.expand_path('../lib/boot', __FILE__)
require 'sinatra/activerecord/rake'
ENV['RACK_ENV'] ||= 'development'
namespace :log do
desc 'clear log files'
task :clear do
Dir['log/*.log'].each do |f|
f = File.open(f, 'w')
f.close
end
end
end
namespace :db do
desc 'Load seed data'
task :seed do
load('db/seeds.rb')
end
end
namespace :heroku do
desc 'Deploy to heroku & set required config values from config/config.yml'
task :deploy do
config = YAML.load_file('config/config.yml')
config_key_value_pairs = %w[heroku=true]
config.each do |key, value|
config_key_value_pairs << "#{key}='#{value}'" unless key == 'database'
end
system("heroku config:add #{config_key_value_pairs.join(' ')}")
system('git push heroku master')
end
end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec