Sha256: d7316dfffbba4a156c19dce1dd70e1b2d5c5454b8adb02b0a4f2f2a3f970b737

Contents?: true

Size: 1.18 KB

Versions: 109

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env ruby

#
# if run as script, load the file as library while starting irb 
#
if __FILE__ == $0
  irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
  ENV['ADAPTER'] = ARGV[0]
  exec "#{irb} -f -r #{$0} --simple-prompt"
end

#
# check if the given adapter is supported (default: mysql)
#
adapters = %w[mysql sqlite oracle oracle_enhanced postgresql ibm_db]
adapter = ENV['ADAPTER'] || 'mysql'
unless adapters.include? adapter
  puts "Usage: #{__FILE__} <adapter>"
  puts ''
  puts 'Adapters: '
  puts adapters.map{ |adapter| "    #{adapter}" }.join("\n")
  exit 1
end

#
# load all necessary libraries
#
require 'rubygems'
require 'local/database_connections'

$LOAD_PATH.unshift 'lib'

begin
  require 'local/paths'
  $LOAD_PATH.unshift "#{ENV['EDGE_RAILS_DIR']}/active_record/lib"  if ENV['EDGE_RAILS_DIR']
  $LOAD_PATH.unshift "#{ENV['EDGE_RAILS_DIR']}/activesupport/lib" if ENV['EDGE_RAILS_DIR']
rescue
end

require 'active_support'
require 'active_record'

require "test/connections/native_#{adapter}/connection"
require 'composite_primary_keys'

PROJECT_ROOT = File.join(File.dirname(__FILE__), '..')
Dir[File.join(PROJECT_ROOT,'test/fixtures/*.rb')].each { |model| require model }

Version data entries

109 entries across 109 versions & 1 rubygems

Version Path
composite_primary_keys-3.1.1 scripts/console.rb
composite_primary_keys-3.1.0 scripts/console.rb
composite_primary_keys-3.0.9 scripts/console.rb
composite_primary_keys-3.0.8 scripts/console.rb
composite_primary_keys-3.0.7 scripts/console.rb
composite_primary_keys-3.0.4 scripts/console.rb
composite_primary_keys-3.0.3 scripts/console.rb
composite_primary_keys-3.0.0.b3 scripts/console.rb
composite_primary_keys-3.0.0.b2 scripts/console.rb