-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
54 lines (43 loc) · 1.34 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
require File.expand_path(File.dirname(__FILE__) + '/config/environment')
require 'rake'
unless ENV['RACK_ENV'] == 'production'
require 'rspec/core/rake_task'
require 'jasmine'
task :default => :spec
spec = namespace :spec do
RSpec::Core::RakeTask.new(:models) do |s|
s.pattern = 'spec/models/**/*_spec.rb'
end
task :js => [:load_jasmine] do
Rake::Task['jasmine:ci'].invoke
end
task :jasmine_server => [:load_jasmine] do
Rake::Task['jasmine'].invoke
end
task :load_jasmine do
load 'jasmine/tasks/jasmine.rake'
end
end
task :spec => [spec[:models], spec[:js]]
end
db = namespace :db do
task :seed do
puts 'Data setup...'
ruby './db/seeds.rb'
puts 'Done.'
end
end
task :compress do
puts 'Compressing assets...'
compressor = YUI::CssCompressor.new
styles = compressor.compress(File.open('./public/css/styles.css').read)
File.new('./public/css/styles.min.css', 'w').write styles
compressor = YUI::JavaScriptCompressor.new(:munge => true)
poll = compressor.compress(File.open('./public/js/poll.js').read)
score = compressor.compress(File.open('./public/js/score.js').read)
File.new('./public/js/min/poll.min.js', 'w').write poll
File.new('./public/js/min/score.min.js', 'w').write score
puts 'Done.'
end
require './app/controller'
require 'resque/tasks'