forked from hquery/patientapi
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
45 lines (35 loc) · 1.11 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
require 'rake'
require 'rake/testtask'
require 'sprockets'
require 'tilt'
require 'fileutils'
task :default => [:test]
desc "Run basic tests"
Rake::TestTask.new(:test_unit) do |t|
t.libs << "test"
t.test_files = FileList['test/**/*_test.rb']
t.verbose = true
end
task :test => [:test_unit] do
end
namespace :doc do
desc "Generate JS from CoffeeScript"
task :generate_js do
ctx = Sprockets::Environment.new(File.expand_path("../", __FILE__))
Tilt::CoffeeScriptTemplate.default_bare=true
ctx.append_path "app/assets/javascripts"
api = ctx.find_asset('patient')
Dir.mkdir('tmp') unless Dir.exists?( 'tmp')
File.open('tmp/patient.js', 'w+') do |js_file|
js_file.write api
end
end
desc "Generate docs for patient API"
task :js => :generate_js do
system 'java -jar ./doc/jsdoc-toolkit/jsrun.jar ./doc/jsdoc-toolkit/app/run.js -t=doc/jsdoc-toolkit/templates/jsdoc -a tmp/patient.js -d=doc/patient-api'
end
task :copydir do
Dir.mkdir('patientapi') unless Dir.exists? ('patientapi')
cp_r "doc/patient-api", "../query-composer/public/patientapi"
end
end