Sha256: 2b2354b6dd1b07f051cb20c97f7105c4cdf7b8f2ccd0346f0643a64c27b115be

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

#!/usr/bin/env rake
require "bundler/gem_helper"
case RUBY_PLATFORM
when "java"
  Bundler::GemHelper.install_tasks name: "upsert-java"
else
  Bundler::GemHelper.install_tasks name: "upsert"
end
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec) do |t|
  t.rspec_opts = "--format documentation"
end

task :default => :spec

task :rspec_all_databases do
  results = {}
  
  dbs = %w{ postgresql mysql sqlite3 }
  if ENV['DB']
    dbs = ENV['DB'].split(',') 
  end
  
  dbs.each do |db|
    puts
    puts '#'*50
    puts "# Running specs against #{db}"
    puts '#'*50
    puts

    if RUBY_VERSION >= '1.9'
      pid = spawn({'DB' => db}, 'rspec', '--format', 'documentation', File.expand_path('../spec', __FILE__))
      Process.waitpid pid
      results[db] = $?.success?
    else
      exec({'DB' => db}, 'rspec', '--format', 'documentation', File.expand_path('../spec', __FILE__))
    end

  end
  puts results.inspect
end

task :n, :from, :to do |t, args|
  Dir[File.expand_path("../lib/upsert/**/#{args.from}.*", __FILE__)].each do |path|
    dir = File.dirname(path)
    File.open("#{dir}/#{args.to}.rb", 'w') do |f|
      f.write File.read(path).gsub(args.from, args.to)
    end
  end
end

require 'yard'
YARD::Rake::YardocTask.new

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
upsert-2.9.10-java Rakefile
upsert-2.9.10 Rakefile
upsert-2.9.9-universal-java-11 Rakefile
upsert-2.9.9 Rakefile