dumpcar 0.1.2 → 0.2
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 +8 -5
- data/lib/dumpcar/util.rb +9 -0
- data/lib/dumpcar/version.rb +1 -1
- data/lib/dumpcar.rb +1 -0
- data/package.json +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36f1dd091285da9e5736495a0ffc53e2b73176cc327a6d138f2ea8663e0b4d6a
|
4
|
+
data.tar.gz: 38d4fe0b357fc007491a154b6203a31514d22f17a21f38c40cfb0fe64eb7d8c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bbe63e7e62033e29df0e1ae907adfbe03edede801be02af50dd551bdc7d98bf41874ff2c46ca790813f18ec34068846f0905fbec696cd78fb61df31978675ec
|
7
|
+
data.tar.gz: a9f5a753441535c546e4c2b20af60f8b8b9ea3c4cb42ef9db7aa74bc68780ab84ede78d24d8fd8eea2f11d39a97341a1231d660e164eca8660fa1c07151c6fab
|
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
@@ -12,9 +12,8 @@ module Dumpcar
|
|
12
12
|
config => {password:, host:, port:, username:, database:}
|
13
13
|
line = Terrapin::CommandLine.new("pg_restore",
|
14
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:)
|
15
|
+
environment: {"PGPASSWORD" => password},
|
16
|
+
logger:)
|
18
17
|
line.run(password:, host:, port:, username:, database:, filename:)
|
19
18
|
end
|
20
19
|
end
|
@@ -24,8 +23,8 @@ module Dumpcar
|
|
24
23
|
config => {password:, host:, port:, username:, database:}
|
25
24
|
line = Terrapin::CommandLine.new("pg_dump",
|
26
25
|
"--host :host --port :port --username :username --clean --format=c --create --if-exists --no-owner --no-acl :database --file=:filename",
|
27
|
-
environment: {"PGPASSWORD" => password}
|
28
|
-
|
26
|
+
environment: {"PGPASSWORD" => password},
|
27
|
+
logger:)
|
29
28
|
line.run(password:, host:, port:, username:, database:, filename:)
|
30
29
|
end
|
31
30
|
end
|
@@ -34,6 +33,10 @@ module Dumpcar
|
|
34
33
|
yield self.class.defaults.merge(connection)
|
35
34
|
end
|
36
35
|
|
36
|
+
def logger
|
37
|
+
Dumpcar::Util.logger
|
38
|
+
end
|
39
|
+
|
37
40
|
def self.defaults
|
38
41
|
{
|
39
42
|
host: "localhost",
|
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.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Schultz
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/dumpcar/location.rb
|
76
76
|
- lib/dumpcar/pg.rb
|
77
77
|
- lib/dumpcar/railtie.rb
|
78
|
+
- lib/dumpcar/util.rb
|
78
79
|
- lib/dumpcar/version.rb
|
79
80
|
- lib/rails/commands/dumpcar_command.rb
|
80
81
|
- package-lock.json
|