-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRakefile
47 lines (40 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
require File.expand_path(File.dirname(__FILE__) + '/config/environment')
require 'rake'
unless ENV['RACK_ENV'] == 'production'
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]]
end
task :server do
system 'rackup'
end
desc 'This task is called by the Heroku Scheduler add-on'
task :subscribe, :email do |t, args|
if !args[:email]
Job.new.run
else
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
Job.new.run args[:email]
end
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