-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
61 lines (51 loc) · 1.56 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
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
#RSpec::Core::RakeTask.new(:requests) do |spec|
# spec.pattern = 'spec/requests/**/*_spec.rb'
#end
task :javascripts => [:require_jasmine] do
Rake::Task['jasmine:ci'].invoke
end
task :jasmine_server => [:require_jasmine] do
Rake::Task['jasmine'].invoke
end
end
task :spec => [n[:models], n[:integration], n[:javascripts]]#, n[:requests]]
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
task :require_jasmine do
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
end