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
activerecord-jdbc-adapter-0.9.3-java rakelib/rails.rake
jpzwarte-activerecord-jdbc-adapter-0.9.2.6 rakelib/rails.rake
jpzwarte-activerecord-jdbc-adapter-0.9.2.5 rakelib/rails.rake
jpzwarte-activerecord-jdbc-adapter-0.9.2.4 rakelib/rails.rake
jpzwarte-activerecord-jdbc-adapter-0.9.2.3 rakelib/rails.rake
jpzwarte-activerecord-jdbc-adapter-0.9.2.2 rakelib/rails.rake
jpzwarte-activerecord-jdbc-adapter-0.9.2.1 rakelib/rails.rake
activerecord-jdbc-adapter-0.9.2 rakelib/rails.rake