-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
42 lines (33 loc) · 1 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
require "bundler/gem_tasks"
require 'sprockets'
def pack_js(src_file)
secretary = ::Sprockets::Secretary.new(
:asset_root => "lib",
:source_files => ["lib/rrd-grapher/assets/javascripts/#{src_file}"],
:interpolate_constants => false
)
concatenation = secretary.concatenation
concatenation.save_to("lib/rrd-grapher/public/javascripts/#{src_file}")
secretary.install_assets
end
# compile and pack coffee files
task :build do
# core
sh "coffee -c -o lib/rrd-grapher/public/javascripts lib/rrd-grapher/assets/javascripts/"
# example_app
sh "coffee -c -o example_app/public/javascripts example_app/assets/javascripts/"
# sprockets
pack_js("app-dev.js")
pack_js("app.js")
end
task :test do
system("COVERAGE=1 bundle exec bacon spec/**/*_spec.rb")
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