dumpcar 0.1.1.2 → 0.1.2.1
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/.standard.yml +2 -0
- data/README.md +2 -0
- data/gemfiles/rails_6.0.gemfile +3 -3
- data/gemfiles/rails_6.1.gemfile +3 -3
- data/gemfiles/rails_7.0.gemfile +3 -3
- data/gemfiles/rails_7.1.gemfile +3 -3
- data/gemfiles/rails_7.2.gemfile +3 -3
- data/gemfiles/rails_8.0.gemfile +3 -3
- data/gemfiles/rails_edge.gemfile +4 -4
- data/lib/dumpcar/instance.rb +1 -7
- data/lib/dumpcar/pg.rb +12 -6
- data/lib/dumpcar/util.rb +5 -0
- data/lib/dumpcar/version.rb +1 -1
- data/lib/dumpcar.rb +1 -0
- data/package.json +1 -1
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1396e074eed574e995b27cd85826da3f17e6aab55d39791a2dd3b9a1bb764c58
|
4
|
+
data.tar.gz: 1c9e4115887c5fe9b8372c1d5890e5c3cb710a740c63ee633c50244af0567be9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 982e4e4c0417eabccdba95b61a41862755caa7c45f5c77706e248ec92cfb4916755dbf479cb2b31597663991c2afb0db2f98878f0b1a3cd1d2c620ecbd118a58
|
7
|
+
data.tar.gz: 5a92d2ad81a9340c03f93eb5d6350fedbff646ad574500821ba56ea050e1e76ad4e2ee1576c6e25dcee87db924dad97026893d05b3a124ee84b8b6031e628b26
|
data/.standard.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Dumpcar
|
2
2
|
|
3
|
+
[](https://rubygems.org/gems/dumpcar)
|
4
|
+
|
3
5
|
Rake tasks for dumping and restoring the contents of the PostgreSQL database for your Rails application.
|
4
6
|
|
5
7
|
- Dump (`rails dumpcar:dump`) and restore your last dump (`rails dumpcar:restore`) with a single command
|
data/gemfiles/rails_6.0.gemfile
CHANGED
@@ -6,16 +6,16 @@ gem "aruba", "~> 2.3"
|
|
6
6
|
gem "irb"
|
7
7
|
gem "rake", "~> 13.0"
|
8
8
|
gem "rspec", "~> 3.0"
|
9
|
-
gem "rspec-github", require
|
9
|
+
gem "rspec-github", :require => false
|
10
10
|
gem "shoulda-matchers"
|
11
11
|
gem "standard", "~> 1.3"
|
12
12
|
gem "combustion"
|
13
13
|
gem "pg"
|
14
14
|
gem "rspec-rails"
|
15
15
|
gem "database_cleaner-active_record"
|
16
|
-
gem "appraisal", git
|
16
|
+
gem "appraisal", :git => "https://github.com/pboling/appraisal.git", :ref => "c353e3ee3105a3db8aab49d51df8c159959165a0"
|
17
17
|
gem "debug"
|
18
18
|
gem "rails", "~> 6.0.0"
|
19
19
|
gem "concurrent-ruby", "1.3.4"
|
20
20
|
|
21
|
-
gemspec path
|
21
|
+
gemspec :path => "../"
|
data/gemfiles/rails_6.1.gemfile
CHANGED
@@ -6,16 +6,16 @@ gem "aruba", "~> 2.3"
|
|
6
6
|
gem "irb"
|
7
7
|
gem "rake", "~> 13.0"
|
8
8
|
gem "rspec", "~> 3.0"
|
9
|
-
gem "rspec-github", require
|
9
|
+
gem "rspec-github", :require => false
|
10
10
|
gem "shoulda-matchers"
|
11
11
|
gem "standard", "~> 1.3"
|
12
12
|
gem "combustion"
|
13
13
|
gem "pg"
|
14
14
|
gem "rspec-rails"
|
15
15
|
gem "database_cleaner-active_record"
|
16
|
-
gem "appraisal", git
|
16
|
+
gem "appraisal", :git => "https://github.com/pboling/appraisal.git", :ref => "c353e3ee3105a3db8aab49d51df8c159959165a0"
|
17
17
|
gem "debug"
|
18
18
|
gem "rails", "~> 6.1.0"
|
19
19
|
gem "concurrent-ruby", "1.3.4"
|
20
20
|
|
21
|
-
gemspec path
|
21
|
+
gemspec :path => "../"
|
data/gemfiles/rails_7.0.gemfile
CHANGED
@@ -6,16 +6,16 @@ gem "aruba", "~> 2.3"
|
|
6
6
|
gem "irb"
|
7
7
|
gem "rake", "~> 13.0"
|
8
8
|
gem "rspec", "~> 3.0"
|
9
|
-
gem "rspec-github", require
|
9
|
+
gem "rspec-github", :require => false
|
10
10
|
gem "shoulda-matchers"
|
11
11
|
gem "standard", "~> 1.3"
|
12
12
|
gem "combustion"
|
13
13
|
gem "pg"
|
14
14
|
gem "rspec-rails"
|
15
15
|
gem "database_cleaner-active_record"
|
16
|
-
gem "appraisal", git
|
16
|
+
gem "appraisal", :git => "https://github.com/pboling/appraisal.git", :ref => "c353e3ee3105a3db8aab49d51df8c159959165a0"
|
17
17
|
gem "debug"
|
18
18
|
gem "rails", "~> 7.0.0"
|
19
19
|
gem "concurrent-ruby", "1.3.4"
|
20
20
|
|
21
|
-
gemspec path
|
21
|
+
gemspec :path => "../"
|
data/gemfiles/rails_7.1.gemfile
CHANGED
@@ -6,15 +6,15 @@ gem "aruba", "~> 2.3"
|
|
6
6
|
gem "irb"
|
7
7
|
gem "rake", "~> 13.0"
|
8
8
|
gem "rspec", "~> 3.0"
|
9
|
-
gem "rspec-github", require
|
9
|
+
gem "rspec-github", :require => false
|
10
10
|
gem "shoulda-matchers"
|
11
11
|
gem "standard", "~> 1.3"
|
12
12
|
gem "combustion"
|
13
13
|
gem "pg"
|
14
14
|
gem "rspec-rails"
|
15
15
|
gem "database_cleaner-active_record"
|
16
|
-
gem "appraisal", git
|
16
|
+
gem "appraisal", :git => "https://github.com/pboling/appraisal.git", :ref => "c353e3ee3105a3db8aab49d51df8c159959165a0"
|
17
17
|
gem "debug"
|
18
18
|
gem "rails", "~> 7.1.0"
|
19
19
|
|
20
|
-
gemspec path
|
20
|
+
gemspec :path => "../"
|
data/gemfiles/rails_7.2.gemfile
CHANGED
@@ -6,15 +6,15 @@ gem "aruba", "~> 2.3"
|
|
6
6
|
gem "irb"
|
7
7
|
gem "rake", "~> 13.0"
|
8
8
|
gem "rspec", "~> 3.0"
|
9
|
-
gem "rspec-github", require
|
9
|
+
gem "rspec-github", :require => false
|
10
10
|
gem "shoulda-matchers"
|
11
11
|
gem "standard", "~> 1.3"
|
12
12
|
gem "combustion"
|
13
13
|
gem "pg"
|
14
14
|
gem "rspec-rails"
|
15
15
|
gem "database_cleaner-active_record"
|
16
|
-
gem "appraisal", git
|
16
|
+
gem "appraisal", :git => "https://github.com/pboling/appraisal.git", :ref => "c353e3ee3105a3db8aab49d51df8c159959165a0"
|
17
17
|
gem "debug"
|
18
18
|
gem "rails", "~> 7.2.0"
|
19
19
|
|
20
|
-
gemspec path
|
20
|
+
gemspec :path => "../"
|
data/gemfiles/rails_8.0.gemfile
CHANGED
@@ -6,15 +6,15 @@ gem "aruba", "~> 2.3"
|
|
6
6
|
gem "irb"
|
7
7
|
gem "rake", "~> 13.0"
|
8
8
|
gem "rspec", "~> 3.0"
|
9
|
-
gem "rspec-github", require
|
9
|
+
gem "rspec-github", :require => false
|
10
10
|
gem "shoulda-matchers"
|
11
11
|
gem "standard", "~> 1.3"
|
12
12
|
gem "combustion"
|
13
13
|
gem "pg"
|
14
14
|
gem "rspec-rails"
|
15
15
|
gem "database_cleaner-active_record"
|
16
|
-
gem "appraisal", git
|
16
|
+
gem "appraisal", :git => "https://github.com/pboling/appraisal.git", :ref => "c353e3ee3105a3db8aab49d51df8c159959165a0"
|
17
17
|
gem "debug"
|
18
18
|
gem "rails", "~> 8.0.0"
|
19
19
|
|
20
|
-
gemspec path
|
20
|
+
gemspec :path => "../"
|
data/gemfiles/rails_edge.gemfile
CHANGED
@@ -6,15 +6,15 @@ gem "aruba", "~> 2.3"
|
|
6
6
|
gem "irb"
|
7
7
|
gem "rake", "~> 13.0"
|
8
8
|
gem "rspec", "~> 3.0"
|
9
|
-
gem "rspec-github", require
|
9
|
+
gem "rspec-github", :require => false
|
10
10
|
gem "shoulda-matchers"
|
11
11
|
gem "standard", "~> 1.3"
|
12
12
|
gem "combustion"
|
13
13
|
gem "pg"
|
14
14
|
gem "rspec-rails"
|
15
15
|
gem "database_cleaner-active_record"
|
16
|
-
gem "appraisal", git
|
16
|
+
gem "appraisal", :git => "https://github.com/pboling/appraisal.git", :ref => "c353e3ee3105a3db8aab49d51df8c159959165a0"
|
17
17
|
gem "debug"
|
18
|
-
gem "rails", github
|
18
|
+
gem "rails", :github => "rails/rails", :branch => "main"
|
19
19
|
|
20
|
-
gemspec path
|
20
|
+
gemspec :path => "../"
|
data/lib/dumpcar/instance.rb
CHANGED
@@ -3,7 +3,7 @@ module Dumpcar
|
|
3
3
|
attr_reader :location, :pg
|
4
4
|
def initialize(base: Rails.root.join("db/dumps"))
|
5
5
|
@location = Location.new(base)
|
6
|
-
@pg = Pg.new(get_connection_db_config)
|
6
|
+
@pg = Pg.new(Dumpcar::Util.get_connection_db_config)
|
7
7
|
end
|
8
8
|
|
9
9
|
def dump
|
@@ -13,11 +13,5 @@ module Dumpcar
|
|
13
13
|
def restore
|
14
14
|
@pg.restore(@location.last)
|
15
15
|
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def get_connection_db_config
|
20
|
-
(Rails.version < "6.1") ? ActiveRecord::Base.connection_config : ActiveRecord::Base.connection_db_config.configuration_hash
|
21
|
-
end
|
22
16
|
end
|
23
17
|
end
|
data/lib/dumpcar/pg.rb
CHANGED
@@ -3,24 +3,30 @@ module Dumpcar
|
|
3
3
|
attr_reader :connection
|
4
4
|
|
5
5
|
def initialize(connection)
|
6
|
+
require "terrapin"
|
6
7
|
@connection = connection
|
7
8
|
end
|
8
9
|
|
9
10
|
def restore(filename)
|
10
11
|
with_database_config do |config|
|
11
12
|
config => {password:, host:, port:, username:, database:}
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
line = Terrapin::CommandLine.new("pg_restore",
|
14
|
+
"--verbose --clean --no-acl --no-owner -h :host -U :username -d :database -p :port :filename",
|
15
|
+
environment: {"PGPASSWORD" => password})
|
16
|
+
|
17
|
+
puts line.command(password:, host:, port:, username:, database:, filename:)
|
18
|
+
line.run(password:, host:, port:, username:, database:, filename:)
|
15
19
|
end
|
16
20
|
end
|
17
21
|
|
18
22
|
def dump(filename)
|
19
23
|
with_database_config do |config|
|
20
24
|
config => {password:, host:, port:, username:, database:}
|
21
|
-
|
22
|
-
|
23
|
-
|
25
|
+
line = Terrapin::CommandLine.new("pg_dump",
|
26
|
+
"--host :host --port :port --username :username --clean --format=c --create --if-exists --no-owner --no-acl :database --file=:filename",
|
27
|
+
environment: {"PGPASSWORD" => password})
|
28
|
+
puts line.command(password:, host:, port:, username:, database:, filename:)
|
29
|
+
line.run(password:, host:, port:, username:, database:, filename:)
|
24
30
|
end
|
25
31
|
end
|
26
32
|
|
data/lib/dumpcar/util.rb
ADDED
data/lib/dumpcar/version.rb
CHANGED
data/lib/dumpcar.rb
CHANGED
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dumpcar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1
|
4
|
+
version: 0.1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Schultz
|
@@ -23,6 +23,20 @@ dependencies:
|
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
25
|
version: '6'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: terrapin
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1'
|
26
40
|
email:
|
27
41
|
- eric@wwahammy.com
|
28
42
|
executables: []
|
@@ -61,6 +75,7 @@ files:
|
|
61
75
|
- lib/dumpcar/location.rb
|
62
76
|
- lib/dumpcar/pg.rb
|
63
77
|
- lib/dumpcar/railtie.rb
|
78
|
+
- lib/dumpcar/util.rb
|
64
79
|
- lib/dumpcar/version.rb
|
65
80
|
- lib/rails/commands/dumpcar_command.rb
|
66
81
|
- package-lock.json
|