Sha256: 9d2710966dceb382dd82a407721487379d394b4b2afd2b2f11d4aa0c05735f22

Contents?: true

Size: 1.66 KB

Versions: 21

Compression:

Stored size: 1.66 KB

Contents

# +----------------------------------------------------------------------+
# |  Licensed Materials - Property of IBM                                |
# |                                                                      |
# | (C) Copyright IBM Corporation 2006, 2007.                            |
# +----------------------------------------------------------------------+

require 'pathname'

begin
  puts ".. Attempt to load IBM_DB Ruby driver for IBM Data Servers for this platform: #{RUBY_PLATFORM}"
  unless defined? IBM_DB
    # find IBM_DB driver path relative init.rb
    drv_path = Pathname.new(File.dirname(__FILE__)) + 'lib'
    drv_path += (RUBY_PLATFORM =~ /mswin32/) ? 'mswin32' : 'linux32'
    puts ".. Locate IBM_DB Ruby driver path: #{drv_path}"
    drv_lib = drv_path + 'ibm_db.so'
    require "#{drv_lib.to_s}"
    puts ".. Successfuly loaded IBM_DB Ruby driver: #{drv_lib}"
  end
rescue
  raise LoadError, "Failed to load IBM_DB Driver !?"
end

# Include IBM_DB in the list of supported adapters
RAILS_CONNECTION_ADAPTERS << 'ibm_db'
# load IBM_DB Adapter provided by the plugin
require 'active_record/connection_adapters/ibm_db_adapter'

# Override the frameworks initialization to re-enable ActiveRecord after being
# disabled during plugin install (i.e. config.frameworks -= [ :active_record ])
[:load_environment,\
 :initialize_database,\
 :initialize_logger,\
 :initialize_framework_logging,\
 :initialize_framework_settings,\
 :initialize_framework_views,\
 :initialize_dependency_mechanism,\
 :load_environment ].each do |routine|
  Rails::Initializer.run(routine) do |config|
    config.frameworks = [:active_record]
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ibm_db-5.5.0-x86-mingw32 init.rb
ibm_db-5.4.1-x86-mingw32 init.rb
ibm_db-5.4.0-x86-mingw32 init.rb
ibm_db-5.3.2-x86-mingw32 init.rb
ibm_db-5.2.0-x86-mingw32 init.rb
ibm_db-5.1.0-x86-mingw32 init.rb
ibm_db-5.0.5-x86-mingw32 init.rb
ibm_db-5.0.4-x86-mingw32 init.rb
ibm_db-5.0.3-x86-mingw32 init.rb
ibm_db-5.0.2-x86-mingw32 init.rb
ibm_db-3.0.5-x86-mingw32 init.rb
ibm_db-3.0.5 init.rb
ibm_db-3.0.0-x86-mingw32 init.rb
ibm_db-3.0.0-x86_64-darwin-14 init.rb
ibm_db-3.0.0 init.rb
ibm_db-2.6.1-x86-mingw32 init.rb
ibm_db-2.6.1-universal-darwin-14 init.rb
ibm_db-2.6.1 init.rb
ibm_db-2.6.0-x86-mingw32 init.rb
ibm_db-2.6.0-x86_64-darwin-14 init.rb