-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
45 lines (36 loc) · 944 Bytes
/
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/gempackagetask'
$dir = File.dirname(__FILE__)
task :default => :package
task :test => :spec
desc "Run all specs"
task :spec do
system('spec', '-c', "#{$dir}/spec")
end
namespace "migrate" do
desc "Run the migration for the specs"
task :up do
require "#{$dir}/spec/create_nodes_table"
CreateNodesTable.up
end
desc "Revert the migration for the specs"
task :down do
require "#{$dir}/spec/create_nodes_table"
CreateNodesTable.down
end
end
spec = eval(IO.read("#{$dir}/hyrarchy.gemspec"))
gem_pkg_task = Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = false
end
desc "Install the gem with sudo"
task :install => :package do
system('sudo', 'gem', 'install', "#{$dir}/#{gem_pkg_task.package_dir}/#{gem_pkg_task.gem_file}")
end
desc 'Use sqlite for specs'
task :sqlite do
ENV['DB'] = 'sqlite'
end
desc 'Enable performance specs'
task :performance do
ENV['PERFORMANCE'] = 'true'
end