-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
84 changed files
with
528 additions
and
1,807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
.bundle/ | ||
log/*.log | ||
pkg/ | ||
spec/dummy/db/*.sqlite3 | ||
spec/dummy/db/*.sqlite3-journal | ||
spec/dummy/log/*.log | ||
spec/dummy/tmp/ | ||
spec/dummy/.sass-cache | ||
/.bundle/ | ||
/.yardoc | ||
/Gemfile.lock | ||
/_yardoc/ | ||
/coverage/ | ||
/doc/ | ||
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
|
||
*.log | ||
Gemfile.lock | ||
# rspec failure tracking | ||
.rspec_status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
--color | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
sudo: false | ||
language: ruby | ||
rvm: | ||
- 2.1.10 | ||
- 2.3.3 | ||
before_install: gem install bundler -v 1.15.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
source 'https://rubygems.org' | ||
|
||
#ruby=ruby-2.1.10 | ||
#ruby=ruby-2.3.3 | ||
#ruby-gemset=db-clone | ||
|
||
# Declare your gem's dependencies in db-clone.gemspec. | ||
# Bundler will treat runtime dependencies like base dependencies, and | ||
# development dependencies will be added by default to the :development group. | ||
gemspec | ||
|
||
# Declare any dependencies that are still in development here instead of in | ||
# your gemspec. These might include edge Rails or gems from your path or | ||
# Git. Remember to move these dependencies to your gemspec before releasing | ||
# your gem to rubygems.org. | ||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
# To use a debugger | ||
# gem 'byebug', group: [:development, :test] | ||
# Specify your gem's dependencies in db-clone.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 Sean Huber | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,39 @@ | ||
DbClone | ||
============== | ||
[![Gem Version](https://badge.fury.io/rb/db-clone.svg)](https://badge.fury.io/rb/db-clone) | ||
[![Build Status](https://travis-ci.org/seanhuber/db-clone.svg?branch=master)](https://travis-ci.org/seanhuber/db-clone) | ||
[![Coverage Status](https://coveralls.io/repos/github/seanhuber/db-clone/badge.svg?branch=master)](https://coveralls.io/github/seanhuber/db-clone?branch=master) | ||
|
||
![Screenshot](https://cdn.rawgit.com/seanhuber/db-clone/master/screenshot.png) | ||
|
||
Requirements | ||
----------------- | ||
|
||
Rails >= 4.0 and Ruby >= 2.1. | ||
# db-clone | ||
|
||
DbClone requires `mysqldump` (for MySQL) and/or `pg_dump` (for PostgreSQL). | ||
![Screenshot](https://cdn.rawgit.com/seanhuber/db-clone/master/screenshot.png) | ||
|
||
## Requirements | ||
|
||
Installation | ||
----------------- | ||
Ruby >= 2.3 | ||
|
||
Add to `gem 'db-clone', require: 'db_clone'` to your `Gemfile` and `bundle install`. | ||
db-clone requires `mysqldump` (for MySQL) and/or `pg_dump` (for PostgreSQL). | ||
|
||
## Installation | ||
|
||
Add to `gem 'db-clone', '~> 2.0'` to your `Gemfile` and `bundle install`. | ||
|
||
Usage | ||
----------------- | ||
## Usage | ||
|
||
To clone your `production` database to `development`, run: | ||
|
||
rake db:clone | ||
``` | ||
rake db:clone | ||
``` | ||
|
||
If you have more database blocks (besides `production` and `development`) defined in `config/database.yml`, you can clone between these databases using DbClone's CLI: | ||
|
||
rake db:clone[manual] | ||
``` | ||
rake db:clone[manual] | ||
``` | ||
|
||
## Contributing | ||
|
||
Bug reports and pull requests are welcome on GitHub at https://github.com/seanhuber/db-clone. | ||
|
||
License | ||
----------------- | ||
## License | ||
|
||
MIT-LICENSE. | ||
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
#!/usr/bin/env rake | ||
begin | ||
require 'bundler/setup' | ||
rescue LoadError | ||
puts 'You must `gem install bundler` and `bundle install` to run rake tasks' | ||
end | ||
|
||
Bundler::GemHelper.install_tasks | ||
|
||
APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__) | ||
load 'rails/tasks/engine.rake' | ||
|
||
Bundler::GemHelper.install_tasks | ||
|
||
Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each {|f| load f } | ||
|
||
require 'rspec/core' | ||
require 'bundler/gem_tasks' | ||
require 'rspec/core/rake_task' | ||
require 'db/clone' | ||
|
||
desc 'Run all specs in spec directory (excluding plugin specs)' | ||
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare') | ||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task default: :spec | ||
task :default => :spec | ||
|
||
Db::Clone.setup do |config| | ||
config.database_yml_path = File.join 'spec', 'sample_database.yml' | ||
# config.default_source_database = 'production' | ||
# config.default_destination_database = 'development' | ||
# config.default_source_database = 'uat2' | ||
# config.default_destination_database = 'test' | ||
config.ignore_tables = ['first_ignore', 'second_ignore'] | ||
end |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require "bundler/setup" | ||
require "db/clone" | ||
|
||
# You can add fixtures and/or initialization code here to make experimenting | ||
# with your gem easier. You can also use a different console, if you like. | ||
|
||
# (If you use this, don't forget to add pry to your Gemfile!) | ||
# require "pry" | ||
# Pry.start | ||
|
||
require "irb" | ||
IRB.start(__FILE__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
set -vx | ||
|
||
bundle install | ||
|
||
# Do any other automated setup that you need to do here |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.