2 desc 'Build the Oracle test databases'
3 task :build_databases => :load_connection do
4 puts File.join(SCHEMA_PATH, 'oracle.sql')
5 options_str = ENV['cpk_adapter_options_str']
6 sh %( sqlplus #{options_str} < #{File.join(SCHEMA_PATH, 'oracle.sql')} )
9 desc 'Drop the Oracle test databases'
10 task :drop_databases => :load_connection do
11 puts File.join(SCHEMA_PATH, 'oracle.drop.sql')
12 options_str = ENV['cpk_adapter_options_str']
13 sh %( sqlplus #{options_str} < #{File.join(SCHEMA_PATH, 'oracle.drop.sql')} )
16 desc 'Rebuild the Oracle test databases'
17 task :rebuild_databases => [:drop_databases, :build_databases]
19 task :load_connection do
20 require File.join(PROJECT_ROOT, %w[lib adapter_helper oracle])
21 spec = AdapterHelper::Oracle.load_connection_from_env
22 ENV['cpk_adapter_options_str'] = "#{spec[:username]}/#{spec[:password]}@#{spec[:host]}"