-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
57 lines (41 loc) · 1.02 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
$:.unshift File.join( File.dirname(__FILE__), "lib")
require 'rspec/core/rake_task'
require 'distiller'
RSpec::Core::RakeTask.new(:spec)
namespace :db do
task :create_indexes do
Mongoid.models.each do |model|
Distiller::Indexes.create
end
end
end
namespace :distiller do
namespace :import do
task :towns do
Distiller::Import.towns
end
task :postcodes do
Distiller::Import.postcodes
end
task :localities do
Distiller::Import.localities
end
task :streets do
Distiller::Import.streets
end
task :all => [:towns, :postcodes, :localities, :streets]
end
namespace :distil do
task :pages, :pages do |task, args|
Distiller::Distil.perform(args[:pages])
end
task :all, :start_index, :step do |task, args|
Distiller::Distil.perform(nil, args[:start_index].to_i, args[:step].to_i)
end
task :latest do
desc "Distil latest"
Distiller::Distil.from_date(ENV['DATE_TIME'] || nil)
end
end
end
task :default => :spec