-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
59 lines (47 loc) · 1.33 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
require 'rake'
require 'bundler/gem_tasks'
require 'neo4j/rake_tasks'
# load 'neo4j/tasks/migration.rake'
desc 'Generate YARD documentation'
require 'colored'
def system_or_fail(command)
puts 'Running command: '.blue + command
system(command) or fail "Unable to run: #{command}" # rubocop:disable Style/AndOr
end
namespace :docs do
task :yard do
system_or_fail('rm -rf docs/_build/_yard/')
abort("can't generate YARD") unless system('yard -p docs/_yard/custom_templates -f rst')
end
task :sphinx do
system_or_fail('rm -rf docs/api/')
system_or_fail('cp -r docs/_build/_yard/ docs/api/')
abort("can't generate Sphinx docs") unless system('cd docs && make html')
system_or_fail('cp -r docs/assets/* docs/_build/html/_static/')
end
task :open do
`open docs/_build/html/index.html`
end
task all: [:yard, :sphinx]
end
task docs: 'docs:all'
desc 'Run neo4j.rb specs'
task 'spec' do
success = system('rspec spec')
abort('RSpec neo4j failed') unless success
end
require 'rake/testtask'
Rake::TestTask.new(:test_generators) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
desc 'Generate coverage report'
task 'coverage' do
ENV['COVERAGE'] = 'true'
rm_rf 'coverage/'
task = Rake::Task['spec']
task.reenable
task.invoke
end
task default: ['spec']