ruby-win32/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/sqlite3/database.rb
# Loads the corresponding driver, or if it is nil, attempts to locate a
# suitable driver.
Loads the corresponding driver, or if it is nil, attempts to locate a
suitable driver.
Loads the corresponding driver or if it is nil attempts to locate a suitable driver .
def load_driver( driver )
      case driver
        when Class
        when Symbol, String
          require "sqlite3/driver/#{driver.to_s.downcase}/driver"
          driver = SQLite3::Driver.const_get( driver )::Driver
        else
          [ "Native", "DL" ].each do |d|
            begin
              require "sqlite3/driver/#{d.downcase}/driver"
              driver = SQLite3::Driver.const_get( d )::Driver
              break
            rescue SyntaxError
              raise
            rescue ScriptError, Exception, NameError
            end
          end
          raise "no driver for sqlite3 found" unless driver
      end
      @driver = driver.new
    end
def load_driver ( driver ) case driver when Class when Symbol , String require "sqlite3/driver/#{driver.to_s.downcase}/driver" driver = SQLite3 :: Driver . const_get ( driver ) :: Driver else [ "Native" , "DL" ] . each do | d | begin require "sqlite3/driver/#{d.downcase}/driver" driver = SQLite3 :: Driver . const_get ( d ) :: Driver break rescue SyntaxError raise rescue ScriptError , Exception , NameError end end raise "no driver for sqlite3 found" unless driver end @driver = driver . new end
Loads the corresponding driver, or if it is nil, attempts to locate a
suitable driver.
Loads the corresponding driver or if it is nil attempts to locate a suitable driver .
# do nothing--use what was given
driver