dump 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/check.yml +102 -0
- data/.github/workflows/rubocop.yml +16 -0
- data/.rubocop.yml +24 -1
- data/.rubocop_todo.yml +27 -29
- data/Appraisals +59 -21
- data/Gemfile +6 -4
- data/LICENSE.txt +1 -1
- data/README.markdown +6 -6
- data/dump.gemspec +8 -5
- data/lib/dump/capistrano/v2.rb +21 -23
- data/lib/dump/continious_timeout.rb +4 -6
- data/lib/dump/env/filter.rb +1 -0
- data/lib/dump/env.rb +7 -7
- data/lib/dump/reader.rb +3 -5
- data/lib/dump/snapshot.rb +24 -31
- data/lib/dump/table_manipulation.rb +8 -8
- data/lib/dump/writer.rb +40 -27
- data/lib/tasks/assets.rake +1 -1
- data/lib/tasks/dump.rake +5 -5
- data/spec/.gitignore +2 -0
- data/spec/cycle_spec.rb +14 -22
- data/spec/dummy-2.3/config/initializers/abstract_mysql2_adapter.rb +4 -0
- data/spec/dummy-3.1/config/initializers/abstract_mysql2_adapter.rb +4 -0
- data/spec/dummy-3.2/config/initializers/abstract_mysql2_adapter.rb +4 -0
- data/spec/dummy-4.0/config/initializers/abstract_mysql2_adapter.rb +4 -0
- data/spec/dummy-4.1/config/initializers/abstract_mysql2_adapter.rb +4 -0
- data/spec/dummy-4.2/config/initializers/abstract_mysql2_adapter.rb +4 -0
- data/spec/dummy-6.0/.gitignore +28 -0
- data/spec/dummy-6.0/config/application.rb +35 -0
- data/spec/dummy-6.0/config/boot.rb +5 -0
- data/spec/dummy-6.0/config/cable.yml +10 -0
- data/spec/{dummy-3.0 → dummy-6.0}/config/database.yml +13 -10
- data/spec/dummy-6.0/config/environment.rb +5 -0
- data/spec/dummy-6.0/config/environments/development.rb +55 -0
- data/spec/dummy-6.0/config/environments/production.rb +106 -0
- data/spec/dummy-6.0/config/environments/test.rb +48 -0
- data/spec/dummy-6.0/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy-6.0/config/initializers/content_security_policy.rb +28 -0
- data/spec/dummy-6.0/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy-6.0/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy-6.0/config/initializers/inflections.rb +16 -0
- data/spec/{dummy-3.0 → dummy-6.0}/config/initializers/mime_types.rb +0 -1
- data/spec/dummy-6.0/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy-6.0/config/locales/en.yml +33 -0
- data/spec/dummy-6.0/config/puma.rb +38 -0
- data/spec/dummy-6.0/config/routes.rb +3 -0
- data/spec/dummy-6.0/config/spring.rb +6 -0
- data/spec/dummy-6.0/config/storage.yml +34 -0
- data/spec/dummy-6.0/config.ru +5 -0
- data/spec/dummy-6.0/db/seeds.rb +7 -0
- data/spec/dummy-6.0/log/.keep +0 -0
- data/spec/dummy-6.0/storage/.keep +0 -0
- data/spec/dummy-6.1/.gitattributes +8 -0
- data/spec/dummy-6.1/.gitignore +33 -0
- data/spec/dummy-6.1/config/application.rb +38 -0
- data/spec/dummy-6.1/config/boot.rb +5 -0
- data/spec/dummy-6.1/config/cable.yml +10 -0
- data/spec/dummy-6.1/config/database.yml +25 -0
- data/spec/dummy-6.1/config/environment.rb +5 -0
- data/spec/dummy-6.1/config/environments/development.rb +69 -0
- data/spec/dummy-6.1/config/environments/production.rb +114 -0
- data/spec/dummy-6.1/config/environments/test.rb +60 -0
- data/spec/dummy-6.1/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy-6.1/config/initializers/backtrace_silencers.rb +8 -0
- data/spec/dummy-6.1/config/initializers/content_security_policy.rb +28 -0
- data/spec/dummy-6.1/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy-6.1/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/dummy-6.1/config/initializers/inflections.rb +16 -0
- data/spec/dummy-6.1/config/initializers/mime_types.rb +4 -0
- data/spec/dummy-6.1/config/initializers/permissions_policy.rb +11 -0
- data/spec/dummy-6.1/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy-6.1/config/locales/en.yml +33 -0
- data/spec/dummy-6.1/config/puma.rb +43 -0
- data/spec/dummy-6.1/config/routes.rb +3 -0
- data/spec/dummy-6.1/config/spring.rb +6 -0
- data/spec/dummy-6.1/config/storage.yml +34 -0
- data/spec/dummy-6.1/config.ru +6 -0
- data/spec/dummy-6.1/db/seeds.rb +7 -0
- data/spec/dummy-6.1/log/.keep +0 -0
- data/spec/dummy-6.1/storage/.keep +0 -0
- data/spec/dummy-7.0/.gitattributes +7 -0
- data/spec/dummy-7.0/.gitignore +35 -0
- data/spec/dummy-7.0/config/application.rb +37 -0
- data/spec/dummy-7.0/config/boot.rb +3 -0
- data/spec/dummy-7.0/config/cable.yml +10 -0
- data/spec/dummy-7.0/config/database.yml +25 -0
- data/spec/dummy-7.0/config/environment.rb +5 -0
- data/spec/dummy-7.0/config/environments/development.rb +70 -0
- data/spec/dummy-7.0/config/environments/production.rb +93 -0
- data/spec/dummy-7.0/config/environments/test.rb +60 -0
- data/spec/dummy-7.0/config/initializers/assets.rb +12 -0
- data/spec/dummy-7.0/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy-7.0/config/initializers/filter_parameter_logging.rb +8 -0
- data/spec/dummy-7.0/config/initializers/inflections.rb +16 -0
- data/spec/dummy-7.0/config/initializers/permissions_policy.rb +11 -0
- data/spec/dummy-7.0/config/locales/en.yml +33 -0
- data/spec/dummy-7.0/config/puma.rb +43 -0
- data/spec/dummy-7.0/config/routes.rb +6 -0
- data/spec/dummy-7.0/config/storage.yml +34 -0
- data/spec/dummy-7.0/config.ru +6 -0
- data/spec/dummy-7.0/db/seeds.rb +7 -0
- data/spec/dummy-7.0/log/.keep +0 -0
- data/spec/dummy-7.0/storage/.keep +0 -0
- data/spec/dummy-7.1/.gitattributes +9 -0
- data/spec/dummy-7.1/.gitignore +35 -0
- data/spec/dummy-7.1/Dockerfile +58 -0
- data/spec/dummy-7.1/config/application.rb +42 -0
- data/spec/dummy-7.1/config/boot.rb +3 -0
- data/spec/dummy-7.1/config/cable.yml +10 -0
- data/spec/dummy-7.1/config/database.yml +25 -0
- data/spec/dummy-7.1/config/environment.rb +5 -0
- data/spec/dummy-7.1/config/environments/development.rb +76 -0
- data/spec/dummy-7.1/config/environments/production.rb +97 -0
- data/spec/dummy-7.1/config/environments/test.rb +64 -0
- data/spec/dummy-7.1/config/initializers/assets.rb +12 -0
- data/spec/dummy-7.1/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy-7.1/config/initializers/filter_parameter_logging.rb +8 -0
- data/spec/dummy-7.1/config/initializers/inflections.rb +16 -0
- data/spec/dummy-7.1/config/initializers/permissions_policy.rb +13 -0
- data/spec/dummy-7.1/config/locales/en.yml +31 -0
- data/spec/dummy-7.1/config/puma.rb +44 -0
- data/spec/dummy-7.1/config/routes.rb +10 -0
- data/spec/dummy-7.1/config/storage.yml +34 -0
- data/spec/dummy-7.1/config.ru +6 -0
- data/spec/dummy-7.1/db/seeds.rb +9 -0
- data/spec/dummy-7.1/log/.keep +0 -0
- data/spec/dummy-7.1/storage/.keep +0 -0
- data/spec/dummy-7.2/.gitattributes +9 -0
- data/spec/dummy-7.2/.gitignore +35 -0
- data/spec/dummy-7.2/.rubocop.yml +8 -0
- data/spec/dummy-7.2/Dockerfile +65 -0
- data/spec/dummy-7.2/config/application.rb +42 -0
- data/spec/dummy-7.2/config/boot.rb +3 -0
- data/spec/dummy-7.2/config/cable.yml +10 -0
- data/spec/dummy-7.2/config/database.yml +32 -0
- data/spec/dummy-7.2/config/environment.rb +5 -0
- data/spec/dummy-7.2/config/environments/development.rb +81 -0
- data/spec/dummy-7.2/config/environments/production.rb +105 -0
- data/spec/dummy-7.2/config/environments/test.rb +67 -0
- data/spec/dummy-7.2/config/initializers/assets.rb +12 -0
- data/spec/dummy-7.2/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy-7.2/config/initializers/filter_parameter_logging.rb +8 -0
- data/spec/dummy-7.2/config/initializers/inflections.rb +16 -0
- data/spec/dummy-7.2/config/initializers/permissions_policy.rb +13 -0
- data/spec/dummy-7.2/config/locales/en.yml +31 -0
- data/spec/dummy-7.2/config/puma.rb +34 -0
- data/spec/dummy-7.2/config/routes.rb +14 -0
- data/spec/dummy-7.2/config/storage.yml +34 -0
- data/spec/dummy-7.2/config.ru +6 -0
- data/spec/dummy-7.2/db/seeds.rb +9 -0
- data/spec/dummy-7.2/log/.keep +0 -0
- data/spec/dummy-7.2/storage/.keep +0 -0
- data/spec/dummy-8.0/.gitattributes +9 -0
- data/spec/dummy-8.0/.gitignore +34 -0
- data/spec/dummy-8.0/.rubocop.yml +8 -0
- data/spec/dummy-8.0/Dockerfile +68 -0
- data/spec/dummy-8.0/config/application.rb +42 -0
- data/spec/dummy-8.0/config/boot.rb +3 -0
- data/spec/dummy-8.0/config/cable.yml +10 -0
- data/spec/dummy-8.0/config/database.yml +41 -0
- data/spec/dummy-8.0/config/environment.rb +5 -0
- data/spec/dummy-8.0/config/environments/development.rb +72 -0
- data/spec/dummy-8.0/config/environments/production.rb +89 -0
- data/spec/dummy-8.0/config/environments/test.rb +53 -0
- data/spec/dummy-8.0/config/initializers/assets.rb +7 -0
- data/spec/dummy-8.0/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy-8.0/config/initializers/filter_parameter_logging.rb +8 -0
- data/spec/dummy-8.0/config/initializers/inflections.rb +16 -0
- data/spec/dummy-8.0/config/locales/en.yml +31 -0
- data/spec/dummy-8.0/config/puma.rb +41 -0
- data/spec/dummy-8.0/config/routes.rb +14 -0
- data/spec/dummy-8.0/config/storage.yml +34 -0
- data/spec/dummy-8.0/config.ru +6 -0
- data/spec/dummy-8.0/db/seeds.rb +9 -0
- data/spec/dummy-8.0/log/.keep +0 -0
- data/spec/dummy-8.0/storage/.keep +0 -0
- data/spec/dummy-8.1/.gitattributes +9 -0
- data/spec/dummy-8.1/.gitignore +35 -0
- data/spec/dummy-8.1/.rubocop.yml +8 -0
- data/spec/dummy-8.1/Dockerfile +71 -0
- data/spec/dummy-8.1/config/application.rb +42 -0
- data/spec/dummy-8.1/config/boot.rb +3 -0
- data/spec/dummy-8.1/config/bundler-audit.yml +5 -0
- data/spec/dummy-8.1/config/cable.yml +10 -0
- data/spec/dummy-8.1/config/ci.rb +19 -0
- data/spec/dummy-8.1/config/database.yml +40 -0
- data/spec/dummy-8.1/config/environment.rb +5 -0
- data/spec/dummy-8.1/config/environments/development.rb +78 -0
- data/spec/dummy-8.1/config/environments/production.rb +89 -0
- data/spec/dummy-8.1/config/environments/test.rb +53 -0
- data/spec/dummy-8.1/config/initializers/assets.rb +7 -0
- data/spec/dummy-8.1/config/initializers/content_security_policy.rb +29 -0
- data/spec/dummy-8.1/config/initializers/filter_parameter_logging.rb +8 -0
- data/spec/dummy-8.1/config/initializers/inflections.rb +16 -0
- data/spec/dummy-8.1/config/locales/en.yml +31 -0
- data/spec/dummy-8.1/config/puma.rb +42 -0
- data/spec/dummy-8.1/config/routes.rb +14 -0
- data/spec/dummy-8.1/config/storage.yml +27 -0
- data/spec/dummy-8.1/config.ru +6 -0
- data/spec/dummy-8.1/db/seeds.rb +9 -0
- data/spec/dummy-8.1/log/.keep +0 -0
- data/spec/dummy-8.1/storage/.keep +0 -0
- data/spec/dummy_rails_app.rb +1 -1
- data/spec/dump/env_spec.rb +8 -23
- data/spec/dump/reader_spec.rb +12 -14
- data/spec/dump/snapshot_spec.rb +9 -13
- data/spec/dump/table_manipulation_spec.rb +3 -3
- data/spec/dump/writer_spec.rb +7 -4
- data/spec/dump_spec.rb +5 -5
- data/spec/recipes/dump_spec.rb +40 -38
- data/spec/tasks/assets_spec.rb +3 -3
- metadata +400 -55
- data/.travis.database.yml +0 -14
- data/.travis.yml +0 -33
- data/.travis_check_rubies.yml +0 -1
- data/spec/dummy-3.0/.gitignore +0 -4
- data/spec/dummy-3.0/config/application.rb +0 -42
- data/spec/dummy-3.0/config/boot.rb +0 -6
- data/spec/dummy-3.0/config/environment.rb +0 -5
- data/spec/dummy-3.0/config/environments/development.rb +0 -26
- data/spec/dummy-3.0/config/environments/production.rb +0 -49
- data/spec/dummy-3.0/config/environments/test.rb +0 -35
- data/spec/dummy-3.0/config/initializers/inflections.rb +0 -10
- data/spec/dummy-3.0/config/initializers/secret_token.rb +0 -7
- data/spec/dummy-3.0/config/initializers/session_store.rb +0 -8
- data/spec/dummy-3.0/config/locales/en.yml +0 -5
- data/spec/dummy-3.0/config/routes.rb +0 -58
- data/spec/dummy-3.0/config.ru +0 -4
- data/spec/dummy-3.0/db/seeds.rb +0 -7
- /data/spec/{dummy-3.0 → dummy-6.0}/config/initializers/backtrace_silencers.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c1716a773254d085e2520a9b6a2e291de3a1c0f9c81cb8e38c47c1c250b915e9
|
|
4
|
+
data.tar.gz: 70ce34c7214363ad7b67507f6897dc0fba861f08a19cb18631ead57a2c1ab6fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ea32de2024efb6eaecea27fd3f66f00148efdf3003aa26b46153ebb7da3206b34626f3973909af40b952c2d3fe4de239db4851a4ddcaf9c8e763859431e0cb07
|
|
7
|
+
data.tar.gz: c97a71f269af5ba4604a56d4dce9c885b0c1a85806fa1aef61674a4a1251140525b51b29edb289566c68c6e7bb4a6698ed5b85d11425ca590f045a5f108d9b8b
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
name: check
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
pull_request:
|
|
5
|
+
schedule:
|
|
6
|
+
- cron: 45 4 * * 4
|
|
7
|
+
jobs:
|
|
8
|
+
reminder:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v6
|
|
12
|
+
- uses: ruby/setup-ruby@v1
|
|
13
|
+
with:
|
|
14
|
+
ruby-version: '4'
|
|
15
|
+
bundler-cache: true
|
|
16
|
+
- run: |
|
|
17
|
+
curl -fsSL 'https://rubygems.org/api/v1/versions/rails.json' | ruby -rjson -e '
|
|
18
|
+
next_version = Dir.glob("spec/dummy-*")
|
|
19
|
+
.map{ Gem::Version.new(_1.split("-")[1] + ".0") }
|
|
20
|
+
.max
|
|
21
|
+
.bump
|
|
22
|
+
|
|
23
|
+
untested = JSON.load(STDIN)
|
|
24
|
+
.map{ Gem::Version.new(_1["number"]) }
|
|
25
|
+
.reject(&:prerelease?)
|
|
26
|
+
.reject{ _1 < next_version }
|
|
27
|
+
.sort
|
|
28
|
+
.map(&:approximate_recommendation)
|
|
29
|
+
.uniq
|
|
30
|
+
|
|
31
|
+
abort "Test versions #{untested.join(", ")}" unless untested.empty?
|
|
32
|
+
'
|
|
33
|
+
check:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
container: "${{ matrix.container }}"
|
|
36
|
+
continue-on-error: ${{ startsWith(matrix.container, 'jruby:') }}
|
|
37
|
+
strategy:
|
|
38
|
+
matrix:
|
|
39
|
+
container:
|
|
40
|
+
- ruby:2.4
|
|
41
|
+
- ruby:2.5
|
|
42
|
+
- ruby:2.6
|
|
43
|
+
- ruby:2.7
|
|
44
|
+
- ruby:3.0
|
|
45
|
+
- ruby:3.1
|
|
46
|
+
- ruby:3.2
|
|
47
|
+
- ruby:3.3
|
|
48
|
+
- ruby:3.4
|
|
49
|
+
- ruby:4.0
|
|
50
|
+
- jruby:9.4
|
|
51
|
+
- jruby:10.0
|
|
52
|
+
fail-fast: false
|
|
53
|
+
services:
|
|
54
|
+
mysql:
|
|
55
|
+
image: mysql:5.7
|
|
56
|
+
env:
|
|
57
|
+
MYSQL_USER: mysql
|
|
58
|
+
MYSQL_PASSWORD: mysql
|
|
59
|
+
MYSQL_DATABASE: dump_test
|
|
60
|
+
MYSQL_ROOT_PASSWORD: password
|
|
61
|
+
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
|
|
62
|
+
postgres:
|
|
63
|
+
image: postgres:9.5
|
|
64
|
+
env:
|
|
65
|
+
POSTGRES_USER: postgres
|
|
66
|
+
POSTGRES_PASSWORD: postgres
|
|
67
|
+
POSTGRES_DB: dump_test
|
|
68
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v6
|
|
71
|
+
- run: which git || (apt update && apt -y install git)
|
|
72
|
+
- run: git init
|
|
73
|
+
- if: ${{ matrix.container >= 'ruby:1.9' && matrix.container < 'ruby:2.3' }}
|
|
74
|
+
run: |
|
|
75
|
+
echo "gem: --no-ri --no-rdoc --no-document" > ~/.gemrc
|
|
76
|
+
gem install rubygems-update --version '< 3'
|
|
77
|
+
update_rubygems
|
|
78
|
+
gem install bundler --version '< 2'
|
|
79
|
+
- run: |
|
|
80
|
+
tee spec/db/database.yml << YAML
|
|
81
|
+
sqlite3:
|
|
82
|
+
adapter: sqlite3
|
|
83
|
+
database: ':memory:'
|
|
84
|
+
|
|
85
|
+
mysql:
|
|
86
|
+
adapter: mysql2
|
|
87
|
+
host: mysql
|
|
88
|
+
database: dump_test
|
|
89
|
+
username: mysql
|
|
90
|
+
password: mysql
|
|
91
|
+
encoding: utf8
|
|
92
|
+
|
|
93
|
+
postgresql:
|
|
94
|
+
adapter: postgresql
|
|
95
|
+
host: postgres
|
|
96
|
+
database: dump_test
|
|
97
|
+
username: postgres
|
|
98
|
+
password: postgres
|
|
99
|
+
YAML
|
|
100
|
+
- run: bundle install --jobs=3 --retry=3
|
|
101
|
+
- run: RUBYOPT=-rset bundle exec appraisal install --jobs=3 --retry=3
|
|
102
|
+
- run: bundle exec appraisal rspec
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: rubocop
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
pull_request:
|
|
5
|
+
schedule:
|
|
6
|
+
- cron: 45 4 * * 4
|
|
7
|
+
jobs:
|
|
8
|
+
rubocop:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v6
|
|
12
|
+
- uses: ruby/setup-ruby@v1
|
|
13
|
+
with:
|
|
14
|
+
ruby-version: '4'
|
|
15
|
+
bundler-cache: true
|
|
16
|
+
- run: bundle exec rubocop
|
data/.rubocop.yml
CHANGED
|
@@ -5,6 +5,8 @@ AllCops:
|
|
|
5
5
|
- '*.gemspec'
|
|
6
6
|
- 'spec/dummy-*/**/*'
|
|
7
7
|
- 'gemfiles/*.gemfile'
|
|
8
|
+
- 'vendor/bundle/**/*'
|
|
9
|
+
NewCops: enable
|
|
8
10
|
|
|
9
11
|
Bundler/OrderedGems:
|
|
10
12
|
Enabled: false
|
|
@@ -21,7 +23,7 @@ Layout/DotPosition:
|
|
|
21
23
|
Layout/EndAlignment:
|
|
22
24
|
EnforcedStyleAlignWith: variable
|
|
23
25
|
|
|
24
|
-
Layout/
|
|
26
|
+
Layout/FirstHashElementIndentation:
|
|
25
27
|
EnforcedStyle: consistent
|
|
26
28
|
|
|
27
29
|
Layout/SpaceBeforeBlockBraces:
|
|
@@ -37,6 +39,9 @@ Metrics/BlockLength:
|
|
|
37
39
|
Style/Alias:
|
|
38
40
|
EnforcedStyle: prefer_alias_method
|
|
39
41
|
|
|
42
|
+
Style/ArgumentsForwarding:
|
|
43
|
+
Enabled: false
|
|
44
|
+
|
|
40
45
|
Style/DoubleNegation:
|
|
41
46
|
Enabled: false
|
|
42
47
|
|
|
@@ -49,15 +54,33 @@ Style/Encoding:
|
|
|
49
54
|
Style/FormatStringToken:
|
|
50
55
|
Enabled: false
|
|
51
56
|
|
|
57
|
+
Style/HashEachMethods:
|
|
58
|
+
Enabled: true
|
|
59
|
+
|
|
52
60
|
Style/HashSyntax:
|
|
53
61
|
EnforcedStyle: hash_rockets
|
|
54
62
|
|
|
63
|
+
Style/HashTransformKeys:
|
|
64
|
+
Enabled: false
|
|
65
|
+
|
|
66
|
+
Style/HashTransformValues:
|
|
67
|
+
Enabled: false
|
|
68
|
+
|
|
55
69
|
Style/IfUnlessModifier:
|
|
56
70
|
Enabled: false
|
|
57
71
|
|
|
72
|
+
Style/OptionalBooleanParameter:
|
|
73
|
+
Enabled: false
|
|
74
|
+
|
|
58
75
|
Style/ParallelAssignment:
|
|
59
76
|
Enabled: false
|
|
60
77
|
|
|
78
|
+
Style/RedundantArgument:
|
|
79
|
+
Enabled: false
|
|
80
|
+
|
|
81
|
+
Style/RedundantBegin:
|
|
82
|
+
Enabled: false
|
|
83
|
+
|
|
61
84
|
Style/SafeNavigation:
|
|
62
85
|
Enabled: false
|
|
63
86
|
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,58 +1,63 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2021-07-10 18:10:30 UTC using RuboCop version 1.18.3.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
9
|
# Offense count: 3
|
|
10
|
+
# Configuration parameters: IgnoredMethods.
|
|
10
11
|
Lint/AmbiguousBlockAssociation:
|
|
11
12
|
Exclude:
|
|
12
13
|
- 'lib/dump/reader.rb'
|
|
13
14
|
- 'spec/dump/table_manipulation_spec.rb'
|
|
14
15
|
|
|
15
|
-
# Offense count:
|
|
16
|
+
# Offense count: 2
|
|
16
17
|
# Cop supports --auto-correct.
|
|
17
|
-
|
|
18
|
+
# Configuration parameters: AllowPercentLiteralArrayArgument.
|
|
19
|
+
Lint/RedundantSplatExpansion:
|
|
18
20
|
Exclude:
|
|
19
21
|
- 'lib/dump.rb'
|
|
20
|
-
- 'spec/dump/writer_spec.rb'
|
|
21
22
|
|
|
22
23
|
# Offense count: 20
|
|
24
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
|
23
25
|
Metrics/AbcSize:
|
|
24
|
-
Max:
|
|
26
|
+
Max: 47
|
|
25
27
|
|
|
26
28
|
# Offense count: 11
|
|
27
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
|
28
|
-
#
|
|
29
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
|
30
|
+
# IgnoredMethods: refine
|
|
29
31
|
Metrics/BlockLength:
|
|
30
|
-
Max:
|
|
32
|
+
Max: 278
|
|
31
33
|
|
|
32
34
|
# Offense count: 3
|
|
33
|
-
# Configuration parameters: CountComments.
|
|
35
|
+
# Configuration parameters: CountComments, CountAsOne.
|
|
34
36
|
Metrics/ClassLength:
|
|
35
37
|
Max: 226
|
|
36
38
|
|
|
37
|
-
# Offense count:
|
|
39
|
+
# Offense count: 10
|
|
40
|
+
# Configuration parameters: IgnoredMethods.
|
|
38
41
|
Metrics/CyclomaticComplexity:
|
|
39
|
-
Max:
|
|
42
|
+
Max: 17
|
|
40
43
|
|
|
41
|
-
# Offense count:
|
|
42
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
|
44
|
+
# Offense count: 29
|
|
45
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
|
43
46
|
Metrics/MethodLength:
|
|
44
|
-
Max:
|
|
47
|
+
Max: 55
|
|
45
48
|
|
|
46
49
|
# Offense count: 2
|
|
47
|
-
# Configuration parameters: CountComments.
|
|
50
|
+
# Configuration parameters: CountComments, CountAsOne.
|
|
48
51
|
Metrics/ModuleLength:
|
|
49
52
|
Max: 130
|
|
50
53
|
|
|
51
|
-
# Offense count:
|
|
54
|
+
# Offense count: 6
|
|
55
|
+
# Configuration parameters: IgnoredMethods.
|
|
52
56
|
Metrics/PerceivedComplexity:
|
|
53
|
-
Max:
|
|
57
|
+
Max: 18
|
|
54
58
|
|
|
55
59
|
# Offense count: 3
|
|
60
|
+
# Cop supports --auto-correct.
|
|
56
61
|
# Configuration parameters: EnforcedStyle.
|
|
57
62
|
# SupportedStyles: lowercase, uppercase
|
|
58
63
|
Naming/HeredocDelimiterCase:
|
|
@@ -71,14 +76,6 @@ Security/YAMLLoad:
|
|
|
71
76
|
Exclude:
|
|
72
77
|
- 'spec/cycle_spec.rb'
|
|
73
78
|
|
|
74
|
-
# Offense count: 6
|
|
75
|
-
# Cop supports --auto-correct.
|
|
76
|
-
# Configuration parameters: EnforcedStyle.
|
|
77
|
-
# SupportedStyles: braces, no_braces, context_dependent
|
|
78
|
-
Style/BracesAroundHashParameters:
|
|
79
|
-
Exclude:
|
|
80
|
-
- 'spec/recipes/dump_spec.rb'
|
|
81
|
-
|
|
82
79
|
# Offense count: 3
|
|
83
80
|
# Cop supports --auto-correct.
|
|
84
81
|
Style/ExpandPathArguments:
|
|
@@ -97,7 +94,7 @@ Style/RescueStandardError:
|
|
|
97
94
|
- 'lib/dump/reader.rb'
|
|
98
95
|
- 'lib/dump/writer.rb'
|
|
99
96
|
|
|
100
|
-
# Offense count:
|
|
97
|
+
# Offense count: 9
|
|
101
98
|
# Cop supports --auto-correct.
|
|
102
99
|
Style/StderrPuts:
|
|
103
100
|
Exclude:
|
|
@@ -107,8 +104,9 @@ Style/StderrPuts:
|
|
|
107
104
|
- 'lib/dump/writer.rb'
|
|
108
105
|
- 'spec/cycle_spec.rb'
|
|
109
106
|
|
|
110
|
-
# Offense count:
|
|
111
|
-
#
|
|
107
|
+
# Offense count: 86
|
|
108
|
+
# Cop supports --auto-correct.
|
|
109
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
|
112
110
|
# URISchemes: http, https
|
|
113
|
-
|
|
111
|
+
Layout/LineLength:
|
|
114
112
|
Max: 210
|
data/Appraisals
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
def appgen(gems)
|
|
3
|
+
def appgen(gems) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
|
|
4
4
|
description = gems.map{ |name, version| "#{name} #{version}" }.join(', ')
|
|
5
|
-
appraise description do
|
|
5
|
+
appraise "ruby-#{RUBY_VERSION[/\d+\.\d+/]} #{description}" do
|
|
6
6
|
rails_version = gems['rails'][/\d+(\.\d+)+/]
|
|
7
7
|
|
|
8
8
|
gems.each do |name, version|
|
|
@@ -24,16 +24,27 @@ def appgen(gems)
|
|
|
24
24
|
gem 'activerecord-jdbc-adapter', "~> #{rails_version.scan(/\d+/).take(2).join('')}.0"
|
|
25
25
|
end
|
|
26
26
|
else
|
|
27
|
-
|
|
27
|
+
case
|
|
28
|
+
when rails_version =~ /^[2345]\./
|
|
29
|
+
gem 'sqlite3', '~> 1.3.5'
|
|
30
|
+
when RUBY_VERSION < '2.7'
|
|
31
|
+
gem 'sqlite3', '< 1.6'
|
|
32
|
+
when RUBY_VERSION < '3.0'
|
|
33
|
+
gem 'sqlite3', '< 1.7'
|
|
34
|
+
when rails_version < '7.1'
|
|
35
|
+
gem 'sqlite3', '~> 1.4'
|
|
36
|
+
else
|
|
37
|
+
gem 'sqlite3'
|
|
38
|
+
end
|
|
28
39
|
|
|
29
40
|
case
|
|
30
41
|
when rails_version =~ /^2\./
|
|
31
|
-
gem 'mysql2', '~> 0.3.
|
|
42
|
+
gem 'mysql2', '~> 0.3.13'
|
|
32
43
|
gem 'activerecord-mysql2-adapter'
|
|
33
|
-
when rails_version =~ /^3\./
|
|
34
|
-
gem 'mysql2', '~> 0.3.
|
|
44
|
+
when rails_version =~ /^3\.|^4\.[01]\./
|
|
45
|
+
gem 'mysql2', '~> 0.3.13'
|
|
35
46
|
when rails_version =~ /^4\./
|
|
36
|
-
gem 'mysql2', '
|
|
47
|
+
gem 'mysql2', '~> 0.4.0'
|
|
37
48
|
else
|
|
38
49
|
gem 'mysql2'
|
|
39
50
|
end
|
|
@@ -45,27 +56,54 @@ def appgen(gems)
|
|
|
45
56
|
gem 'pg', '~> 0.11'
|
|
46
57
|
when rails_version =~ /^4\./
|
|
47
58
|
gem 'pg', '~> 0.15'
|
|
59
|
+
when RUBY_VERSION < '3'
|
|
60
|
+
gem 'pg', '< 1.6.1'
|
|
48
61
|
else
|
|
49
62
|
gem 'pg'
|
|
50
63
|
end
|
|
64
|
+
|
|
65
|
+
if RUBY_VERSION < '2.0'
|
|
66
|
+
gem 'rake', '< 12.3'
|
|
67
|
+
gem 'rails-html-sanitizer', '< 1.5' if rails_version >= '4.2'
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
if RUBY_VERSION >= '3.0'
|
|
71
|
+
gem 'sorted_set'
|
|
72
|
+
gem 'net-smtp'
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
if RUBY_VERSION >= '3.4'
|
|
76
|
+
gem 'base64'
|
|
77
|
+
gem 'bigdecimal'
|
|
78
|
+
gem 'mutex_m'
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if RUBY_VERSION < '2.5'
|
|
82
|
+
gem 'loofah', '< 2.21.0'
|
|
83
|
+
end
|
|
51
84
|
end
|
|
52
85
|
end
|
|
53
86
|
end
|
|
54
87
|
|
|
55
|
-
if RUBY_VERSION < '2.0'
|
|
56
|
-
appgen 'rails' => '~> 2.3'
|
|
57
|
-
end
|
|
88
|
+
appgen 'rails' => '~> 2.3.0' if RUBY_VERSION < '2.0'
|
|
58
89
|
|
|
59
|
-
if RUBY_VERSION < '2.
|
|
60
|
-
|
|
61
|
-
end
|
|
90
|
+
appgen 'rails' => '~> 3.1.0' if RUBY_VERSION < '2.0'
|
|
91
|
+
appgen 'rails' => '~> 3.2.0' if RUBY_VERSION < '2.4'
|
|
62
92
|
|
|
63
|
-
if RUBY_VERSION >= '1.9'
|
|
64
|
-
|
|
65
|
-
|
|
93
|
+
appgen 'rails' => '~> 4.0.0' if RUBY_VERSION >= '1.9' && RUBY_VERSION < '2.3'
|
|
94
|
+
appgen 'rails' => '~> 4.1.0' if RUBY_VERSION >= '1.9' && RUBY_VERSION < '2.4'
|
|
95
|
+
appgen 'rails' => '~> 4.2.0' if RUBY_VERSION >= '1.9' && RUBY_VERSION < '2.5'
|
|
66
96
|
|
|
67
|
-
if RUBY_VERSION >= '2.2'
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
97
|
+
appgen 'rails' => '~> 5.0.0' if RUBY_VERSION >= '2.3' && RUBY_VERSION < '2.5'
|
|
98
|
+
appgen 'rails' => '~> 5.1.0' if RUBY_VERSION >= '2.3' && RUBY_VERSION < '2.6'
|
|
99
|
+
appgen 'rails' => '~> 5.2.0' if RUBY_VERSION >= '2.3' && RUBY_VERSION < '3.0'
|
|
100
|
+
|
|
101
|
+
appgen 'rails' => '~> 6.0.0' if RUBY_VERSION >= '2.5' && RUBY_VERSION < '3.1'
|
|
102
|
+
appgen 'rails' => '~> 6.1.0' if RUBY_VERSION >= '2.5'
|
|
103
|
+
|
|
104
|
+
appgen 'rails' => '~> 7.0.0' if RUBY_VERSION >= '2.7'
|
|
105
|
+
appgen 'rails' => '~> 7.1.0' if RUBY_VERSION >= '2.7'
|
|
106
|
+
appgen 'rails' => '~> 7.2.0' if RUBY_VERSION >= '3.1'
|
|
107
|
+
|
|
108
|
+
appgen 'rails' => '~> 8.0.0' if RUBY_VERSION >= '3.2'
|
|
109
|
+
appgen 'rails' => '~> 8.1.0' if RUBY_VERSION >= '3.2'
|
data/Gemfile
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
source '
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
5
|
gemspec
|
|
6
6
|
|
|
7
|
-
gem '
|
|
7
|
+
gem 'rake', '< 12.3' if RUBY_VERSION < '2.0'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
gem 'appraisal', *RUBY_VERSION < '2.3' ? ['< 2.3'] : ['>= 2.5']
|
|
10
|
+
|
|
11
|
+
if RUBY_VERSION >= '4'
|
|
12
|
+
gem 'benchmark'
|
|
11
13
|
end
|
data/LICENSE.txt
CHANGED
data/README.markdown
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
[](https://rubygems.org/gems/dump)
|
|
2
|
+
[](https://github.com/toy/dump/actions/workflows/check.yml)
|
|
3
|
+
[](https://github.com/toy/dump/actions/workflows/rubocop.yml)
|
|
4
4
|
|
|
5
5
|
# Dump
|
|
6
6
|
|
|
7
7
|
Rails app rake and capistrano tasks to create and restore dumps of database and assets.
|
|
8
8
|
|
|
9
|
-
Tested against rails 2.3
|
|
9
|
+
Tested against rails `2.3`..`8.1`.
|
|
10
10
|
|
|
11
|
-
Works with ruby 1.
|
|
11
|
+
Works with ruby `1.9.3`..`4.0`, nominally works with jruby (see [check workflow](https://github.com/toy/dump/actions/workflows/check.yml)).
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
@@ -259,4 +259,4 @@ where myappserver.com is application server carrying assets with database access
|
|
|
259
259
|
|
|
260
260
|
## Copyright
|
|
261
261
|
|
|
262
|
-
Copyright (c) 2008-
|
|
262
|
+
Copyright (c) 2008-2026 Ivan Kuchin. See LICENSE.txt for details.
|
data/dump.gemspec
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = 'dump'
|
|
5
|
-
s.version = '1.
|
|
5
|
+
s.version = '1.3.0'
|
|
6
6
|
s.summary = %q{Rails app rake and capistrano tasks to create and restore dumps of database and assets}
|
|
7
|
-
s.homepage = "
|
|
7
|
+
s.homepage = "https://github.com/toy/#{s.name}"
|
|
8
8
|
s.authors = ['Ivan Kuchin']
|
|
9
9
|
s.license = 'MIT'
|
|
10
10
|
|
|
11
|
+
s.required_ruby_version = '>= 1.9.3'
|
|
12
|
+
|
|
11
13
|
s.metadata = {
|
|
12
14
|
'bug_tracker_uri' => "https://github.com/toy/#{s.name}/issues",
|
|
13
15
|
'documentation_uri' => "https://www.rubydoc.info/gems/#{s.name}/#{s.version}",
|
|
@@ -19,11 +21,12 @@ Gem::Specification.new do |s|
|
|
|
19
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
20
22
|
s.require_paths = %w[lib]
|
|
21
23
|
|
|
22
|
-
s.add_dependency '
|
|
24
|
+
s.add_dependency 'minitar', '~> 0.6'
|
|
23
25
|
s.add_dependency 'progress', '~> 3.0', '>= 3.0.1', '!= 3.2.0', '!= 3.2.1'
|
|
24
26
|
|
|
25
27
|
s.add_development_dependency 'rspec', '~> 3.0'
|
|
26
|
-
if RUBY_VERSION >= '2.
|
|
27
|
-
s.add_development_dependency 'rubocop', '~>
|
|
28
|
+
if RUBY_VERSION >= '2.5' && !defined?(JRUBY_VERSION)
|
|
29
|
+
s.add_development_dependency 'rubocop', '~> 1.22', '!= 1.22.2'
|
|
30
|
+
s.add_development_dependency 'rubocop-rspec', '~> 2.0'
|
|
28
31
|
end
|
|
29
32
|
end
|
data/lib/dump/capistrano/v2.rb
CHANGED
|
@@ -113,11 +113,9 @@ Capistrano::Configuration.instance(:i_need_this!).load do
|
|
|
113
113
|
end
|
|
114
114
|
end
|
|
115
115
|
|
|
116
|
-
def with_additional_tags(*tags)
|
|
116
|
+
def with_additional_tags(*tags, &block)
|
|
117
117
|
tags = [tags, Dump::Env[:tags]].flatten.select(&:present?).join(',')
|
|
118
|
-
Dump::Env.with_env(:tags => tags)
|
|
119
|
-
yield
|
|
120
|
-
end
|
|
118
|
+
Dump::Env.with_env(:tags => tags, &block)
|
|
121
119
|
end
|
|
122
120
|
|
|
123
121
|
def print_and_return_or_fail
|
|
@@ -159,12 +157,12 @@ Capistrano::Configuration.instance(:i_need_this!).load do
|
|
|
159
157
|
end
|
|
160
158
|
|
|
161
159
|
namespace :local do
|
|
162
|
-
desc
|
|
160
|
+
desc "Shorthand for dump:local:create#{Dump::Env.explain_variables_for_command(:create)}"
|
|
163
161
|
task :default, :roles => :db, :only => {:primary => true} do
|
|
164
162
|
local.create
|
|
165
163
|
end
|
|
166
164
|
|
|
167
|
-
desc
|
|
165
|
+
desc "Create local dump#{Dump::Env.explain_variables_for_command(:create)}"
|
|
168
166
|
task :create, :roles => :db, :only => {:primary => true} do
|
|
169
167
|
print_and_return_or_fail do
|
|
170
168
|
with_additional_tags('local') do
|
|
@@ -173,22 +171,22 @@ Capistrano::Configuration.instance(:i_need_this!).load do
|
|
|
173
171
|
end
|
|
174
172
|
end
|
|
175
173
|
|
|
176
|
-
desc
|
|
174
|
+
desc "Restore local dump#{Dump::Env.explain_variables_for_command(:restore)}"
|
|
177
175
|
task :restore, :roles => :db, :only => {:primary => true} do
|
|
178
176
|
run_local(dump_command(:restore))
|
|
179
177
|
end
|
|
180
178
|
|
|
181
|
-
desc
|
|
179
|
+
desc "Versions of local dumps#{Dump::Env.explain_variables_for_command(:versions)}"
|
|
182
180
|
task :versions, :roles => :db, :only => {:primary => true} do
|
|
183
181
|
print run_local(dump_command(:versions, :show_size => true))
|
|
184
182
|
end
|
|
185
183
|
|
|
186
|
-
desc
|
|
184
|
+
desc "Cleanup local dumps#{Dump::Env.explain_variables_for_command(:cleanup)}"
|
|
187
185
|
task :cleanup, :roles => :db, :only => {:primary => true} do
|
|
188
186
|
print run_local(dump_command(:cleanup))
|
|
189
187
|
end
|
|
190
188
|
|
|
191
|
-
desc
|
|
189
|
+
desc "Upload dump#{Dump::Env.explain_variables_for_command(:transfer)}"
|
|
192
190
|
task :upload, :roles => :db, :only => {:primary => true} do
|
|
193
191
|
file = Dump::Env.with_env(:summary => nil) do
|
|
194
192
|
last_part_of_last_line(run_local(dump_command(:versions)))
|
|
@@ -200,12 +198,12 @@ Capistrano::Configuration.instance(:i_need_this!).load do
|
|
|
200
198
|
end
|
|
201
199
|
|
|
202
200
|
namespace :remote do
|
|
203
|
-
desc
|
|
201
|
+
desc "Shorthand for dump:remote:create#{Dump::Env.explain_variables_for_command(:create)}"
|
|
204
202
|
task :default, :roles => :db, :only => {:primary => true} do
|
|
205
203
|
remote.create
|
|
206
204
|
end
|
|
207
205
|
|
|
208
|
-
desc
|
|
206
|
+
desc "Create remote dump#{Dump::Env.explain_variables_for_command(:create)}"
|
|
209
207
|
task :create, :roles => :db, :only => {:primary => true} do
|
|
210
208
|
print_and_return_or_fail do
|
|
211
209
|
with_additional_tags('remote') do
|
|
@@ -214,22 +212,22 @@ Capistrano::Configuration.instance(:i_need_this!).load do
|
|
|
214
212
|
end
|
|
215
213
|
end
|
|
216
214
|
|
|
217
|
-
desc
|
|
215
|
+
desc "Restore remote dump#{Dump::Env.explain_variables_for_command(:restore)}"
|
|
218
216
|
task :restore, :roles => :db, :only => {:primary => true} do
|
|
219
217
|
run_remote("cd #{current_path}; #{dump_command(:restore, :rake => fetch_rake, :RAILS_ENV => fetch_rails_env, :PROGRESS_TTY => '+')}")
|
|
220
218
|
end
|
|
221
219
|
|
|
222
|
-
desc
|
|
220
|
+
desc "Versions of remote dumps#{Dump::Env.explain_variables_for_command(:versions)}"
|
|
223
221
|
task :versions, :roles => :db, :only => {:primary => true} do
|
|
224
222
|
print run_remote("cd #{current_path}; #{dump_command(:versions, :rake => fetch_rake, :RAILS_ENV => fetch_rails_env, :PROGRESS_TTY => '+', :show_size => true)}")
|
|
225
223
|
end
|
|
226
224
|
|
|
227
|
-
desc
|
|
225
|
+
desc "Cleanup of remote dumps#{Dump::Env.explain_variables_for_command(:cleanup)}"
|
|
228
226
|
task :cleanup, :roles => :db, :only => {:primary => true} do
|
|
229
227
|
print run_remote("cd #{current_path}; #{dump_command(:cleanup, :rake => fetch_rake, :RAILS_ENV => fetch_rails_env, :PROGRESS_TTY => '+')}")
|
|
230
228
|
end
|
|
231
229
|
|
|
232
|
-
desc
|
|
230
|
+
desc "Download dump#{Dump::Env.explain_variables_for_command(:transfer)}"
|
|
233
231
|
task :download, :roles => :db, :only => {:primary => true} do
|
|
234
232
|
file = Dump::Env.with_env(:summary => nil) do
|
|
235
233
|
last_part_of_last_line(run_remote("cd #{current_path}; #{dump_command(:versions, :rake => fetch_rake, :RAILS_ENV => fetch_rails_env, :PROGRESS_TTY => '+')}"))
|
|
@@ -241,18 +239,18 @@ Capistrano::Configuration.instance(:i_need_this!).load do
|
|
|
241
239
|
end
|
|
242
240
|
end
|
|
243
241
|
|
|
244
|
-
desc
|
|
242
|
+
desc "Shorthand for dump:local:upload#{Dump::Env.explain_variables_for_command(:transfer)}"
|
|
245
243
|
task :upload, :roles => :db, :only => {:primary => true} do
|
|
246
244
|
local.upload
|
|
247
245
|
end
|
|
248
246
|
|
|
249
|
-
desc
|
|
247
|
+
desc "Shorthand for dump:remote:download#{Dump::Env.explain_variables_for_command(:transfer)}"
|
|
250
248
|
task :download, :roles => :db, :only => {:primary => true} do
|
|
251
249
|
remote.download
|
|
252
250
|
end
|
|
253
251
|
|
|
254
252
|
namespace :mirror do
|
|
255
|
-
desc
|
|
253
|
+
desc "Creates local dump, uploads and restores on remote#{Dump::Env.explain_variables_for_command(:mirror)}"
|
|
256
254
|
task :up, :roles => :db, :only => {:primary => true} do
|
|
257
255
|
auto_backup = if auto_backup?
|
|
258
256
|
with_additional_tags('auto-backup') do
|
|
@@ -272,7 +270,7 @@ Capistrano::Configuration.instance(:i_need_this!).load do
|
|
|
272
270
|
end
|
|
273
271
|
end
|
|
274
272
|
|
|
275
|
-
desc
|
|
273
|
+
desc "Creates remote dump, downloads and restores on local#{Dump::Env.explain_variables_for_command(:mirror)}"
|
|
276
274
|
task :down, :roles => :db, :only => {:primary => true} do
|
|
277
275
|
auto_backup = if auto_backup?
|
|
278
276
|
with_additional_tags('auto-backup') do
|
|
@@ -294,12 +292,12 @@ Capistrano::Configuration.instance(:i_need_this!).load do
|
|
|
294
292
|
end
|
|
295
293
|
|
|
296
294
|
namespace :backup do
|
|
297
|
-
desc
|
|
295
|
+
desc "Shorthand for dump:backup:create#{Dump::Env.explain_variables_for_command(:backup)}"
|
|
298
296
|
task :default, :roles => :db, :only => {:primary => true} do
|
|
299
297
|
backup.create
|
|
300
298
|
end
|
|
301
299
|
|
|
302
|
-
desc "Creates remote dump and downloads to local (desc defaults to 'backup')
|
|
300
|
+
desc "Creates remote dump and downloads to local (desc defaults to 'backup')#{Dump::Env.explain_variables_for_command(:backup)}"
|
|
303
301
|
task :create, :roles => :db, :only => {:primary => true} do
|
|
304
302
|
file = with_additional_tags('backup') do
|
|
305
303
|
remote.create
|
|
@@ -311,7 +309,7 @@ Capistrano::Configuration.instance(:i_need_this!).load do
|
|
|
311
309
|
end
|
|
312
310
|
end
|
|
313
311
|
|
|
314
|
-
desc
|
|
312
|
+
desc "Uploads dump with backup tag and restores it on remote#{Dump::Env.explain_variables_for_command(:backup_restore)}"
|
|
315
313
|
task :restore, :roles => :db, :only => {:primary => true} do
|
|
316
314
|
file = with_additional_tags('backup') do
|
|
317
315
|
last_part_of_last_line(run_local(dump_command(:versions)))
|