-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
executable file
·65 lines (57 loc) · 1.47 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
56
57
58
59
60
61
62
63
64
65
# Copyright © 2017, ACM@UIUC
#
# This file is part of the Groot Project.
#
# The Groot Project is open source software, released under the University of
# Illinois/NCSA Open Source License. You should have received a copy of
# this license in a file with the distribution.
require 'rake'
require 'pry'
require_relative 'app'
namespace :db do
desc 'Migrate the database'
task :migrate do
puts 'Migrating database'
DataMapper.auto_migrate!
end
desc 'Upgrade the database'
task :upgrade do
puts 'Upgrading the database'
DataMapper.auto_upgrade!
end
desc 'Populate the database with dummy data by running scripts/applicants.rb'
task :seed do
puts 'Seeding database'
# Delete data and load from schema
DataMapper.auto_migrate!
require './scripts/seed.rb'
end
desc 'Load the database with data from liquid'
task :liquid do
# Delete data and load from schema
DataMapper.auto_migrate!
require './scripts/liquid.rb'
end
end
desc 'Start Pry with application environment loaded'
task :pry do
exec 'pry -r./init.rb'
end
namespace :routes do
desc 'Print all the routes'
task :show do
GrootMerchService.routes.each_pair do |method, list|
puts ":: #{method} ::"
routes = []
list.each do |item|
source = item[0].source
item[1].each do |s|
source.sub!(/\(.+?\)/, ':' + s)
end
routes << source[2...-2]
end
puts routes.sort.join('\n')
puts '\n'
end
end
end