split gem into database_cleaner-core and database_cleaner metagem.

This commit is contained in:
Micah Geisel 2020-02-01 15:23:55 -08:00 committed by Micah Geisel
parent d26ffe15c4
commit e518560541
6 changed files with 45 additions and 49 deletions

View file

@ -1,3 +1,3 @@
gemspec gemspec name: "database_cleaner-core"
gem "byebug" gem "byebug"

View file

@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
database_cleaner (2.0.0.beta) database_cleaner-core (2.0.0.beta)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
@ -84,7 +84,7 @@ DEPENDENCIES
bundler bundler
byebug byebug
cucumber cucumber
database_cleaner! database_cleaner-core!
guard-rspec guard-rspec
listen listen
rake rake

View file

@ -1,32 +1,12 @@
require "rubygems" # testing
require "bundler" require "rspec/core/rake_task"
require "bundler/gem_tasks" RSpec::Core::RakeTask.new(:spec)
Bundler.setup
require 'rake'
require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end
RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end
task :default => :spec task :default => :spec
desc "Cleans the project of any tmp file that should not be included in the gemspec." # releasing
task :clean do require "rake/clean"
["examples/config/database.yml", "examples/db/activerecord_one.db", "examples/db/activerecord_two.db", "examples/db/datamapper_default.db", CLOBBER.include "pkg"
"examples/db/datamapper_one.db", "examples/db/datamapper_two.db"].each do |f| require "bundler/gem_helper"
FileUtils.rm_f(f) Bundler::GemHelper.install_tasks name: :database_cleaner
end Bundler::GemHelper.install_tasks name: :"database_cleaner-core"
%w[*.sqlite3 *.log #* *.swp *.swo].each do |pattern|
`find . -name "#{pattern}" -delete`
end
end
desc "Cleans the dir and builds the gem"
task :prep => [:clean, :gemspec, :build]

View file

@ -0,0 +1,30 @@
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "database_cleaner/version"
Gem::Specification.new do |spec|
spec.name = "database_cleaner-core"
spec.version = DatabaseCleaner::VERSION
spec.authors = ["Ben Mabey", "Ernesto Tagwerker"]
spec.email = ["ernesto@ombulabs.com"]
spec.summary = "Strategies for cleaning databases. Can be used to ensure a clean slate for testing."
spec.description = "Strategies for cleaning databases. Can be used to ensure a clean slate for testing."
spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_development_dependency "rake"
spec.add_development_dependency "bundler"
spec.add_development_dependency 'guard-rspec'
spec.add_development_dependency "listen"
spec.add_development_dependency "rspec"
spec.add_development_dependency "cucumber"
end

View file

@ -1,7 +1,4 @@
require_relative "./lib/database_cleaner/version"
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "database_cleaner/version"
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = "database_cleaner" spec.name = "database_cleaner"
@ -14,17 +11,5 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner" spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner"
spec.license = "MIT" spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").reject do |f| spec.add_dependency "database_cleaner-active_record"
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_development_dependency "rake"
spec.add_development_dependency "bundler"
spec.add_development_dependency 'guard-rspec'
spec.add_development_dependency "listen"
spec.add_development_dependency "rspec"
spec.add_development_dependency "cucumber"
end end

View file

@ -0,0 +1 @@
# empty file to avoid LoadError if someone requires database_cleaner-core directly