forked from lucasefe/rubyconfar-2012
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
34 lines (27 loc) · 803 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
require './config/shotgun'
desc "Console"
task :console => :load_models do
require 'pry'
Pry.start
end
desc "Migrate schema"
task :migrate do
require 'sequel/extensions/migration'
Sequel::Migrator.run(DB, 'db/migrations', use_transactions: true)
end
desc "Seed database with basic info"
task :seed => :load_models do
require './db/seed'
end
task :load_models do
Dir.glob('./models/*').each { |r| require r unless File.directory?(r) }
end
namespace :attender do
desc 'update attender'
task :update do
require 'fileutils'
FileUtils.mkdir "./attender" if File.exists?("./attender")
%x(curl http://app.attenderapp.com/api/9/getSessions.json > ./attender/sessions.json)
%x(curl http://app.attenderapp.com/api/9/getSpeakers.json > ./attender/speakers.json)
end
end