Sha256: d522baa40ebb26a4efee8fe6704d5b686da7cb7d558f14ac3b15fdc0af347815
Contents?: true
Size: 764 Bytes
Versions: 31
Compression:
Stored size: 764 Bytes
Contents
require 'pathname' module SchemaDev GEMFILES_DIR = "gemfiles" module GemfileSelector extend self def gemfile(opts = {}) opts = opts.keyword_args(activerecord: :required, db: :required) Pathname.new(GEMFILES_DIR).join("activerecord-#{opts.activerecord}", "Gemfile.#{opts.db}") end def command(opts={}) opts = opts.keyword_args(activerecord: :required, db: :required) "BUNDLE_GEMFILE=#{gemfile(activerecord: opts.activerecord, db: opts.db)}" end def infer_db (env = ENV['BUNDLE_GEMFILE']) =~ %r{activerecord.*/Gemfile[.](.*)} $1 or raise "Can't infer db: Env BUNDLE_GEMFILE=#{env.inspect}) isn't a schema_dev standard Gemfile path. (Run 'schema_dev rspec' instead of 'rspec'?)" end end end
Version data entries
31 entries across 31 versions & 1 rubygems