-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathRakefile
67 lines (56 loc) · 1.72 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
66
67
$LOAD_PATH.unshift(File.expand_path('./config'))
require 'main'
require 'sinatra/activerecord/rake'
require_relative './lib/seed_politicians'
desc "create a local pg database with call to exec"
task "db:create" do
puts "touch #{DB_NAME} if it doesn't already exist"
exec "createdb #{DB_NAME}"
end
desc "drop local pg database"
task "db:drop" do
puts "rm-f #{DB_NAME}"
exec "dropdb #{DB_NAME}"
end
desc "seed the politicians database"
task "db:seed" do
puts "seeding with only the corrupt politicians"
PoliticiansImporter.import
end
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
desc "load recent data from the Sunlight Foundation"
task "worker:sunlight_scraper" do
puts "A worker is talking to the sunlight API, and it should be talking back"
SunlightScraper.scrape
end
desc "seeding the Sunlight Foundation database"
task "worker:sunlight_seed" do
puts "Adding last twenty events to the SunlightScores database..."
SunlightScraper.seed
end
desc "clear out SunlightScore database and update Scores"
task "worker:update_sunlight_scores" do
puts "A worker is cleaning out the SunlightScores database and loading the Scores table"
AddSunlightScores.update
end
desc "starts up the twitter stream"
task "worker:twitter_init" do
puts "where can I get some damn bait?"
TwitterStream.start
end
desc "updates the postgres database with twitter data"
task "worker:twitter_load" do
puts "redis WE DRANK YOUR MILKSHAKE"
TweetStore.compile_tweets
end
desc "seeds the politicians database with bios"
task "worker:politicians_bios_seed" do
PoliticiansImporter.seed_bios
end