Sha256: 133df81f5f978f21d8999448a7d89f034f5d7449f313a5d6c4e92812d70c8abc

Contents?: true

Size: 920 Bytes

Versions: 28

Compression:

Stored size: 920 Bytes

Contents

namespace :rails do
  def _adapter(n)
    case n
    when /postgres/
      'postgresql'
    else
      n
    end
  end

  def _driver(n)
    case n
    when /postgres/
      'postgres'
    else
      n
    end
  end

  def _target(n)
    case n
    when /postgres/
      'test_jdbcpostgresql'
    else
      "test_jdbc#{n}"
    end
  end

  task :test => "java_compile" do
    driver = ENV['DRIVER']
    raise "need a DRIVER" unless driver
    activerecord = ENV['RAILS']
    raise "need location of RAILS source code" unless activerecord
    activerecord = File.join(activerecord, 'activerecord') unless activerecord =~ /activerecord$/
    ar_jdbc = File.expand_path(File.dirname(__FILE__) + '/..')
    rubylib = "#{ar_jdbc}/lib:#{ar_jdbc}/drivers/#{_driver(driver)}/lib:#{ar_jdbc}/adapters/#{_adapter(driver)}/lib"
    Dir.chdir(activerecord) do
      rake "RUBYLIB=#{rubylib}", "#{_target(driver)}"
    end
  end
end

Version data entries

28 entries across 28 versions & 6 rubygems

Version Path
saturnflyer-activerecord-jdbc-adapter-0.9.3 rakelib/rails.rake
intentmedia-activerecord-jdbc-adapter-1.1.1.1 rakelib/rails.rake
c3-activerecord-jdbc-adapter-1.1.3.1 rakelib/rails.rake
c3-activerecord-jdbc-adapter-1.1.3 rakelib/rails.rake
activerecord-jdbc-adapter-1.1.3 rakelib/rails.rake
activerecord-jdbc-adapter-1.1.2 rakelib/rails.rake
activerecord-jdbc-adapter-1.1.1 rakelib/rails.rake
activerecord-jdbc-adapter-1.1.0 rakelib/rails.rake
activerecord-jdbc-adapter-1.0.3-java rakelib/rails.rake
activerecord-jdbc-adapter-1.0.2-java rakelib/rails.rake
activerecord-jdbc-adapter-1.0.1-java rakelib/rails.rake
activerecord-jdbc-adapter-1.0.0-java rakelib/rails.rake
activerecord-jdbc-adapter-1.0.0.beta2-java rakelib/rails.rake
kb-activerecord-jdbc-adapter-0.9.7.1-java rakelib/rails.rake
kb-activerecord-jdbc-adapter-1.0.0.beta1-java rakelib/rails.rake
activerecord-jdbc-adapter-1.0.0.beta1-java rakelib/rails.rake
activerecord-jdbc-adapter-0.9.7-java rakelib/rails.rake
activerecord-jdbc-adapter-0.9.6-java rakelib/rails.rake
activerecord-jdbc-adapter-0.9.5-java rakelib/rails.rake
activerecord-jdbc-adapter-0.9.4-java rakelib/rails.rake