-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
65 lines (59 loc) · 1.48 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
60
61
62
63
64
65
require 'bundler/gem_tasks'
require 'yaml'
task :test do
['sqlite', 'postgres', 'mysql'].each do |environment|
puts "Running tests for environment #{environment}"
ENV['ARC_ENV'] = environment
system 'rspec spec'
end
end
task :setup do
#setup postgres
`createdb arc_development -O jacob`
puts "Setup complete"
end
task :publish do
require './lib/arc/version'
package = "arc-#{Arc::VERSION}.gem"
package_path = File.join(File.expand_path("pkg", Dir.pwd), package)
if File.exists? package_path
system "gem push #{package_path}"
else
puts "gem package \"#{package_path}\" does not exist."
end
end
task :yank do
system "gem yank arc"
end
namespace :test do
task :integration do
before = ENV['ARC_ENV']
adapters = YAML::load(File.read("./spec/support/config.yml")).keys
adapters.each do |adapter|
ENV['ARC_ENV'] = adapter
puts "Running integration test for adapter: #{adapter}"
system "rspec spec/integration_spec.rb"
end
ENV['ARC_ENV'] = before
end
task :adapter, :env do |task, args|
ENV['ARC_ENV'] = args.env
system 'rspec spec/data_stores/integration/'
end
task :docs do
`rspec spec -f h > doc/spec.html`
end
task :wip do
system "rspec spec --tag wip"
end
end
#example use of passing arguments to rake
# task :say, :word, :person do |task, args|
# puts task
# puts '"args.word"'
# puts "\t- #{args.person}"
# end
# $ rake say[hello,"Jacob Morris"]
# >> say
# >> "hello"
# >> - Jacob Morris