-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRakefile
51 lines (41 loc) · 1.18 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
require File.expand_path(File.dirname(__FILE__) + '/config/environment')
require 'rake'
Bundler.require :test
require 'rspec/core/rake_task'
task :default => :spec
n = namespace :spec do
RSpec::Core::RakeTask.new(:models) do |spec|
spec.pattern = 'spec/models/**/*_spec.rb'
end
RSpec::Core::RakeTask.new(:integration) do |spec|
spec.pattern = 'spec/integration/**/*_spec.rb'
end
end
task :spec => [n[:models], n[:integration]]
task :server do
ruby 'app/controller.rb'
end
desc 'This task is called by the Heroku cron add-on'
task :cron do
Job.new(Subscriber.create).run
end
task :subscribe do
Mongoid.configure do |config|
production_db = 'mongodb://heroku:[email protected]:27103/app525158'
conn = Mongo::Connection.from_uri(production_db)
uri = URI.parse(production_db)
config.master = conn.db(uri.path.gsub(/^\//, ''))
end
puts "[#{Time.now}] Job started."
Job.new(Subscriber.create).run_now
puts "[#{Time.now}] Job done."
end
task :cleandb do
Nightclubber.delete_all
Report.delete_all
puts 'done.'
end
task :news do
puts "Number of clubbers: #{Nightclubber.count}"
puts "Last added: #{Nightclubber.last.to_s}"
end